diff --git a/src/lib/buttons/circle-button/circle-button.component.html b/src/lib/buttons/circle-button/circle-button.component.html index 9bd6478..ad891b4 100644 --- a/src/lib/buttons/circle-button/circle-button.component.html +++ b/src/lib/buttons/circle-button/circle-button.component.html @@ -1,9 +1,4 @@ -
+
diff --git a/src/lib/buttons/circle-button/circle-button.component.ts b/src/lib/buttons/circle-button/circle-button.component.ts index 4ca1718..a46a8e6 100644 --- a/src/lib/buttons/circle-button/circle-button.component.ts +++ b/src/lib/buttons/circle-button/circle-button.component.ts @@ -5,13 +5,14 @@ import { IqserTooltipPosition, IqserTooltipPositions, randomString } from '../.. import { NgIf } from '@angular/common'; import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button'; import { MatIconModule } from '@angular/material/icon'; +import { StopPropagationDirective } from '../../directives'; @Component({ selector: 'iqser-circle-button [icon]', templateUrl: './circle-button.component.html', styleUrls: ['./circle-button.component.scss'], standalone: true, - imports: [MatTooltipModule, MatIconModule, NgIf, MatButtonModule], + imports: [MatTooltipModule, MatIconModule, NgIf, MatButtonModule, StopPropagationDirective], }) export class CircleButtonComponent implements OnInit { readonly circleButtonTypes = CircleButtonTypes; @@ -41,7 +42,7 @@ export class CircleButtonComponent implements OnInit { (this._elementRef.nativeElement as HTMLElement).style.setProperty('--iconSize', `${this.iconSize}px`); } - performAction($event: MouseEvent): void { + performAction($event: MouseEvent) { if (this.removeTooltip) { this._matTooltip.hide(); // Timeout to allow tooltip to disappear first, @@ -51,10 +52,4 @@ export class CircleButtonComponent implements OnInit { this.action.emit($event); } } - - preventActionOnDisabled($event: MouseEvent): void { - if (this.disabled) { - $event.stopPropagation(); - } - } } diff --git a/src/lib/buttons/icon-button/icon-button.component.html b/src/lib/buttons/icon-button/icon-button.component.html index c74d2f3..0ff933a 100644 --- a/src/lib/buttons/icon-button/icon-button.component.html +++ b/src/lib/buttons/icon-button/icon-button.component.html @@ -5,6 +5,7 @@ [ngClass]="classes" [type]="submit ? 'submit' : 'button'" mat-button + stopPropagation > {{ label }} diff --git a/src/lib/buttons/icon-button/icon-button.component.ts b/src/lib/buttons/icon-button/icon-button.component.ts index f1d5bfa..116a38a 100644 --- a/src/lib/buttons/icon-button/icon-button.component.ts +++ b/src/lib/buttons/icon-button/icon-button.component.ts @@ -4,13 +4,14 @@ import { randomString } from '../../utils'; import { NgClass, NgIf } from '@angular/common'; import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button'; import { MatIconModule } from '@angular/material/icon'; +import { StopPropagationDirective } from '../../directives'; @Component({ selector: 'iqser-icon-button [label]', templateUrl: './icon-button.component.html', styleUrls: ['./icon-button.component.scss'], standalone: true, - imports: [NgClass, MatButtonModule, NgIf, MatIconModule], + imports: [NgClass, MatButtonModule, NgIf, MatIconModule, StopPropagationDirective], }) export class IconButtonComponent { readonly iconButtonTypes = IconButtonTypes; diff --git a/src/lib/common-ui.module.ts b/src/lib/common-ui.module.ts index c247376..50b87e3 100644 --- a/src/lib/common-ui.module.ts +++ b/src/lib/common-ui.module.ts @@ -22,6 +22,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { CircleButtonComponent, IconButtonComponent } from './buttons'; import { DomSanitizer } from '@angular/platform-browser'; import { ICONS } from './utils/constants'; +import { StopPropagationDirective } from './directives'; const matModules = [ MatIconModule, @@ -46,6 +47,7 @@ const components = [ConnectionStatusComponent, FullPageErrorComponent, Confirmat TranslateModule, IconButtonComponent, CircleButtonComponent, + StopPropagationDirective, ], exports: [...components, ...modules], providers: [ diff --git a/src/lib/dialog/confirmation-dialog.service.ts b/src/lib/dialog/confirmation-dialog.service.ts index 6c1028f..abcc205 100644 --- a/src/lib/dialog/confirmation-dialog.service.ts +++ b/src/lib/dialog/confirmation-dialog.service.ts @@ -25,8 +25,6 @@ export class ConfirmationDialogService extends DialogService { openDialog(data?: { disableConfirm: boolean; [key: string]: unknown }): MatDialogRef { return super.openDialog( 'confirm', - // @ts-ignore - undefined, new ConfirmationDialogInput({ title: _('confirmation-dialog.unsaved-changes.title'), question: _('confirmation-dialog.unsaved-changes.question'), diff --git a/src/lib/filtering/filter-card/filter-card.component.html b/src/lib/filtering/filter-card/filter-card.component.html index 106abe0..2d3d48a 100644 --- a/src/lib/filtering/filter-card/filter-card.component.html +++ b/src/lib/filtering/filter-card/filter-card.component.html @@ -1,12 +1,12 @@ +
@@ -48,23 +48,20 @@
-
+
-
+
@@ -73,11 +70,12 @@
 
-
- +
+ + {{ filter.label }} diff --git a/src/lib/filtering/single-filter/single-filter.component.ts b/src/lib/filtering/single-filter/single-filter.component.ts index a85351a..7deb258 100644 --- a/src/lib/filtering/single-filter/single-filter.component.ts +++ b/src/lib/filtering/single-filter/single-filter.component.ts @@ -13,8 +13,7 @@ export class SingleFilterComponent { constructor(readonly filterService: FilterService) {} - checkboxClicked($event: MouseEvent) { - $event.preventDefault(); + checkboxClicked() { this.filterService.toggleSingleFilter(this.filter.id); } } diff --git a/src/lib/help-mode/help-mode/help-mode.component.ts b/src/lib/help-mode/help-mode/help-mode.component.ts index bd6f46d..b0999f0 100644 --- a/src/lib/help-mode/help-mode/help-mode.component.ts +++ b/src/lib/help-mode/help-mode/help-mode.component.ts @@ -12,14 +12,16 @@ import { MatDialog } from '@angular/material/dialog'; export class HelpModeComponent { constructor(private readonly _dialog: MatDialog, readonly helpModeService: HelpModeService) {} - @HostListener('document:keydown.escape', ['$event']) onEscKeydownHandler(event: KeyboardEvent): void { + @HostListener('document:keydown.escape', ['$event']) + onEscKeydownHandler(event: KeyboardEvent): void { if (!this.helpModeService.helpModeDialogIsOpened && this.helpModeService.isHelpModeActive) { event?.stopPropagation(); this.helpModeService.deactivateHelpMode(); } } - @HostListener('document:keydown.h', ['$event']) onHKeydownHandler(event: KeyboardEvent): void { + @HostListener('document:keydown.h', ['$event']) + onHKeydownHandler(event: KeyboardEvent): void { const node = (event.target as IqserEventTarget).localName; if (!this.helpModeService.isHelpModeActive && node !== 'input' && node !== 'textarea') { if (this.helpModeService.helpButtonKey) { @@ -32,13 +34,15 @@ export class HelpModeComponent { } } - @HostListener('click') onClick(): void { + @HostListener('click') + onClick(): void { if (this.helpModeService.isHelpModeActive) { this.helpModeService.highlightHelperElements(); } } - @HostListener('window:resize') onResize() { + @HostListener('window:resize') + onResize() { if (this.helpModeService.isHelpModeActive) { this.helpModeService.updateHelperElements(); } diff --git a/src/lib/inputs/dynamic-input/dynamic-input.component.html b/src/lib/inputs/dynamic-input/dynamic-input.component.html index cdd349b..4e914eb 100644 --- a/src/lib/inputs/dynamic-input/dynamic-input.component.html +++ b/src/lib/inputs/dynamic-input/dynamic-input.component.html @@ -1,15 +1,15 @@ -
+
@@ -18,23 +18,15 @@ - +
diff --git a/src/lib/inputs/input-with-action/input-with-action.component.html b/src/lib/inputs/input-with-action/input-with-action.component.html index 610d45d..588c040 100644 --- a/src/lib/inputs/input-with-action/input-with-action.component.html +++ b/src/lib/inputs/input-with-action/input-with-action.component.html @@ -1,9 +1,9 @@ -
+ { openDialog( type: T, - $event: MouseEvent, - data: unknown, + data?: unknown, cb?: (...params: unknown[]) => Promise | void, finallyCb?: (...params: unknown[]) => void | Promise, ): MatDialogRef { const config = this._config[type]; - $event?.stopPropagation(); const ref = this._dialog.open(config.component, { ...defaultDialogConfig, ...(config.dialogConfig || {}), diff --git a/src/lib/shared/toast/toast.component.html b/src/lib/shared/toast/toast.component.html index d17d19e..4ef3146 100644 --- a/src/lib/shared/toast/toast.component.html +++ b/src/lib/shared/toast/toast.component.html @@ -10,7 +10,7 @@
diff --git a/src/lib/shared/toast/toast.component.ts b/src/lib/shared/toast/toast.component.ts index 0714632..9a220d1 100644 --- a/src/lib/shared/toast/toast.component.ts +++ b/src/lib/shared/toast/toast.component.ts @@ -15,8 +15,7 @@ export class ToastComponent extends Toast { return (this.options as ToasterOptions)?.actions || []; } - callAction($event: MouseEvent, action: () => void): void { - $event.stopPropagation(); + callAction(action: () => void): void { if (action) { action(); }