@yuuvis/client-framework 2.18.0 → 2.19.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.
@@ -2,6 +2,7 @@ import { ConfirmOverlayData } from './confirm.interface';
2
2
  import * as i0 from "@angular/core";
3
3
  export declare class ConfirmComponent {
4
4
  readonly dialogData: ConfirmOverlayData;
5
+ buttonType: import("@angular/core").Signal<"danger" | "primary">;
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmComponent, never>;
6
7
  static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmComponent, "yuv-confirm", never, {}, {}, never, never, true, never>;
7
8
  }
@@ -1,7 +1,9 @@
1
+ export type LevelType = 'success' | 'warning' | 'error' | 'info' | 'default';
1
2
  export interface ConfirmOverlayData {
2
3
  title?: string;
3
4
  message: string;
4
5
  confirmLabel?: string;
5
6
  cancelLabel?: string;
6
7
  hideCancelButton?: boolean;
8
+ level?: Extract<LevelType, 'default' | 'info' | 'warning'>;
7
9
  }
@@ -1,15 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, ChangeDetectionStrategy, Component, inject, DestroyRef, viewChild, signal, afterNextRender, ElementRef, Input, Directive, computed, output, EnvironmentInjector, ViewContainerRef, effect, EventEmitter, HostListener, Output, NgZone, contentChildren, Injectable, HostBinding, forwardRef, Renderer2, NgModule, InjectionToken, makeEnvironmentProviders, RendererFactory2 } from '@angular/core';
3
- import { CommonModule, DOCUMENT } from '@angular/common';
2
+ import { input, ChangeDetectionStrategy, Component, inject, computed, DestroyRef, viewChild, signal, afterNextRender, ElementRef, Input, Directive, output, EnvironmentInjector, ViewContainerRef, effect, EventEmitter, HostListener, Output, NgZone, contentChildren, Injectable, HostBinding, forwardRef, Renderer2, NgModule, InjectionToken, makeEnvironmentProviders, RendererFactory2 } from '@angular/core';
4
3
  import { MatButtonModule } from '@angular/material/button';
5
4
  import * as i2 from '@angular/material/dialog';
6
5
  import { MatDialogActions, MatDialogTitle, MatDialogContent, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
6
+ import { TranslateModule as TranslateModule$1, AppCacheService, RetentionService, LocaleDatePipe } from '@yuuvis/client-core';
7
+ import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
7
8
  import * as i1 from '@ngx-translate/core';
8
9
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
9
- import { YmtButtonDirective, YmtIconButtonDirective } from '@yuuvis/material';
10
- import { TranslateModule as TranslateModule$1, AppCacheService, RetentionService, LocaleDatePipe } from '@yuuvis/client-core';
11
10
  import * as i1$1 from '@angular/material/icon';
12
11
  import { MatIconModule } from '@angular/material/icon';
12
+ import { CommonModule, DOCUMENT } from '@angular/common';
13
13
  import { MatProgressSpinner } from '@angular/material/progress-spinner';
14
14
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
15
15
  import { Subject, fromEvent, merge, timer, of, forkJoin, map as map$1 } from 'rxjs';
@@ -33,11 +33,11 @@ class DialogComponent {
33
33
  <h2 mat-dialog-title>{{ title }}</h2>
34
34
  }
35
35
  <mat-dialog-content>
36
- <ng-content select="main"></ng-content>
36
+ <ng-content select="main" />
37
37
  </mat-dialog-content>
38
38
 
39
39
  <mat-dialog-actions align="end" class="footer">
40
- <ng-content select="footer"></ng-content>
40
+ <ng-content select="footer" />
41
41
  </mat-dialog-actions>
42
42
  `, isInline: true, styles: [":host{--_dialog-area-background: var(--dialog-area-background, light-dark(var(--ymt-surface), var(--ymt-surface-container-low)));--_dialog-area-divider-color: var(--dialog-area-divider-color, var(--ymt-outline-variant));height:100%;display:grid;grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:\"header\" \"content\" \"footer\"}:host h2{grid-area:header;background-color:var(--_dialog-area-background);border-block-end:1px solid var(--_dialog-area-divider-color)}:host .footer{background-color:var(--_dialog-area-background);border-block-start:1px solid var(--_dialog-area-divider-color);gap:calc(var(--ymt-font-body) / 2)}:host.not-separated{background-color:var(--ymt-surface-app)}:host.not-separated h2,:host.not-separated .footer{background-color:transparent;border:0}.mat-mdc-dialog-container{height:100%}mat-dialog-content:empty{display:contents}mat-dialog-content main{display:var(--ymt-dialog-content-display);grid-area:content;overflow:hidden}mat-dialog-actions{grid-area:footer}mat-dialog-actions:empty{display:contents}\n"], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
43
43
  }
@@ -49,11 +49,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
49
49
  <h2 mat-dialog-title>{{ title }}</h2>
50
50
  }
51
51
  <mat-dialog-content>
52
- <ng-content select="main"></ng-content>
52
+ <ng-content select="main" />
53
53
  </mat-dialog-content>
54
54
 
55
55
  <mat-dialog-actions align="end" class="footer">
56
- <ng-content select="footer"></ng-content>
56
+ <ng-content select="footer" />
57
57
  </mat-dialog-actions>
58
58
  `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--_dialog-area-background: var(--dialog-area-background, light-dark(var(--ymt-surface), var(--ymt-surface-container-low)));--_dialog-area-divider-color: var(--dialog-area-divider-color, var(--ymt-outline-variant));height:100%;display:grid;grid-template-rows:auto 1fr auto;grid-template-columns:1fr;grid-template-areas:\"header\" \"content\" \"footer\"}:host h2{grid-area:header;background-color:var(--_dialog-area-background);border-block-end:1px solid var(--_dialog-area-divider-color)}:host .footer{background-color:var(--_dialog-area-background);border-block-start:1px solid var(--_dialog-area-divider-color);gap:calc(var(--ymt-font-body) / 2)}:host.not-separated{background-color:var(--ymt-surface-app)}:host.not-separated h2,:host.not-separated .footer{background-color:transparent;border:0}.mat-mdc-dialog-container{height:100%}mat-dialog-content:empty{display:contents}mat-dialog-content main{display:var(--ymt-dialog-content-display);grid-area:content;overflow:hidden}mat-dialog-actions{grid-area:footer}mat-dialog-actions:empty{display:contents}\n"] }]
