@porscheinformatik/material-addons 22.0.12 → 22.0.14

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, Component, NgModule, booleanAttribute, Directive, ChangeDetectionStrategy, effect, Optional, HostBinding, LOCALE_ID, Inject, Injectable, output, InjectionToken, inject, viewChild, computed, signal, EventEmitter, Output, Input, ViewChild, forwardRef, HostListener, model, TemplateRef, ViewChildren, ContentChild, SkipSelf, ContentChildren, ViewEncapsulation, QueryList, contentChildren } from '@angular/core';
2
+ import { input, Component, NgModule, booleanAttribute, inject, ElementRef, Renderer2, DestroyRef, Directive, ChangeDetectionStrategy, effect, Optional, HostBinding, LOCALE_ID, Inject, Injectable, output, InjectionToken, viewChild, computed, signal, EventEmitter, Output, Input, ViewChild, forwardRef, HostListener, model, TemplateRef, ViewChildren, ContentChild, SkipSelf, ContentChildren, ViewEncapsulation, QueryList, contentChildren } from '@angular/core';
3
3
  import * as i2$1 from '@angular/material/icon';
4
4
  import { MatIconModule, MatIcon } from '@angular/material/icon';
5
5
  import * as i2 from '@angular/material/tooltip';
@@ -104,13 +104,23 @@ class MadBasicButton {
104
104
  this.type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : []));
105
105
  this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
106
106
  this.title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
107
+ this.host = inject(ElementRef);
108
+ this.renderer = inject(Renderer2);
109
+ this.destroyRef = inject(DestroyRef);
110
+ const removeClickListener = this.renderer.listen(this.host.nativeElement, 'click', (event) => {
111
+ if (this.disabled()) {
112
+ event.preventDefault();
113
+ event.stopImmediatePropagation();
114
+ }
115
+ }, { capture: true });
116
+ this.destroyRef.onDestroy(removeClickListener);
107
117
  }
108
118
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MadBasicButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
109
119
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.1", type: MadBasicButton, isStandalone: true, inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
110
120
  }
111
121
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MadBasicButton, decorators: [{
112
122
  type: Directive
113
- }], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }] } });
123
+ }], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }] } });
114
124
 
115
125
  class DangerButtonComponent extends MadBasicButton {
116
126
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: DangerButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
@@ -935,7 +945,10 @@ class NumericFieldDirective {
935
945
  this.detachListener();
936
946
  }
937
947
  ngAfterViewChecked() {
938
- this.injectUnitSymbol();
948
+ // Only needed to create the unitSpan or refresh the unit
949
+ if (!this.unitSpan || this.unitSpan.textContent !== this.unit) {
950
+ this.injectUnitSymbol();
951
+ }
939
952
  }
940
953
  handleInputChanged() {
941
954
  // Call in set timeout to avoid Expression has changed after it has been checked error.
@@ -4261,7 +4274,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
4261
4274
  args: [{ selector: 'mad-breadcrumb', imports: [RouterLink, IconButtonComponent, MatIcon, MatTooltip], template: "@if (breadcrumbs().length) {\n <div class=\"breadcrumb\">\n <nav data-cy=\"breadcrumb-nav\" class=\"breadcrumb__nav\">\n @for (crumb of breadcrumbs(); track crumb.label; let last = $last) {\n @if (crumb.route?.length) {\n <a data-cy=\"breadcrumb-link\" [routerLink]=\"crumb.route\" class=\"breadcrumb__link\">{{ crumb.label }}</a>\n } @else if (crumb.href?.length) {\n <a data-cy=\"breadcrumb-link\" [href]=\"crumb.href\" target=\"_blank\" class=\"breadcrumb__link\">{{ crumb.label }}</a>\n } @else {\n <span data-cy=\"breadcrumb-current\" class=\"breadcrumb__current\">{{ crumb.label }}</span>\n }\n @if (!last) {\n <span data-cy=\"breadcrumb-separator\" class=\"breadcrumb__separator\">/</span>\n }\n }\n </nav>\n @if (showCopy()) {\n <mad-icon-button\n data-cy=\"breadcrumb-copy\"\n class=\"breadcrumb__copy\"\n (click)=\"copy.emit()\"\n [matTooltip]=\"title()\"\n matTooltipPosition=\"above\"\n >\n <mat-icon>content_copy</mat-icon>\n </mad-icon-button>\n }\n </div>\n}\n", styles: [".breadcrumb{display:flex;align-items:center;gap:.5rem}.breadcrumb__nav{display:flex;align-items:center;gap:.625rem;min-height:3.5rem;padding-block:.25rem;font-size:.875rem;line-height:1.25rem}.breadcrumb__link{color:var(--main-primary);text-decoration:none}.breadcrumb__link:hover{text-decoration:underline}.breadcrumb__current,.breadcrumb__separator{color:var(--breadcrumb-separator-color)}.breadcrumb__copy{flex-shrink:0}\n"] }]
4262
4275
  }], propDecorators: { breadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumbs", required: true }] }], showCopy: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCopy", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], copy: [{ type: i0.Output, args: ["copy"] }] } });
4263
4276
 
4264
- const VERSION = '22.0.12';
4277
+ const VERSION = '22.0.14';
4265
4278
 
4266
4279
  const MAD_ALERT_DEFAULT_CONFIGURATION = new InjectionToken('mad-alert-configuration', {
4267
4280
  providedIn: 'root',