@porscheinformatik/material-addons 22.1.0 → 22.1.1

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, ElementRef, ViewContainerRef, Renderer2, inputBinding, outputBinding, contentChildren, contentChild, ChangeDetectorRef, untracked, 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, ViewContainerRef, inputBinding, outputBinding, contentChildren, contentChild, ChangeDetectorRef, untracked, 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 }); }