59
59
  }] });
@@ -61,13 +61,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
61
61
  class ConfirmComponent {
62
62
  constructor() {
63
63
  this.dialogData = inject(MAT_DIALOG_DATA);
64
+ this.buttonType = computed(() => {
65
+ switch (this.dialogData.level) {
66
+ case 'warning':
67
+ return 'danger';
68
+ // case 'warning':
69
+ // return 'tertiary' as ButtonType;
70
+ // case 'info':
71
+ // return 'primary' as ButtonType;
72
+ // case 'success':
73
+ // return 'primary' as ButtonType;
74
+ default:
75
+ return 'primary';
76
+ }
77
+ });
64
78
  }
65
79
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ConfirmComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
66
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: ConfirmComponent, isStandalone: true, selector: "yuv-confirm", ngImport: i0, template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button ymtButton=\"secondary\" mat-dialog-close type=\"button\">\n {{ dialogData.cancelLabel || ('yuv.confirm.cancel' | translate) }}\n </button>\n }\n <button ymtButton=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || ('yuv.confirm.confirm' | translate) }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: TranslateModule$1 }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }] }); }
80
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: ConfirmComponent, isStandalone: true, selector: "yuv-confirm", ngImport: i0, template: "<yuv-dialog [headertitle]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button ymtButton=\"secondary\" mat-dialog-close type=\"button\">\n {{ dialogData.cancelLabel || ('yuv.confirm.cancel' | translate) }}\n </button>\n }\n <button [ymtButton]=\"buttonType()\" type=\"button\" [mat-dialog-close]=\"true\">\n {{ dialogData.confirmLabel || ('yuv.confirm.confirm' | translate) }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: TranslateModule$1 }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "component", type: DialogComponent, selector: "yuv-dialog", inputs: ["headertitle", "headertitel"] }, { kind: "directive", type: YmtButtonDirective, selector: "button[ymtButton], a[ymtButton]", inputs: ["ymtButton", "disabled", "aria-disabled", "disableRipple", "disabledInteractive", "button-size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
67
81
  }
68
82
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ConfirmComponent, decorators: [{
69
83
  type: Component,
70
- args: [{ selector: 'yuv-confirm', imports: [CommonModule, MatButtonModule, TranslateModule$1, MatDialogModule, DialogComponent, YmtButtonDirective], template: "<yuv-dialog [headertitel]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button ymtButton=\"secondary\" mat-dialog-close type=\"button\">\n {{ dialogData.cancelLabel || ('yuv.confirm.cancel' | translate) }}\n </button>\n }\n <button ymtButton=\"primary\" type=\"button\" [mat-dialog-close]=\"true\">{{ dialogData.confirmLabel || ('yuv.confirm.confirm' | translate) }}</button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"] }]
84
+ args: [{ selector: 'yuv-confirm', imports: [MatButtonModule, TranslateModule$1, MatDialogModule, DialogComponent, YmtButtonDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<yuv-dialog [headertitle]=\"dialogData.title || ''\">\n <main>{{ dialogData.message }}</main>\n <footer>\n @if (!dialogData.hideCancelButton) {\n <button ymtButton=\"secondary\" mat-dialog-close type=\"button\">\n {{ dialogData.cancelLabel || ('yuv.confirm.cancel' | translate) }}\n </button>\n }\n <button [ymtButton]=\"buttonType()\" type=\"button\" [mat-dialog-close]=\"true\">\n {{ dialogData.confirmLabel || ('yuv.confirm.confirm' | translate) }}\n </button>\n </footer>\n</yuv-dialog>\n", styles: [":host{display:contents}:host main{padding:var(--ymt-spacing-m)}\n"] }]
71
85
  }] });
72
86
 
73
87
  const DEFAULT_SCROLL_AMOUNT$1 = 150;