@recursyve/ngx-material-components 22.0.0 → 22.2.0
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/_sass/_override-utils.scss +31 -0
- package/colorpicker/_index.scss +1 -0
- package/colorpicker/_theme.scss +19 -0
- package/fesm2022/recursyve-ngx-material-components-chip-list.mjs +2 -2
- package/fesm2022/recursyve-ngx-material-components-chip-list.mjs.map +1 -1
- package/fesm2022/recursyve-ngx-material-components-colorpicker.mjs +237 -0
- package/fesm2022/recursyve-ngx-material-components-colorpicker.mjs.map +1 -0
- package/fesm2022/recursyve-ngx-material-components-dropzone.mjs +23 -7
- package/fesm2022/recursyve-ngx-material-components-dropzone.mjs.map +1 -1
- package/fesm2022/recursyve-ngx-material-components-form-field-error.mjs +174 -33
- package/fesm2022/recursyve-ngx-material-components-form-field-error.mjs.map +1 -1
- package/fesm2022/recursyve-ngx-material-components-timepicker.mjs +550 -0
- package/fesm2022/recursyve-ngx-material-components-timepicker.mjs.map +1 -0
- package/fesm2022/recursyve-ngx-material-components-typeahead.mjs +24 -12
- package/fesm2022/recursyve-ngx-material-components-typeahead.mjs.map +1 -1
- package/package.json +16 -4
- package/timepicker/_index.scss +1 -0
- package/timepicker/_theme.scss +41 -0
- package/types/recursyve-ngx-material-components-colorpicker.d.ts +77 -0
- package/types/recursyve-ngx-material-components-dropzone.d.ts +8 -1
- package/types/recursyve-ngx-material-components-form-field-error.d.ts +25 -3
- package/types/recursyve-ngx-material-components-timepicker.d.ts +99 -0
- package/types/recursyve-ngx-material-components-typeahead.d.ts +3 -0
|
@@ -146,13 +146,13 @@ class NiceDropzoneFilePreview {
|
|
|
146
146
|
...(ngDevMode ? [{ debugName: "imageUrl" }] : /* istanbul ignore next */ []));
|
|
147
147
|
_translationKeys = inject(NICE_DROPZONE_TRANSLATION_KEYS);
|
|
148
148
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NiceDropzoneFilePreview, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
149
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NiceDropzoneFilePreview, isStandalone: true, selector: "nice-dropzone-file-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { clickDelete: "clickDelete" }, host: { styleAttribute: "flex: 1 1 auto;" }, ngImport: i0, template: "<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button
|
|
149
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NiceDropzoneFilePreview, isStandalone: true, selector: "nice-dropzone-file-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { clickDelete: "clickDelete" }, host: { styleAttribute: "flex: 1 1 auto;" }, ngImport: i0, template: "<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button\n class=\"nice-dropzone-preview-actions-delete\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); clickDelete.emit()\"\n >\n <nice-dropzone-delete-icon />\n </button>\n </div>\n</div>\n", styles: [".nice-dropzone-preview{position:relative;display:flex;align-items:center;justify-content:center;flex:1 1 auto;gap:32px;height:100px;padding-top:12px;padding-bottom:12px;border-style:solid;border-radius:var(--nice-dropzone-shape, 8px);border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-preview .nice-dropzone-preview-image{max-height:100%;max-width:min(200px,50%);-webkit-user-select:none;user-select:none}.nice-dropzone-preview .nice-dropzone-preview-file{color:var(--mat-sys-primary)}.nice-dropzone-preview .nice-dropzone-preview-file-info{display:flex;flex-direction:column;gap:4px;max-width:min(400px,40%);-webkit-user-select:none;user-select:none}.nice-dropzone-preview .nice-dropzone-preview-actions{position:absolute;width:24px;height:24px;background-color:var(--mat-sys-on-primary);border-radius:50%;top:-12px;right:-12px;opacity:0;transition:opacity .1s ease-in-out}.nice-dropzone-preview .nice-dropzone-preview-actions .nice-dropzone-preview-actions-delete{background-color:transparent;color:var(--mat-sys-primary);border:none;cursor:pointer;padding:0}.nice-dropzone-preview:hover .nice-dropzone-preview-actions,.nice-dropzone-preview:focus .nice-dropzone-preview-actions{opacity:1}\n"], dependencies: [{ kind: "component", type: NiceDropzoneDeleteIcon, selector: "nice-dropzone-delete-icon" }, { kind: "component", type: NiceDropzoneFileIcon, selector: "nice-dropzone-file-icon" }, { kind: "pipe", type: NiceTranslatePipe, name: "niceTranslate" }, { kind: "pipe", type: FileSizePipe, name: "niceFileSize" }], changeDetection: i0.ChangeDetectionStrategy.Eager });
|
|
150
150
|
}
|
|
151
151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NiceDropzoneFilePreview, decorators: [{
|
|
152
152
|
type: Component,
|
|
153
153
|
args: [{ selector: "nice-dropzone-file-preview", imports: [NiceDropzoneDeleteIcon, NiceTranslatePipe, FileSizePipe, NiceDropzoneFileIcon], changeDetection: ChangeDetectionStrategy.Eager, host: {
|
|
154
154
|
style: "flex: 1 1 auto;"
|
|
155
|
-
}, template: "<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button
|
|
155
|
+
}, template: "<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button\n class=\"nice-dropzone-preview-actions-delete\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); clickDelete.emit()\"\n >\n <nice-dropzone-delete-icon />\n </button>\n </div>\n</div>\n", styles: [".nice-dropzone-preview{position:relative;display:flex;align-items:center;justify-content:center;flex:1 1 auto;gap:32px;height:100px;padding-top:12px;padding-bottom:12px;border-style:solid;border-radius:var(--nice-dropzone-shape, 8px);border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-preview .nice-dropzone-preview-image{max-height:100%;max-width:min(200px,50%);-webkit-user-select:none;user-select:none}.nice-dropzone-preview .nice-dropzone-preview-file{color:var(--mat-sys-primary)}.nice-dropzone-preview .nice-dropzone-preview-file-info{display:flex;flex-direction:column;gap:4px;max-width:min(400px,40%);-webkit-user-select:none;user-select:none}.nice-dropzone-preview .nice-dropzone-preview-actions{position:absolute;width:24px;height:24px;background-color:var(--mat-sys-on-primary);border-radius:50%;top:-12px;right:-12px;opacity:0;transition:opacity .1s ease-in-out}.nice-dropzone-preview .nice-dropzone-preview-actions .nice-dropzone-preview-actions-delete{background-color:transparent;color:var(--mat-sys-primary);border:none;cursor:pointer;padding:0}.nice-dropzone-preview:hover .nice-dropzone-preview-actions,.nice-dropzone-preview:focus .nice-dropzone-preview-actions{opacity:1}\n"] }]
|
|
156
156
|
}], propDecorators: { file: [{ type: i0.Input, args: [{ isSignal: true, alias: "file", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: true }] }], clickDelete: [{ type: i0.Output, args: ["clickDelete"] }] } });
|
|
157
157
|
|
|
158
158
|
const niceDropzoneModes = ["image", "file", "all"];
|
|
@@ -167,6 +167,8 @@ class NiceDropzone {
|
|
|
167
167
|
...(ngDevMode ? [undefined, { debugName: "config" }] : /* istanbul ignore next */ []));
|
|
168
168
|
maxFileSize = input(/* @ts-ignore */
|
|
169
169
|
...(ngDevMode ? [undefined, { debugName: "maxFileSize" }] : /* istanbul ignore next */ []));
|
|
170
|
+
uploadProgress = input(null, /* @ts-ignore */
|
|
171
|
+
...(ngDevMode ? [{ debugName: "uploadProgress" }] : /* istanbul ignore next */ []));
|
|
170
172
|
_elementRef = viewChild("element", { ...(ngDevMode ? { debugName: "_elementRef" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
171
173
|
_inputRef = viewChild("fileInput", /* @ts-ignore */
|
|
172
174
|
...(ngDevMode ? [{ debugName: "_inputRef" }] : /* istanbul ignore next */ []));
|
|
@@ -178,6 +180,16 @@ class NiceDropzone {
|
|
|
178
180
|
_translationKeys = inject(NICE_DROPZONE_TRANSLATION_KEYS);
|
|
179
181
|
files = signal([], /* @ts-ignore */
|
|
180
182
|
...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
183
|
+
isUploading = computed(() => this.uploadProgress() !== null, /* @ts-ignore */
|
|
184
|
+
...(ngDevMode ? [{ debugName: "isUploading" }] : /* istanbul ignore next */ []));
|
|
185
|
+
normalizedUploadProgress = computed(() => {
|
|
186
|
+
const progress = this.uploadProgress();
|
|
187
|
+
if (progress === null) {
|
|
188
|
+
return 0;
|
|
189
|
+
}
|
|
190
|
+
return Math.min(100, Math.max(0, progress));
|
|
191
|
+
}, /* @ts-ignore */
|
|
192
|
+
...(ngDevMode ? [{ debugName: "normalizedUploadProgress" }] : /* istanbul ignore next */ []));
|
|
181
193
|
_disabled = false;
|
|
182
194
|
_onChange;
|
|
183
195
|
_value = null;
|
|
@@ -295,13 +307,13 @@ class NiceDropzone {
|
|
|
295
307
|
input.nativeElement.value = "";
|
|
296
308
|
}
|
|
297
309
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NiceDropzone, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
298
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NiceDropzone, isStandalone: true, selector: "nice-dropzone", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
310
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: NiceDropzone, isStandalone: true, selector: "nice-dropzone", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, maxFileSize: { classPropertyName: "maxFileSize", publicName: "maxFileSize", isSignal: true, isRequired: false, transformFunction: null }, uploadProgress: { classPropertyName: "uploadProgress", publicName: "uploadProgress", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
299
311
|
{
|
|
300
312
|
provide: NG_VALUE_ACCESSOR,
|
|
301
313
|
useExisting: forwardRef(() => NiceDropzone),
|
|
302
314
|
multi: true
|
|
303
315
|
}
|
|
304
|
-
], viewQueries: [{ propertyName: "_elementRef", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_inputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n", styles: [".nice-dropzone-container{--nice-dropzone-ripple-color: color-mix(in srgb, var(--mat-sys-primary) 10%, transparent);--mat-ripple-color: var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone{position:relative;display:flex;justify-content:center;place-items:center;cursor:pointer;min-height:124px;border-radius:var(--nice-dropzone-shape, 8px)}.nice-dropzone-container .nice-dropzone.nice-dropzone-single:not(.nice-dropzone-selected),.nice-dropzone-container .nice-dropzone.nice-dropzone-multiple{border-style:dashed;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-placeholder{display:flex;justify-content:center;place-items:center;gap:32px}.nice-dropzone-container .nice-dropzone .nice-dropzone-icon{color:var(--nice-dropzone-icon-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content{-webkit-user-select:none;user-select:none;color:var(--nice-dropzone-text-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-title{font-size:var(--nice-dropzone-content-title-font-size, 18px);font-weight:var(--nice-dropzone-content-title-font-weight, 600);line-height:var(--nice-dropzone-content-title-line-height, 22px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-description{padding-top:4px;display:flex;flex-direction:column;gap:4px;font-size:var(--nice-dropzone-content-description-font-size, 14px);font-weight:var(--nice-dropzone-content-description-font-weight, 400);line-height:var(--nice-dropzone-content-description-line-height, 16px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple,.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple:before{inset:0;position:absolute;pointer-events:none;border-radius:inherit}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple{overflow:hidden}.nice-dropzone-container .nice-dropzone .mat-ripple-element{background-color:var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone:hover{background-color:var(--nice-dropzone-hover-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.nice-dropzone-container .nice-dropzone.nice-dropzone-disabled{cursor:default;pointer-events:none;opacity:.5}.nice-dropzone-container .nice-dropzone-multiple-files-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:16px}\n"], dependencies: [{ kind: "directive", type: NiceDropzoneDirective, selector: "[niceDropzone]", outputs: ["filesDropped", "files"] }, { kind: "component", type: NiceDropzoneImageIcon, selector: "nice-dropzone-image-icon" }, { kind: "component", type: NiceDropzoneFileIcon, selector: "nice-dropzone-file-icon" }, { kind: "component", type: NiceDropzoneFilePreview, selector: "nice-dropzone-file-preview", inputs: ["file", "mode"], outputs: ["clickDelete"] }, { kind: "pipe", type: NiceTranslatePipe, name: "niceTranslate" }], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
|
|
316
|
+
], viewQueries: [{ propertyName: "_elementRef", first: true, predicate: ["element"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "_inputRef", first: true, predicate: ["fileInput"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n [class.nice-dropzone-uploading]=\"isUploading()\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (isUploading()) {\n <div class=\"nice-dropzone-uploading-content\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingImages | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingImage | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingFiles | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingFile | niceTranslate }}\n }\n }\n </span>\n\n <div\n class=\"nice-dropzone-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"normalizedUploadProgress()\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <div class=\"nice-dropzone-progress-fill\" [style.width.%]=\"normalizedUploadProgress()\"></div>\n </div>\n </div>\n </div>\n } @else if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n", styles: [".nice-dropzone-container{--nice-dropzone-ripple-color: color-mix(in srgb, var(--mat-sys-primary) 10%, transparent);--mat-ripple-color: var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone{position:relative;display:flex;justify-content:center;place-items:center;cursor:pointer;min-height:124px;border-radius:var(--nice-dropzone-shape, 8px)}.nice-dropzone-container .nice-dropzone.nice-dropzone-single:not(.nice-dropzone-selected),.nice-dropzone-container .nice-dropzone.nice-dropzone-multiple{border-style:dashed;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone.nice-dropzone-uploading{border-style:solid;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-uploading-border-color, color-mix(in srgb, var(--mat-sys-primary) 50%, transparent));cursor:default;pointer-events:none}.nice-dropzone-container .nice-dropzone.nice-dropzone-uploading:hover{background-color:transparent}.nice-dropzone-container .nice-dropzone .nice-dropzone-placeholder,.nice-dropzone-container .nice-dropzone .nice-dropzone-uploading-content{display:flex;justify-content:center;place-items:center;gap:32px}.nice-dropzone-container .nice-dropzone .nice-dropzone-uploading-content .nice-dropzone-content{display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:min(100%,370px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-progress{position:relative;width:100%;height:var(--nice-dropzone-progress-height, 20px);overflow:hidden;border-radius:var(--nice-dropzone-shape, 8px);background:var(--nice-dropzone-progress-track-color, color-mix(in srgb, var(--mat-sys-primary) 50%, transparent))}.nice-dropzone-container .nice-dropzone .nice-dropzone-progress-fill{height:100%;border-radius:inherit;background:var(--nice-dropzone-progress-fill-color, var(--mat-sys-primary));transition:width .2s ease}.nice-dropzone-container .nice-dropzone .nice-dropzone-icon{color:var(--nice-dropzone-icon-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content{-webkit-user-select:none;user-select:none;color:var(--nice-dropzone-text-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-title{font-size:var(--nice-dropzone-content-title-font-size, 18px);font-weight:var(--nice-dropzone-content-title-font-weight, 600);line-height:var(--nice-dropzone-content-title-line-height, 22px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-description{padding-top:4px;display:flex;flex-direction:column;gap:4px;font-size:var(--nice-dropzone-content-description-font-size, 14px);font-weight:var(--nice-dropzone-content-description-font-weight, 400);line-height:var(--nice-dropzone-content-description-line-height, 16px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple,.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple:before{inset:0;position:absolute;pointer-events:none;border-radius:inherit}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple{overflow:hidden}.nice-dropzone-container .nice-dropzone .mat-ripple-element{background-color:var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone:hover{background-color:var(--nice-dropzone-hover-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.nice-dropzone-container .nice-dropzone.nice-dropzone-disabled{cursor:default;pointer-events:none;opacity:.5}.nice-dropzone-container .nice-dropzone-multiple-files-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:16px}\n"], dependencies: [{ kind: "directive", type: NiceDropzoneDirective, selector: "[niceDropzone]", outputs: ["filesDropped", "files"] }, { kind: "component", type: NiceDropzoneImageIcon, selector: "nice-dropzone-image-icon" }, { kind: "component", type: NiceDropzoneFileIcon, selector: "nice-dropzone-file-icon" }, { kind: "component", type: NiceDropzoneFilePreview, selector: "nice-dropzone-file-preview", inputs: ["file", "mode"], outputs: ["clickDelete"] }, { kind: "pipe", type: NiceTranslatePipe, name: "niceTranslate" }], changeDetection: i0.ChangeDetectionStrategy.Eager, encapsulation: i0.ViewEncapsulation.None });
|
|
305
317
|
}
|
|
306
318
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: NiceDropzone, decorators: [{
|
|
307
319
|
type: Component,
|
|
@@ -317,15 +329,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
317
329
|
useExisting: forwardRef(() => NiceDropzone),
|
|
318
330
|
multi: true
|
|
319
331
|
}
|
|
320
|
-
], template: "<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n", styles: [".nice-dropzone-container{--nice-dropzone-ripple-color: color-mix(in srgb, var(--mat-sys-primary) 10%, transparent);--mat-ripple-color: var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone{position:relative;display:flex;justify-content:center;place-items:center;cursor:pointer;min-height:124px;border-radius:var(--nice-dropzone-shape, 8px)}.nice-dropzone-container .nice-dropzone.nice-dropzone-single:not(.nice-dropzone-selected),.nice-dropzone-container .nice-dropzone.nice-dropzone-multiple{border-style:dashed;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-placeholder{display:flex;justify-content:center;place-items:center;gap:32px}.nice-dropzone-container .nice-dropzone .nice-dropzone-icon{color:var(--nice-dropzone-icon-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content{-webkit-user-select:none;user-select:none;color:var(--nice-dropzone-text-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-title{font-size:var(--nice-dropzone-content-title-font-size, 18px);font-weight:var(--nice-dropzone-content-title-font-weight, 600);line-height:var(--nice-dropzone-content-title-line-height, 22px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-description{padding-top:4px;display:flex;flex-direction:column;gap:4px;font-size:var(--nice-dropzone-content-description-font-size, 14px);font-weight:var(--nice-dropzone-content-description-font-weight, 400);line-height:var(--nice-dropzone-content-description-line-height, 16px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple,.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple:before{inset:0;position:absolute;pointer-events:none;border-radius:inherit}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple{overflow:hidden}.nice-dropzone-container .nice-dropzone .mat-ripple-element{background-color:var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone:hover{background-color:var(--nice-dropzone-hover-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.nice-dropzone-container .nice-dropzone.nice-dropzone-disabled{cursor:default;pointer-events:none;opacity:.5}.nice-dropzone-container .nice-dropzone-multiple-files-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:16px}\n"] }]
|
|
321
|
-
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], _elementRef: [{ type: i0.ViewChild, args: ["element", { ...{ read: ElementRef }, isSignal: true }] }], _inputRef: [{ type: i0.ViewChild, args: ["fileInput", { isSignal: true }] }] } });
|
|
332
|
+
], template: "<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n [class.nice-dropzone-uploading]=\"isUploading()\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (isUploading()) {\n <div class=\"nice-dropzone-uploading-content\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingImages | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingImage | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingFiles | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingFile | niceTranslate }}\n }\n }\n </span>\n\n <div\n class=\"nice-dropzone-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"normalizedUploadProgress()\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <div class=\"nice-dropzone-progress-fill\" [style.width.%]=\"normalizedUploadProgress()\"></div>\n </div>\n </div>\n </div>\n } @else if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n", styles: [".nice-dropzone-container{--nice-dropzone-ripple-color: color-mix(in srgb, var(--mat-sys-primary) 10%, transparent);--mat-ripple-color: var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone{position:relative;display:flex;justify-content:center;place-items:center;cursor:pointer;min-height:124px;border-radius:var(--nice-dropzone-shape, 8px)}.nice-dropzone-container .nice-dropzone.nice-dropzone-single:not(.nice-dropzone-selected),.nice-dropzone-container .nice-dropzone.nice-dropzone-multiple{border-style:dashed;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-border-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone.nice-dropzone-uploading{border-style:solid;border-width:var(--nice-dropzone-border-width, 1px);border-color:var(--nice-dropzone-uploading-border-color, color-mix(in srgb, var(--mat-sys-primary) 50%, transparent));cursor:default;pointer-events:none}.nice-dropzone-container .nice-dropzone.nice-dropzone-uploading:hover{background-color:transparent}.nice-dropzone-container .nice-dropzone .nice-dropzone-placeholder,.nice-dropzone-container .nice-dropzone .nice-dropzone-uploading-content{display:flex;justify-content:center;place-items:center;gap:32px}.nice-dropzone-container .nice-dropzone .nice-dropzone-uploading-content .nice-dropzone-content{display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:min(100%,370px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-progress{position:relative;width:100%;height:var(--nice-dropzone-progress-height, 20px);overflow:hidden;border-radius:var(--nice-dropzone-shape, 8px);background:var(--nice-dropzone-progress-track-color, color-mix(in srgb, var(--mat-sys-primary) 50%, transparent))}.nice-dropzone-container .nice-dropzone .nice-dropzone-progress-fill{height:100%;border-radius:inherit;background:var(--nice-dropzone-progress-fill-color, var(--mat-sys-primary));transition:width .2s ease}.nice-dropzone-container .nice-dropzone .nice-dropzone-icon{color:var(--nice-dropzone-icon-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content{-webkit-user-select:none;user-select:none;color:var(--nice-dropzone-text-color, var(--mat-sys-primary))}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-title{font-size:var(--nice-dropzone-content-title-font-size, 18px);font-weight:var(--nice-dropzone-content-title-font-weight, 600);line-height:var(--nice-dropzone-content-title-line-height, 22px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-content .nice-dropzone-content-description{padding-top:4px;display:flex;flex-direction:column;gap:4px;font-size:var(--nice-dropzone-content-description-font-size, 14px);font-weight:var(--nice-dropzone-content-description-font-weight, 400);line-height:var(--nice-dropzone-content-description-line-height, 16px)}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple,.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple:before{inset:0;position:absolute;pointer-events:none;border-radius:inherit}.nice-dropzone-container .nice-dropzone .nice-dropzone-ripple{overflow:hidden}.nice-dropzone-container .nice-dropzone .mat-ripple-element{background-color:var(--nice-dropzone-ripple-color)}.nice-dropzone-container .nice-dropzone:hover{background-color:var(--nice-dropzone-hover-color, color-mix(in srgb, var(--mat-sys-primary) 20%, transparent))}.nice-dropzone-container .nice-dropzone.nice-dropzone-disabled{cursor:default;pointer-events:none;opacity:.5}.nice-dropzone-container .nice-dropzone-multiple-files-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-top:16px}\n"] }]
|
|
333
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], maxFileSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFileSize", required: false }] }], uploadProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadProgress", required: false }] }], _elementRef: [{ type: i0.ViewChild, args: ["element", { ...{ read: ElementRef }, isSignal: true }] }], _inputRef: [{ type: i0.ViewChild, args: ["fileInput", { isSignal: true }] }] } });
|
|
322
334
|
|
|
323
335
|
const defaultTranslationKeys = {
|
|
324
336
|
upload: {
|
|
325
337
|
file: "components.dropzone.upload.file",
|
|
326
338
|
files: "components.dropzone.upload.files",
|
|
327
339
|
image: "components.dropzone.upload.image",
|
|
328
|
-
images: "components.dropzone.upload.images"
|
|
340
|
+
images: "components.dropzone.upload.images",
|
|
341
|
+
uploadingFile: "components.dropzone.upload.uploading.file",
|
|
342
|
+
uploadingFiles: "components.dropzone.upload.uploading.files",
|
|
343
|
+
uploadingImage: "components.dropzone.upload.uploading.image",
|
|
344
|
+
uploadingImages: "components.dropzone.upload.uploading.images"
|
|
329
345
|
},
|
|
330
346
|
format: {
|
|
331
347
|
label: "components.dropzone.format.label"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recursyve-ngx-material-components-dropzone.mjs","sources":["../../../src/material-components/dropzone/dropzone.directive.ts","../../../src/material-components/dropzone/constant.ts","../../../src/material-components/dropzone/icons/file/file-icon.component.ts","../../../src/material-components/dropzone/icons/file/file-icon.template.svg","../../../src/material-components/dropzone/icons/image/image-icon.component.ts","../../../src/material-components/dropzone/icons/image/image-icon.template.svg","../../../src/material-components/dropzone/models.ts","../../../src/material-components/dropzone/pipes/file-size.pipe.ts","../../../src/material-components/dropzone/icons/delete/delete-icon.component.ts","../../../src/material-components/dropzone/icons/delete/delete-icon.template.svg","../../../src/material-components/dropzone/preview/file-preview.ts","../../../src/material-components/dropzone/preview/file-preview.html","../../../src/material-components/dropzone/dropzone.ts","../../../src/material-components/dropzone/dropzone.html","../../../src/material-components/dropzone/provider.ts","../../../src/material-components/dropzone/index.ts","../../../src/material-components/dropzone/recursyve-ngx-material-components-dropzone.ts"],"sourcesContent":["import { Directive, EventEmitter, HostBinding, HostListener, output, Output } from \"@angular/core\";\n\n@Directive({\n selector: \"[niceDropzone]\",\n standalone: true\n})\nexport class NiceDropzoneDirective {\n @HostBinding(\"class.file-over\")\n public fileOver!: boolean;\n\n @Output()\n public filesDropped = new EventEmitter<FileList>();\n\n public files = output()\n\n // Dragover listener\n @HostListener(\"dragover\", [\"$event\"])\n public onDragOver(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = true;\n }\n\n // Dragleave listener\n @HostListener(\"dragleave\", [\"$event\"])\n public onDragLeave(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = false;\n }\n\n // Drop listener\n @HostListener(\"drop\", [\"$event\"])\n public ondrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = false;\n\n if (!event.dataTransfer) {\n return;\n }\n\n const files = event.dataTransfer.files;\n if (files.length > 0) {\n this.filesDropped.emit(files);\n }\n }\n}\n","import { InjectionToken } from \"@angular/core\";\n\nexport const NICE_DROPZONE_TRANSLATION_KEYS = new InjectionToken(\"nice_dropzone_translation_keys\");\n","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-file-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./file-icon.template.svg\"\n})\nexport class NiceDropzoneFileIcon {}\n","<svg fill=\"none\" viewBox=\"-1.25 -1.25 40 40\" height=\"40\" width=\"40\">\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.859375 36.328125h25.78125c1.294375 0 2.34375 -1.049375 2.34375 -2.34375V12.6890625c-0.00015625 -0.621171875 -0.246875 -1.2168750000000002 -0.6859375 -1.65625l-9.175 -9.175c-0.439375 -0.43909062499999996 -1.03515625 -0.6858046875 -1.65625 -0.6859375H5.859375c-1.2765624999999998 0 -2.34375 1.0671875000000002 -2.34375 2.34375v30.46875c0 1.2765624999999998 1.0671875000000002 2.34375 2.34375 2.34375Z\" stroke-width=\"2.5\"></path>\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M33.984375 12.890625h-9.375c-0.6215625 0 -1.2178125 -0.24693750000000003 -1.65734375 -0.68646875S22.265625 11.16846875 22.265625 10.546875v-9.375\" stroke-width=\"2.5\"></path>\n</svg>","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-image-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./image-icon.template.svg\"\n})\nexport class NiceDropzoneImageIcon {}\n","<svg width=\"40\" height=\"43\" viewBox=\"0 0 40 43\" fill=\"none\">\n <path d=\"M29.333 1.5H2.66634C1.92996 1.5 1.33301 2.09695 1.33301 2.83333V33.0556C1.33301 33.7919 1.92996 34.3889 2.66634 34.3889H29.333C30.0694 34.3889 30.6663 33.7919 30.6663 33.0556V2.83333C30.6663 2.09695 30.0694 1.5 29.333 1.5Z\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M38.6667 11.2778V40.1667C38.6621 40.5189 38.5201 40.8554 38.2711 41.1044C38.022 41.3535 37.6855 41.4954 37.3333 41.5001H12\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M30.6663 27.2778H1.33301\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M7.55566 27.2778L16.8001 14.0689C17.0316 13.7366 17.3357 13.4614 17.6895 13.2642C18.0432 13.0669 18.4372 12.9528 18.8415 12.9306C19.2459 12.9083 19.6501 12.9784 20.0233 13.1356C20.3965 13.2928 20.7291 13.533 20.9957 13.8378L30.6668 25.0556\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9.33268 6.8335C9.8601 6.8335 10.3757 6.98989 10.8142 7.28291C11.2527 7.57593 11.5945 7.9924 11.7964 8.47967C11.9982 8.96694 12.051 9.50312 11.9481 10.0204C11.8452 10.5377 11.5912 11.0128 11.2183 11.3858C10.8454 11.7587 10.3702 12.0127 9.85292 12.1156C9.33564 12.2185 8.79946 12.1657 8.31219 11.9638C7.82492 11.762 7.40845 11.4202 7.11543 10.9817C6.82241 10.5432 6.66602 10.0276 6.66602 9.50016C6.66602 8.79292 6.94697 8.11464 7.44706 7.61454C7.94716 7.11445 8.62544 6.8335 9.33268 6.8335\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","export type NiceFileDimensions = {\n width: number;\n height: number;\n ratio: number;\n};\n\nexport type NiceLocalFile = {\n file: File;\n name: string;\n size?: number;\n dimensions?: NiceFileDimensions;\n};\n\nexport type NiceRemoteFile = {\n id: string | number;\n name: string;\n url: string;\n size?: number;\n};\n\nexport type NiceSelectedFiles = NiceLocalFile | NiceRemoteFile;\n\nexport function isLocalFile(file: NiceSelectedFiles): file is NiceLocalFile {\n return \"file\" in file;\n}\n\nexport function isRemoteFile(file: NiceSelectedFiles): file is NiceRemoteFile {\n return \"id\" in file;\n}\n","import { inject, Pipe, PipeTransform } from \"@angular/core\";\nimport { NiceTranslater, NICE_COMPONENTS_TRANSLATER } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"../constant\";\nimport { NiceDropzoneTranslationKeyConfig } from \"../config\";\n\n@Pipe({\n name: \"niceFileSize\"\n})\nexport class FileSizePipe implements PipeTransform {\n private readonly units = [\"B\", \"KB\", \"MB\", \"GB\"] as const;\n\n private readonly translater = inject<NiceTranslater>(NICE_COMPONENTS_TRANSLATER);\n private readonly translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n\n public transform(bytes: number | null | undefined, precision = 0): string {\n const defaultUnit = this.translater(this.translationKeys.size.units.B);\n\n if (!bytes) {\n return `0 ${defaultUnit}`;\n }\n\n const unitIndex = Math.floor(Math.log(bytes) / Math.log(1000));\n const boundedUnitIndex = Math.min(unitIndex, this.units.length - 1);\n\n const size = bytes / Math.pow(1000, boundedUnitIndex);\n\n const unit = this.translater(this.translationKeys.size.units[this.units[boundedUnitIndex]]);\n return `${size.toFixed(precision)} ${unit}`;\n }\n}\n","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-delete-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./delete-icon.template.svg\"\n})\nexport class NiceDropzoneDeleteIcon {}\n","<svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm5.49 16.07a1 1 0 0 1 -1.41 1.42l-3.9 -3.9a0.25 0.25 0 0 0 -0.36 0l-3.9 3.9a1 1 0 1 1 -1.41 -1.42l3.9 -3.89a0.25 0.25 0 0 0 0 -0.36l-3.9 -3.9a1 1 0 0 1 1.41 -1.41l3.9 3.9a0.25 0.25 0 0 0 0.36 0l3.9 -3.9a1 1 0 0 1 1.41 1.41l-3.9 3.9a0.25 0.25 0 0 0 0 0.36Z\" fill=\"currentColor\" stroke-width=\"1\"></path>\n</svg>","import { Component, computed, inject, input, output, ChangeDetectionStrategy } from \"@angular/core\";\nimport { NiceTranslatePipe } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"../constant\";\nimport { NiceDropzoneModes } from \"../dropzone\";\nimport { NiceDropzoneTranslationKeyConfig } from \"../config\";\nimport { isLocalFile, NiceFileDimensions, NiceSelectedFiles } from \"../models\";\nimport { FileSizePipe } from \"../pipes/file-size.pipe\";\nimport { NiceDropzoneDeleteIcon } from \"../icons/delete/delete-icon.component\";\nimport { NiceDropzoneFileIcon } from \"../icons/file/file-icon.component\";\n\n@Component({\n selector: \"nice-dropzone-file-preview\",\n templateUrl: \"./file-preview.html\",\n styleUrls: [\"./file-preview.scss\"],\n imports: [NiceDropzoneDeleteIcon, NiceTranslatePipe, FileSizePipe, NiceDropzoneFileIcon],\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n style: \"flex: 1 1 auto;\"\n }\n})\nexport class NiceDropzoneFilePreview {\n public readonly file = input.required<NiceSelectedFiles>();\n public readonly mode = input.required<NiceDropzoneModes>();\n\n protected readonly clickDelete = output<void>();\n\n protected readonly isImage = computed(() => this.mode() === \"image\");\n protected readonly imageDimensions = computed<NiceFileDimensions | null>(() => {\n const file = this.file();\n if (isLocalFile(file)) {\n return file.dimensions ?? null;\n }\n\n return null;\n });\n protected readonly imageUrl = computed<string>(() => {\n const file = this.file();\n if (isLocalFile(file)) {\n return URL.createObjectURL(file.file);\n }\n\n return file.url;\n });\n\n protected _translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n}\n","<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button class=\"nice-dropzone-preview-actions-delete\" (click)=\"$event.stopPropagation(); clickDelete.emit()\">\n <nice-dropzone-delete-icon />\n </button>\n </div>\n</div>\n","import { coerceBooleanProperty } from \"@angular/cdk/coercion\";\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n OnDestroy,\n signal,\n viewChild,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { MatRippleLoader } from \"@angular/material/core\";\nimport { NiceTranslatePipe } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"./constant\";\nimport {\n NiceDropzoneFileSizeConfig,\n NiceDropzoneImageConfig,\n NiceDropzoneTranslationKeyConfig\n} from \"./config\";\nimport { NiceDropzoneDirective } from \"./dropzone.directive\";\nimport { NiceDropzoneFileIcon } from \"./icons/file/file-icon.component\";\nimport { NiceDropzoneImageIcon } from \"./icons/image/image-icon.component\";\nimport { NiceFileDimensions, NiceSelectedFiles } from \"./models\";\nimport { NiceDropzoneFilePreview } from \"./preview/file-preview\";\n\nexport const niceDropzoneModes = [\"image\", \"file\", \"all\"] as const;\nexport type NiceDropzoneModes = (typeof niceDropzoneModes)[number];\n\n@Component({\n selector: \"nice-dropzone\",\n templateUrl: \"dropzone.html\",\n styleUrl: \"dropzone.scss\",\n imports: [\n NiceDropzoneDirective,\n NiceDropzoneImageIcon,\n NiceDropzoneFileIcon,\n NiceDropzoneFilePreview,\n NiceTranslatePipe\n ],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.Eager,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NiceDropzone),\n multi: true\n }\n ]\n})\nexport class NiceDropzone implements OnDestroy, ControlValueAccessor {\n public readonly mode = input<NiceDropzoneModes>(\"all\");\n public readonly multiple = input(false, { transform: coerceBooleanProperty });\n public readonly disabled = input(false, { transform: coerceBooleanProperty });\n public readonly accept = input<string[]>();\n public readonly config = input<NiceDropzoneImageConfig>();\n public readonly maxFileSize = input<NiceDropzoneFileSizeConfig>();\n\n protected readonly _elementRef = viewChild(\"element\", { read: ElementRef });\n protected readonly _inputRef = viewChild<ElementRef<HTMLInputElement>>(\"fileInput\");\n\n /**\n * Handles the lazy creation of the MatButton ripple.\n * Used to improve the initial load time of large applications.\n */\n protected readonly _rippleLoader: MatRippleLoader = inject(MatRippleLoader);\n protected readonly _translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n\n protected readonly files = signal<NiceSelectedFiles[]>([]);\n\n protected _disabled = false;\n\n private _onChange!: (value: NiceSelectedFiles | NiceSelectedFiles[] | null) => void;\n private _value: NiceSelectedFiles | NiceSelectedFiles[] | null = null;\n\n constructor() {\n effect(() => {\n const elementRef = this._elementRef();\n if (!elementRef) {\n return;\n }\n\n this._rippleLoader.configureRipple(elementRef.nativeElement, { className: \"nice-dropzone-ripple\" });\n });\n\n effect(() => {\n this._disabled = this.disabled();\n });\n }\n\n public ngOnDestroy(): void {\n this._rippleLoader.destroyRipple(this._elementRef()?.nativeElement);\n }\n\n public writeValue(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void {\n this._value = value;\n if (value) {\n this.files.set(Array.isArray(value) ? value : [value]);\n }\n }\n\n public registerOnChange(fn: (value: NiceSelectedFiles | NiceSelectedFiles[] | null) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(): void {\n // Do nothing\n }\n\n public setDisabledState(disabled: boolean): void {\n this._disabled = disabled;\n }\n\n public onFileChanged(event: Event): void {\n const files = (event.target as HTMLInputElement).files;\n if (!files) {\n return;\n }\n\n this.onFilesDropped(files);\n }\n\n public async onFilesDropped(fileList: FileList): Promise<void> {\n if (this.multiple() && !this._value) {\n this._value = [];\n }\n\n const accept = this.accept();\n for (const file of Array.from(fileList)) {\n if (accept && !accept.includes(file.type)) {\n continue;\n }\n\n const isImage = file.type.startsWith(\"image/\");\n const value = {\n file,\n name: file.name,\n size: file.size,\n ...(isImage && { dimensions: await this.getImageDimension(file) })\n } satisfies NiceSelectedFiles;\n if (this.multiple()) {\n (this._value as NiceSelectedFiles[]).push(value);\n } else {\n this._value = value;\n this.propagateChanges(this._value);\n return;\n }\n }\n\n if (this._value) {\n this.propagateChanges(this._value);\n }\n\n this.resetInput();\n }\n\n public onFileDelete(index: number): void {\n if (this.multiple()) {\n const files = [...this.files()];\n files.splice(index, 1);\n this.propagateChanges(files);\n } else {\n this.propagateChanges(null);\n this.resetInput();\n }\n }\n\n protected propagateChanges(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void {\n if (value) {\n this.files.set(Array.isArray(value) ? value : [value]);\n } else {\n this.files.set([]);\n }\n\n this._value = value;\n this._onChange(value);\n }\n\n protected getImageDimension(file: File): Promise<NiceFileDimensions> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => {\n const image = new Image();\n image.onload = () => {\n resolve({\n width: image.width,\n height: image.height,\n ratio: image.width / image.height\n });\n };\n image.onerror = reject;\n image.src = reader.result as string;\n };\n\n reader.readAsDataURL(file);\n });\n }\n\n protected resetInput(): void {\n const input = this._inputRef();\n if (!input) {\n return;\n }\n\n input.nativeElement.value = \"\";\n }\n}\n","<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n","import { Provider } from \"@angular/core\";\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"./constant\";\nimport { NiceDropzoneTranslationKeyConfig } from \"./config\";\nimport { NiceDropzoneOptions } from \"./options\";\n\nconst defaultTranslationKeys: NiceDropzoneTranslationKeyConfig = {\n upload: {\n file: \"components.dropzone.upload.file\",\n files: \"components.dropzone.upload.files\",\n image: \"components.dropzone.upload.image\",\n images: \"components.dropzone.upload.images\"\n },\n format: {\n label: \"components.dropzone.format.label\"\n },\n ratio: {\n label: \"components.dropzone.ratio.label\",\n pixels: \"components.dropzone.ratio.pixels\"\n },\n size: {\n label: \"components.dropzone.size.label\",\n units: {\n B: \"components.dropzone.size.units.B\",\n KB: \"components.dropzone.size.units.KB\",\n MB: \"components.dropzone.size.units.MB\",\n GB: \"components.dropzone.size.units.GB\"\n }\n }\n};\n\nexport function provideDropzone(options?: NiceDropzoneOptions): Provider[] {\n return [\n {\n provide: NICE_DROPZONE_TRANSLATION_KEYS,\n useValue: options?.translationKeys ?? defaultTranslationKeys\n }\n ];\n}\n","/*\n * Public API Surface of dropzone\n */\n\nexport * from \"./dropzone.directive\";\nexport * from \"./dropzone\";\nexport * from \"./config\";\nexport * from \"./models\";\nexport * from \"./options\";\nexport * from \"./provider\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAMa,qBAAqB,CAAA;AAEvB,IAAA,QAAQ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C;AACvC,QAAA,KAAK,EAAE;AACH,YAAA,CAAC,EAAE,kCAAkC;AACrC,YAAA,EAAE,EAAE,mCAAmC;AACvC,YAAA,EAAE,EAAE,mCAAmC;AACvC,YAAA,EAAE,EAAE;AACP;AACJ;CACJ;AAEK,SAAU,eAAe,CAAC,OAA6B,EAAA;IACzD,OAAO;AACH,QAAA;AACI,YAAA,OAAO,EAAE,8BAA8B;AACvC,YAAA,QAAQ,EAAE,OAAO,EAAE,eAAe,IAAI;AACzC;KACJ;AACL;;ACrCA;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"recursyve-ngx-material-components-dropzone.mjs","sources":["../../../src/material-components/dropzone/dropzone.directive.ts","../../../src/material-components/dropzone/constant.ts","../../../src/material-components/dropzone/icons/file/file-icon.component.ts","../../../src/material-components/dropzone/icons/file/file-icon.template.svg","../../../src/material-components/dropzone/icons/image/image-icon.component.ts","../../../src/material-components/dropzone/icons/image/image-icon.template.svg","../../../src/material-components/dropzone/models.ts","../../../src/material-components/dropzone/pipes/file-size.pipe.ts","../../../src/material-components/dropzone/icons/delete/delete-icon.component.ts","../../../src/material-components/dropzone/icons/delete/delete-icon.template.svg","../../../src/material-components/dropzone/preview/file-preview.ts","../../../src/material-components/dropzone/preview/file-preview.html","../../../src/material-components/dropzone/dropzone.ts","../../../src/material-components/dropzone/dropzone.html","../../../src/material-components/dropzone/provider.ts","../../../src/material-components/dropzone/index.ts","../../../src/material-components/dropzone/recursyve-ngx-material-components-dropzone.ts"],"sourcesContent":["import { Directive, EventEmitter, HostBinding, HostListener, output, Output } from \"@angular/core\";\n\n@Directive({\n selector: \"[niceDropzone]\",\n standalone: true\n})\nexport class NiceDropzoneDirective {\n @HostBinding(\"class.file-over\")\n public fileOver!: boolean;\n\n @Output()\n public filesDropped = new EventEmitter<FileList>();\n\n public files = output()\n\n // Dragover listener\n @HostListener(\"dragover\", [\"$event\"])\n public onDragOver(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = true;\n }\n\n // Dragleave listener\n @HostListener(\"dragleave\", [\"$event\"])\n public onDragLeave(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = false;\n }\n\n // Drop listener\n @HostListener(\"drop\", [\"$event\"])\n public ondrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.fileOver = false;\n\n if (!event.dataTransfer) {\n return;\n }\n\n const files = event.dataTransfer.files;\n if (files.length > 0) {\n this.filesDropped.emit(files);\n }\n }\n}\n","import { InjectionToken } from \"@angular/core\";\n\nexport const NICE_DROPZONE_TRANSLATION_KEYS = new InjectionToken(\"nice_dropzone_translation_keys\");\n","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-file-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./file-icon.template.svg\"\n})\nexport class NiceDropzoneFileIcon {}\n","<svg fill=\"none\" viewBox=\"-1.25 -1.25 40 40\" height=\"40\" width=\"40\">\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.859375 36.328125h25.78125c1.294375 0 2.34375 -1.049375 2.34375 -2.34375V12.6890625c-0.00015625 -0.621171875 -0.246875 -1.2168750000000002 -0.6859375 -1.65625l-9.175 -9.175c-0.439375 -0.43909062499999996 -1.03515625 -0.6858046875 -1.65625 -0.6859375H5.859375c-1.2765624999999998 0 -2.34375 1.0671875000000002 -2.34375 2.34375v30.46875c0 1.2765624999999998 1.0671875000000002 2.34375 2.34375 2.34375Z\" stroke-width=\"2.5\"></path>\n <path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M33.984375 12.890625h-9.375c-0.6215625 0 -1.2178125 -0.24693750000000003 -1.65734375 -0.68646875S22.265625 11.16846875 22.265625 10.546875v-9.375\" stroke-width=\"2.5\"></path>\n</svg>","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-image-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./image-icon.template.svg\"\n})\nexport class NiceDropzoneImageIcon {}\n","<svg width=\"40\" height=\"43\" viewBox=\"0 0 40 43\" fill=\"none\">\n <path d=\"M29.333 1.5H2.66634C1.92996 1.5 1.33301 2.09695 1.33301 2.83333V33.0556C1.33301 33.7919 1.92996 34.3889 2.66634 34.3889H29.333C30.0694 34.3889 30.6663 33.7919 30.6663 33.0556V2.83333C30.6663 2.09695 30.0694 1.5 29.333 1.5Z\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M38.6667 11.2778V40.1667C38.6621 40.5189 38.5201 40.8554 38.2711 41.1044C38.022 41.3535 37.6855 41.4954 37.3333 41.5001H12\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M30.6663 27.2778H1.33301\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M7.55566 27.2778L16.8001 14.0689C17.0316 13.7366 17.3357 13.4614 17.6895 13.2642C18.0432 13.0669 18.4372 12.9528 18.8415 12.9306C19.2459 12.9083 19.6501 12.9784 20.0233 13.1356C20.3965 13.2928 20.7291 13.533 20.9957 13.8378L30.6668 25.0556\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M9.33268 6.8335C9.8601 6.8335 10.3757 6.98989 10.8142 7.28291C11.2527 7.57593 11.5945 7.9924 11.7964 8.47967C11.9982 8.96694 12.051 9.50312 11.9481 10.0204C11.8452 10.5377 11.5912 11.0128 11.2183 11.3858C10.8454 11.7587 10.3702 12.0127 9.85292 12.1156C9.33564 12.2185 8.79946 12.1657 8.31219 11.9638C7.82492 11.762 7.40845 11.4202 7.11543 10.9817C6.82241 10.5432 6.66602 10.0276 6.66602 9.50016C6.66602 8.79292 6.94697 8.11464 7.44706 7.61454C7.94716 7.11445 8.62544 6.8335 9.33268 6.8335\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>\n","export type NiceFileDimensions = {\n width: number;\n height: number;\n ratio: number;\n};\n\nexport type NiceLocalFile = {\n file: File;\n name: string;\n size?: number;\n dimensions?: NiceFileDimensions;\n};\n\nexport type NiceRemoteFile = {\n id: string | number;\n name: string;\n url: string;\n size?: number;\n};\n\nexport type NiceSelectedFiles = NiceLocalFile | NiceRemoteFile;\n\nexport function isLocalFile(file: NiceSelectedFiles): file is NiceLocalFile {\n return \"file\" in file;\n}\n\nexport function isRemoteFile(file: NiceSelectedFiles): file is NiceRemoteFile {\n return \"id\" in file;\n}\n","import { inject, Pipe, PipeTransform } from \"@angular/core\";\nimport { NiceTranslater, NICE_COMPONENTS_TRANSLATER } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"../constant\";\nimport { NiceDropzoneTranslationKeyConfig } from \"../config\";\n\n@Pipe({\n name: \"niceFileSize\"\n})\nexport class FileSizePipe implements PipeTransform {\n private readonly units = [\"B\", \"KB\", \"MB\", \"GB\"] as const;\n\n private readonly translater = inject<NiceTranslater>(NICE_COMPONENTS_TRANSLATER);\n private readonly translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n\n public transform(bytes: number | null | undefined, precision = 0): string {\n const defaultUnit = this.translater(this.translationKeys.size.units.B);\n\n if (!bytes) {\n return `0 ${defaultUnit}`;\n }\n\n const unitIndex = Math.floor(Math.log(bytes) / Math.log(1000));\n const boundedUnitIndex = Math.min(unitIndex, this.units.length - 1);\n\n const size = bytes / Math.pow(1000, boundedUnitIndex);\n\n const unit = this.translater(this.translationKeys.size.units[this.units[boundedUnitIndex]]);\n return `${size.toFixed(precision)} ${unit}`;\n }\n}\n","import { Component, ChangeDetectionStrategy } from \"@angular/core\";\n\n@Component({\n selector: \"nice-dropzone-delete-icon\",\n changeDetection: ChangeDetectionStrategy.Eager,\n templateUrl: \"./delete-icon.template.svg\"\n})\nexport class NiceDropzoneDeleteIcon {}\n","<svg viewBox=\"0 0 24 24\" width=\"24px\" height=\"24px\" focusable=\"false\" aria-hidden=\"true\">\n <path d=\"M12 0a12 12 0 1 0 12 12A12 12 0 0 0 12 0Zm5.49 16.07a1 1 0 0 1 -1.41 1.42l-3.9 -3.9a0.25 0.25 0 0 0 -0.36 0l-3.9 3.9a1 1 0 1 1 -1.41 -1.42l3.9 -3.89a0.25 0.25 0 0 0 0 -0.36l-3.9 -3.9a1 1 0 0 1 1.41 -1.41l3.9 3.9a0.25 0.25 0 0 0 0.36 0l3.9 -3.9a1 1 0 0 1 1.41 1.41l-3.9 3.9a0.25 0.25 0 0 0 0 0.36Z\" fill=\"currentColor\" stroke-width=\"1\"></path>\n</svg>","import { Component, computed, inject, input, output, ChangeDetectionStrategy } from \"@angular/core\";\nimport { NiceTranslatePipe } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"../constant\";\nimport { NiceDropzoneModes } from \"../dropzone\";\nimport { NiceDropzoneTranslationKeyConfig } from \"../config\";\nimport { isLocalFile, NiceFileDimensions, NiceSelectedFiles } from \"../models\";\nimport { FileSizePipe } from \"../pipes/file-size.pipe\";\nimport { NiceDropzoneDeleteIcon } from \"../icons/delete/delete-icon.component\";\nimport { NiceDropzoneFileIcon } from \"../icons/file/file-icon.component\";\n\n@Component({\n selector: \"nice-dropzone-file-preview\",\n templateUrl: \"./file-preview.html\",\n styleUrls: [\"./file-preview.scss\"],\n imports: [NiceDropzoneDeleteIcon, NiceTranslatePipe, FileSizePipe, NiceDropzoneFileIcon],\n changeDetection: ChangeDetectionStrategy.Eager,\n host: {\n style: \"flex: 1 1 auto;\"\n }\n})\nexport class NiceDropzoneFilePreview {\n public readonly file = input.required<NiceSelectedFiles>();\n public readonly mode = input.required<NiceDropzoneModes>();\n\n protected readonly clickDelete = output<void>();\n\n protected readonly isImage = computed(() => this.mode() === \"image\");\n protected readonly imageDimensions = computed<NiceFileDimensions | null>(() => {\n const file = this.file();\n if (isLocalFile(file)) {\n return file.dimensions ?? null;\n }\n\n return null;\n });\n protected readonly imageUrl = computed<string>(() => {\n const file = this.file();\n if (isLocalFile(file)) {\n return URL.createObjectURL(file.file);\n }\n\n return file.url;\n });\n\n protected _translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n}\n","<div class=\"nice-dropzone-preview\">\n @if (isImage()) {\n <img class=\"nice-dropzone-preview-image\" alt=\"\" draggable=\"false\" [src]=\"imageUrl()\" />\n } @else {\n <div class=\"nice-dropzone-preview-file\">\n <nice-dropzone-file-icon />\n </div>\n }\n\n <div class=\"nice-dropzone-preview-file-info\">\n <span class=\"mat-body-medium\">{{ file().name }}</span>\n\n @if (imageDimensions(); as dimension) {\n <span class=\"mat-label-medium\">\n {{ `${dimension.width}x${dimension.height}` }} {{ _translationKeys.ratio.pixels | niceTranslate }}\n </span>\n }\n\n @if (file().size; as size) {\n <span class=\"mat-label-medium\">{{ size | niceFileSize }}</span>\n }\n </div>\n\n <div class=\"nice-dropzone-preview-actions\">\n <button\n class=\"nice-dropzone-preview-actions-delete\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); clickDelete.emit()\"\n >\n <nice-dropzone-delete-icon />\n </button>\n </div>\n</div>\n","import { coerceBooleanProperty } from \"@angular/cdk/coercion\";\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n OnDestroy,\n signal,\n viewChild,\n ViewEncapsulation\n} from \"@angular/core\";\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\nimport { MatRippleLoader } from \"@angular/material/core\";\nimport { NiceTranslatePipe } from \"@recursyve/ngx-material-components/common\";\n\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"./constant\";\nimport {\n NiceDropzoneFileSizeConfig,\n NiceDropzoneImageConfig,\n NiceDropzoneTranslationKeyConfig\n} from \"./config\";\nimport { NiceDropzoneDirective } from \"./dropzone.directive\";\nimport { NiceDropzoneFileIcon } from \"./icons/file/file-icon.component\";\nimport { NiceDropzoneImageIcon } from \"./icons/image/image-icon.component\";\nimport { NiceFileDimensions, NiceSelectedFiles } from \"./models\";\nimport { NiceDropzoneFilePreview } from \"./preview/file-preview\";\n\nexport const niceDropzoneModes = [\"image\", \"file\", \"all\"] as const;\nexport type NiceDropzoneModes = (typeof niceDropzoneModes)[number];\n\n@Component({\n selector: \"nice-dropzone\",\n templateUrl: \"dropzone.html\",\n styleUrl: \"dropzone.scss\",\n imports: [\n NiceDropzoneDirective,\n NiceDropzoneImageIcon,\n NiceDropzoneFileIcon,\n NiceDropzoneFilePreview,\n NiceTranslatePipe\n ],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.Eager,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => NiceDropzone),\n multi: true\n }\n ]\n})\nexport class NiceDropzone implements OnDestroy, ControlValueAccessor {\n public readonly mode = input<NiceDropzoneModes>(\"all\");\n public readonly multiple = input(false, { transform: coerceBooleanProperty });\n public readonly disabled = input(false, { transform: coerceBooleanProperty });\n public readonly accept = input<string[]>();\n public readonly config = input<NiceDropzoneImageConfig>();\n public readonly maxFileSize = input<NiceDropzoneFileSizeConfig>();\n public readonly uploadProgress = input<number | null>(null);\n\n protected readonly _elementRef = viewChild(\"element\", { read: ElementRef });\n protected readonly _inputRef = viewChild<ElementRef<HTMLInputElement>>(\"fileInput\");\n\n /**\n * Handles the lazy creation of the MatButton ripple.\n * Used to improve the initial load time of large applications.\n */\n protected readonly _rippleLoader: MatRippleLoader = inject(MatRippleLoader);\n protected readonly _translationKeys = inject<NiceDropzoneTranslationKeyConfig>(NICE_DROPZONE_TRANSLATION_KEYS);\n\n protected readonly files = signal<NiceSelectedFiles[]>([]);\n\n protected readonly isUploading = computed(() => this.uploadProgress() !== null);\n\n protected readonly normalizedUploadProgress = computed(() => {\n const progress = this.uploadProgress();\n if (progress === null) {\n return 0;\n }\n\n return Math.min(100, Math.max(0, progress));\n });\n\n protected _disabled = false;\n\n private _onChange!: (value: NiceSelectedFiles | NiceSelectedFiles[] | null) => void;\n private _value: NiceSelectedFiles | NiceSelectedFiles[] | null = null;\n\n constructor() {\n effect(() => {\n const elementRef = this._elementRef();\n if (!elementRef) {\n return;\n }\n\n this._rippleLoader.configureRipple(elementRef.nativeElement, { className: \"nice-dropzone-ripple\" });\n });\n\n effect(() => {\n this._disabled = this.disabled();\n });\n }\n\n public ngOnDestroy(): void {\n this._rippleLoader.destroyRipple(this._elementRef()?.nativeElement);\n }\n\n public writeValue(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void {\n this._value = value;\n if (value) {\n this.files.set(Array.isArray(value) ? value : [value]);\n }\n }\n\n public registerOnChange(fn: (value: NiceSelectedFiles | NiceSelectedFiles[] | null) => void): void {\n this._onChange = fn;\n }\n\n public registerOnTouched(): void {\n // Do nothing\n }\n\n public setDisabledState(disabled: boolean): void {\n this._disabled = disabled;\n }\n\n public onFileChanged(event: Event): void {\n const files = (event.target as HTMLInputElement).files;\n if (!files) {\n return;\n }\n\n this.onFilesDropped(files);\n }\n\n public async onFilesDropped(fileList: FileList): Promise<void> {\n if (this.multiple() && !this._value) {\n this._value = [];\n }\n\n const accept = this.accept();\n for (const file of Array.from(fileList)) {\n if (accept && !accept.includes(file.type)) {\n continue;\n }\n\n const isImage = file.type.startsWith(\"image/\");\n const value = {\n file,\n name: file.name,\n size: file.size,\n ...(isImage && { dimensions: await this.getImageDimension(file) })\n } satisfies NiceSelectedFiles;\n if (this.multiple()) {\n (this._value as NiceSelectedFiles[]).push(value);\n } else {\n this._value = value;\n this.propagateChanges(this._value);\n return;\n }\n }\n\n if (this._value) {\n this.propagateChanges(this._value);\n }\n\n this.resetInput();\n }\n\n public onFileDelete(index: number): void {\n if (this.multiple()) {\n const files = [...this.files()];\n files.splice(index, 1);\n this.propagateChanges(files);\n } else {\n this.propagateChanges(null);\n this.resetInput();\n }\n }\n\n protected propagateChanges(value: NiceSelectedFiles | NiceSelectedFiles[] | null): void {\n if (value) {\n this.files.set(Array.isArray(value) ? value : [value]);\n } else {\n this.files.set([]);\n }\n\n this._value = value;\n this._onChange(value);\n }\n\n protected getImageDimension(file: File): Promise<NiceFileDimensions> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n\n reader.onload = () => {\n const image = new Image();\n image.onload = () => {\n resolve({\n width: image.width,\n height: image.height,\n ratio: image.width / image.height\n });\n };\n image.onerror = reject;\n image.src = reader.result as string;\n };\n\n reader.readAsDataURL(file);\n });\n }\n\n protected resetInput(): void {\n const input = this._inputRef();\n if (!input) {\n return;\n }\n\n input.nativeElement.value = \"\";\n }\n}\n","<div\n class=\"nice-dropzone-container\"\n>\n <div\n #element\n role=\"none\"\n class=\"nice-dropzone\"\n [class.nice-dropzone-disabled]=\"_disabled\"\n [class.nice-dropzone-multiple]=\"multiple()\"\n [class.nice-dropzone-single]=\"!multiple()\"\n [class.nice-dropzone-image]=\"mode() === 'image'\"\n [class.nice-dropzone-file]=\"mode() === 'file'\"\n [class.nice-dropzone-all]=\"mode() === 'all'\"\n [class.nice-dropzone-selected]=\"files().length > 0\"\n [class.nice-dropzone-uploading]=\"isUploading()\"\n\n niceDropzone\n (filesDropped)=\"onFilesDropped($event)\"\n (click)=\"fileInput.click()\"\n (keyup.enter)=\"fileInput.click()\"\n >\n <div class=\"nice-dropzone-ripple\"></div>\n\n @if (isUploading()) {\n <div class=\"nice-dropzone-uploading-content\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingImages | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingImage | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.uploadingFiles | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.uploadingFile | niceTranslate }}\n }\n }\n </span>\n\n <div\n class=\"nice-dropzone-progress\"\n role=\"progressbar\"\n [attr.aria-valuenow]=\"normalizedUploadProgress()\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n >\n <div class=\"nice-dropzone-progress-fill\" [style.width.%]=\"normalizedUploadProgress()\"></div>\n </div>\n </div>\n </div>\n } @else if (multiple() || (!multiple() && !files().length)) {\n <div class=\"nice-dropzone-placeholder\">\n <div class=\"nice-dropzone-icon\">\n @if (mode() === \"image\") {\n <nice-dropzone-image-icon />\n } @else {\n <nice-dropzone-file-icon />\n }\n </div>\n\n <div class=\"nice-dropzone-content\">\n <span class=\"nice-dropzone-content-title\">\n @if (mode() === \"image\") {\n @if (multiple()) {\n {{ _translationKeys.upload.images | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.image | niceTranslate }}\n }\n } @else {\n @if (multiple()) {\n {{ _translationKeys.upload.files | niceTranslate }}\n } @else {\n {{ _translationKeys.upload.file | niceTranslate }}\n }\n }\n </span>\n\n <div class=\"nice-dropzone-content-description\">\n @if (accept()?.length) {\n <span>\n {{ _translationKeys.format.label | niceTranslate }}: \n\n <span>\n {{ accept()?.join(\", \") }}\n </span>\n </span>\n }\n\n @if (mode() === \"image\" && config()?.recommendedSize; as recommendedSize) {\n <span>\n {{ _translationKeys.ratio.label | niceTranslate }}: \n\n <span>{{ recommendedSize.width }}x{{ recommendedSize.height }} {{ _translationKeys.ratio.pixels | niceTranslate }}</span>\n </span>\n }\n\n @if (maxFileSize(); as maxFileSize) {\n <span>\n {{ _translationKeys.size.label | niceTranslate }}: \n\n <span>{{ maxFileSize.size }} {{ _translationKeys.size.units[maxFileSize.unit] | niceTranslate }}</span>\n </span>\n }\n </div>\n </div>\n </div>\n } @else {\n <nice-dropzone-file-preview [file]=\"files()[0]\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete(0)\" />\n }\n </div>\n\n @if (multiple()) {\n <div class=\"nice-dropzone-multiple-files-preview\">\n @for (file of files(); track file) {\n <nice-dropzone-file-preview [file]=\"file\" [mode]=\"mode()\" (clickDelete)=\"onFileDelete($index)\" />\n }\n </div>\n }\n</div>\n\n<input #fileInput style=\"display: none;\" type=\"file\" [accept]=\"accept()\" [multiple]=\"multiple()\" (change)=\"onFileChanged($event)\" />\n","import { Provider } from \"@angular/core\";\nimport { NiceDropzoneTranslationKeyConfig } from \"./config\";\nimport { NICE_DROPZONE_TRANSLATION_KEYS } from \"./constant\";\nimport { NiceDropzoneOptions } from \"./options\";\n\nconst defaultTranslationKeys: NiceDropzoneTranslationKeyConfig = {\n upload: {\n file: \"components.dropzone.upload.file\",\n files: \"components.dropzone.upload.files\",\n image: \"components.dropzone.upload.image\",\n images: \"components.dropzone.upload.images\",\n uploadingFile: \"components.dropzone.upload.uploading.file\",\n uploadingFiles: \"components.dropzone.upload.uploading.files\",\n uploadingImage: \"components.dropzone.upload.uploading.image\",\n uploadingImages: \"components.dropzone.upload.uploading.images\"\n },\n format: {\n label: \"components.dropzone.format.label\"\n },\n ratio: {\n label: \"components.dropzone.ratio.label\",\n pixels: \"components.dropzone.ratio.pixels\"\n },\n size: {\n label: \"components.dropzone.size.label\",\n units: {\n B: \"components.dropzone.size.units.B\",\n KB: \"components.dropzone.size.units.KB\",\n MB: \"components.dropzone.size.units.MB\",\n GB: \"components.dropzone.size.units.GB\"\n }\n }\n};\n\nexport function provideDropzone(options?: NiceDropzoneOptions): Provider[] {\n return [\n {\n provide: NICE_DROPZONE_TRANSLATION_KEYS,\n useValue: options?.translationKeys ?? defaultTranslationKeys\n }\n ];\n}\n","/*\n * Public API Surface of dropzone\n */\n\nexport * from \"./dropzone.directive\";\nexport * from \"./dropzone\";\nexport * from \"./config\";\nexport * from \"./models\";\nexport * from \"./options\";\nexport * from \"./provider\";\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAMa,qBAAqB,CAAA;AAEvB,IAAA,QAAQ;AAGR,IAAA,YAAY,GAAG,IAAI,YAAY,EAAY;IAE3C,KAAK,GAAG,MAAM,EAAE;;AAIhB,IAAA,UAAU,CAAC,KAAgB,EAAA;QAC9B,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;IACxB;;AAIO,IAAA,WAAW,CAAC,KAAgB,EAAA;QAC/B,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;IACzB;;AAIO,IAAA,MAAM,CAAC,KAAgB,EAAA;QAC1B,KAAK,CAAC,cAAc,EAAE;QACtB,KAAK,CAAC,eAAe,EAAE;AACvB,QAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;AAErB,QAAA,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;YACrB;QACJ;AAEA,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK;AACtC,QAAA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAClB,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QACjC;IACJ;uGAxCS,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,OAAA,EAAA,EAAA,YAAA,EAAA,cAAA,EAAA,KAAA,EAAA,OAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,WA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