@ecodev/natural 63.3.2 → 63.3.3
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.
|
@@ -9288,11 +9288,6 @@ class NaturalFileComponent {
|
|
|
9288
9288
|
fontSize = computed(() => Math.min(this.height() * 0.3, 36));
|
|
9289
9289
|
action = null;
|
|
9290
9290
|
backgroundSize = 'contain';
|
|
9291
|
-
/**
|
|
9292
|
-
* Overrides the default download link by passing a function that received the
|
|
9293
|
-
* file object and returns the download link
|
|
9294
|
-
*/
|
|
9295
|
-
downloadLinkFn;
|
|
9296
9291
|
/**
|
|
9297
9292
|
* Comma-separated list of unique file type specifiers. Like the native element,
|
|
9298
9293
|
* it can be a mix of mime-type and file extensions.
|
|
@@ -9355,9 +9350,7 @@ class NaturalFileComponent {
|
|
|
9355
9350
|
if (this.action !== 'download') {
|
|
9356
9351
|
return null;
|
|
9357
9352
|
}
|
|
9358
|
-
return this.
|
|
9359
|
-
? this.downloadLinkFn(this.model)
|
|
9360
|
-
: this.naturalFileService.getDownloadLink(this.model);
|
|
9353
|
+
return this.naturalFileService.getDownloadLink(this.model);
|
|
9361
9354
|
}
|
|
9362
9355
|
updateImage() {
|
|
9363
9356
|
this.imagePreview = '';
|
|
@@ -9412,7 +9405,7 @@ class NaturalFileComponent {
|
|
|
9412
9405
|
return subject.asObservable();
|
|
9413
9406
|
}
|
|
9414
9407
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9415
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: NaturalFileComponent, isStandalone: true, selector: "natural-file", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: false, isRequired: false, transformFunction: null }, backgroundSize: { classPropertyName: "backgroundSize", publicName: "backgroundSize", isSignal: false, isRequired: false, transformFunction: null },
|
|
9408
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.13", type: NaturalFileComponent, isStandalone: true, selector: "natural-file", inputs: { height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: false, isRequired: false, transformFunction: null }, backgroundSize: { classPropertyName: "backgroundSize", publicName: "backgroundSize", isSignal: false, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null }, uploader: { classPropertyName: "uploader", publicName: "uploader", isSignal: false, isRequired: false, transformFunction: null }, model: { classPropertyName: "model", publicName: "model", isSignal: false, isRequired: false, transformFunction: null }, formCtrl: { classPropertyName: "formCtrl", publicName: "formCtrl", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { modelChange: "modelChange" }, host: { properties: { "style.height.px": "height()" } }, usesOnChanges: true, ngImport: i0, template: "<a\n naturalFileDrop\n matRipple\n target=\"_blank\"\n [selectable]=\"true\"\n [accept]=\"accept\"\n [attr.href]=\"getDownloadLink()\"\n [class.has-action]=\"!!action\"\n [class.suggest-upload]=\"!model && action === 'upload'\"\n [fileSelectionDisabled]=\"action !== 'upload'\"\n [matRippleDisabled]=\"!action\"\n [naturalBackgroundDensity]=\"imagePreview\"\n [style.backgroundSize]=\"backgroundSize\"\n (fileChange)=\"upload($event)\"\n>\n @if (filePreview) {\n <div class=\"file-preview\" [style.font-size.px]=\"fontSize()\">\n <mat-icon naturalIcon=\"attachment\" [size]=\"iconHeight()\" />\n {{ filePreview | uppercase }}\n </div>\n }\n\n <div class=\"action-overlay\" [style.font-size.px]=\"fontSize()\">\n @if (action === 'upload') {\n <mat-icon naturalIcon=\"cloud_upload\" [size]=\"iconHeight()\" />\n }\n @if (action === 'download') {\n <mat-icon naturalIcon=\"get_app\" [size]=\"iconHeight()\" />\n }\n {{ action | capitalize }}\n </div>\n</a>\n", styles: [":host{display:flex;position:relative;flex-direction:row;overflow:hidden}:host>a{position:relative;flex:1;background-position:center;background-repeat:no-repeat}:host>a.has-action{cursor:pointer}:host>a.has-action.suggest-upload .action-overlay{opacity:.66}:host>a.has-action:hover .action-overlay,:host>a.has-action.natural-file-over .action-overlay{opacity:1}:host .action-overlay,:host .file-preview{display:flex;position:absolute;inset:0;flex-direction:column;justify-content:center;align-items:center;font-size:36px;line-height:1.3em;text-align:center}:host .action-overlay{opacity:0}:host .action-overlay>div{display:flex;position:absolute;inset:0;justify-content:center;align-items:center;opacity:0}\n"], dependencies: [{ kind: "directive", type: NaturalFileDropDirective, selector: ":not([naturalFileSelect])[naturalFileDrop]", outputs: ["fileOver"] }, { kind: "ngmodule", type: MatRippleModule }, { kind: "directive", type: i2$1.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$4.UpperCasePipe, name: "uppercase" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NaturalIconDirective, selector: "mat-icon[naturalIcon]", inputs: ["naturalIcon", "size"] }, { kind: "pipe", type: NaturalCapitalizePipe, name: "capitalize" }, { kind: "directive", type: NaturalBackgroundDensityDirective, selector: "[naturalBackgroundDensity]", inputs: ["naturalBackgroundDensity"] }] });
|
|
9416
9409
|
}
|
|
9417
9410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalFileComponent, decorators: [{
|
|
9418
9411
|
type: Component,
|
|
@@ -9431,8 +9424,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
|
|
|
9431
9424
|
type: Input
|
|
9432
9425
|
}], backgroundSize: [{
|
|
9433
9426
|
type: Input
|
|
9434
|
-
}], downloadLinkFn: [{
|
|
9435
|
-
type: Input
|
|
9436
9427
|
}], accept: [{
|
|
9437
9428
|
type: Input
|
|
9438
9429
|
}], uploader: [{
|