@ecodev/natural 63.3.2 → 63.4.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.
@@ -2497,10 +2497,16 @@ class NaturalAbstractDetail extends NaturalAbstractPanel {
2497
2497
  return EMPTY;
2498
2498
  }
2499
2499
  else {
2500
- const defaultRoute = ['../../' + kebabCase(this.key)];
2501
- return this.router.navigate(redirectionRoute ? redirectionRoute : defaultRoute, {
2502
- relativeTo: this.route,
2503
- });
2500
+ let commands = ['../../' + kebabCase(this.key)];
2501
+ let extras = { relativeTo: this.route };
2502
+ if (redirectionRoute && 'extras' in redirectionRoute) {
2503
+ commands = redirectionRoute.commands;
2504
+ extras = { ...extras, ...redirectionRoute.extras };
2505
+ }
2506
+ else if (redirectionRoute) {
2507
+ commands = redirectionRoute;
2508
+ }
2509
+ return this.router.navigate(commands, extras);
2504
2510
  }
2505
2511
  }));
2506
2512
  }), finalize(() => this.form.enable()))
@@ -9288,11 +9294,6 @@ class NaturalFileComponent {
9288
9294
  fontSize = computed(() => Math.min(this.height() * 0.3, 36));
9289
9295
  action = null;
9290
9296
  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
9297
  /**
9297
9298
  * Comma-separated list of unique file type specifiers. Like the native element,
9298
9299
  * it can be a mix of mime-type and file extensions.
@@ -9355,9 +9356,7 @@ class NaturalFileComponent {
9355
9356
  if (this.action !== 'download') {
9356
9357
  return null;
9357
9358
  }
9358
- return this.downloadLinkFn
9359
- ? this.downloadLinkFn(this.model)
9360
- : this.naturalFileService.getDownloadLink(this.model);
9359
+ return this.naturalFileService.getDownloadLink(this.model);
9361
9360
  }
9362
9361
  updateImage() {
9363
9362
  this.imagePreview = '';
@@ -9412,7 +9411,7 @@ class NaturalFileComponent {
9412
9411
  return subject.asObservable();
9413
9412
  }
9414
9413
  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 }, downloadLinkFn: { classPropertyName: "downloadLinkFn", publicName: "downloadLinkFn", 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"] }] });
9414
+ 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
9415
  }
9417
9416
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImport: i0, type: NaturalFileComponent, decorators: [{
9418
9417
  type: Component,
@@ -9431,8 +9430,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.13", ngImpo
9431
9430
  type: Input
9432
9431
  }], backgroundSize: [{
9433
9432
  type: Input
9434
- }], downloadLinkFn: [{
9435
- type: Input
9436
9433
  }], accept: [{
9437
9434
  type: Input
9438
9435
  }], uploader: [{