@flywheel-io/vision 2.7.9 → 2.8.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.
- package/components/snackbar/snackbar/snackbar.component.d.ts +14 -10
- package/components/snackbar/snackbar-message.model.d.ts +3 -1
- package/esm2022/components/snackbar/snackbar/snackbar.component.mjs +48 -64
- package/esm2022/components/snackbar/snackbar-message.model.mjs +1 -1
- package/fesm2022/flywheel-io-vision.mjs +47 -63
- package/fesm2022/flywheel-io-vision.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { FwSnackbarMessage } from '../snackbar-message.model';
|
|
3
3
|
import { FwSnackbarTimerService } from '../snackbar-timer.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class FwSnackbarComponent implements AfterViewInit
|
|
5
|
+
export declare class FwSnackbarComponent implements AfterViewInit {
|
|
6
6
|
private cdr;
|
|
7
7
|
private timerService;
|
|
8
|
-
message: FwSnackbarMessage
|
|
9
|
-
messageDuration: number
|
|
10
|
-
ready:
|
|
11
|
-
dismiss:
|
|
12
|
-
action:
|
|
13
|
-
|
|
8
|
+
message: import("@angular/core").InputSignal<FwSnackbarMessage>;
|
|
9
|
+
messageDuration: import("@angular/core").InputSignal<number>;
|
|
10
|
+
ready: import("@angular/core").OutputEmitterRef<FwSnackbarComponent>;
|
|
11
|
+
dismiss: import("@angular/core").OutputEmitterRef<string>;
|
|
12
|
+
action: import("@angular/core").OutputEmitterRef<string>;
|
|
13
|
+
private defaultIcons;
|
|
14
|
+
icon: import("@angular/core").Signal<string>;
|
|
15
|
+
showClose: import("@angular/core").Signal<boolean>;
|
|
16
|
+
duration: import("@angular/core").Signal<number>;
|
|
17
|
+
color: import("@angular/core").Signal<"warning" | "success" | "primary" | "secondary" | "slate" | "danger" | "skeleton">;
|
|
18
|
+
isTemplateRef: import("@angular/core").Signal<boolean>;
|
|
14
19
|
get cssClass(): string;
|
|
15
20
|
constructor(cdr: ChangeDetectorRef, timerService: FwSnackbarTimerService);
|
|
16
21
|
ngAfterViewInit(): void;
|
|
17
22
|
startTimer(): void;
|
|
18
23
|
stopTimer(): void;
|
|
19
|
-
ngOnInit(): void;
|
|
20
24
|
handleDismiss(): void;
|
|
21
25
|
handleAction(): void;
|
|
22
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<FwSnackbarComponent, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FwSnackbarComponent, "fw-snackbar", never, { "message": { "alias": "message"; "required":
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FwSnackbarComponent, "fw-snackbar", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "messageDuration": { "alias": "messageDuration"; "required": false; "isSignal": true; }; }, { "ready": "ready"; "dismiss": "dismiss"; "action": "action"; }, never, never, false, never>;
|
|
24
28
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
1
2
|
import { FwSnackbarComponent } from './snackbar/snackbar.component';
|
|
2
3
|
export interface FwSnackbarMessage {
|
|
3
4
|
id?: string;
|
|
4
5
|
severity: 'info' | 'success' | 'warning' | 'error';
|
|
5
|
-
message: string
|
|
6
|
+
message: string | TemplateRef<any>;
|
|
6
7
|
icon?: string;
|
|
7
8
|
showClose?: boolean;
|
|
8
9
|
actionText?: string;
|
|
9
10
|
action?: () => void;
|
|
10
11
|
duration?: number;
|
|
11
12
|
ref?: FwSnackbarComponent;
|
|
13
|
+
templateContext?: object;
|
|
12
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @rx-angular/no-explicit-change-detection-apis */
|
|
2
|
-
import { ChangeDetectionStrategy, Component,
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, HostBinding, input, output, TemplateRef, ViewEncapsulation, } from '@angular/core';
|
|
3
3
|
import { FwSnackbarTimerService } from '../snackbar-timer.service';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import * as i1 from "../snackbar-timer.service";
|
|
@@ -10,8 +10,9 @@ import * as i5 from "../../icon/icon.component";
|
|
|
10
10
|
export class FwSnackbarComponent {
|
|
11
11
|
get cssClass() {
|
|
12
12
|
const cssClass = 'fw-snackbar';
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const severity = this.message()?.severity;
|
|
14
|
+
if (severity) {
|
|
15
|
+
return cssClass + ' ' + this.color();
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
return cssClass;
|
|
@@ -20,21 +21,47 @@ export class FwSnackbarComponent {
|
|
|
20
21
|
constructor(cdr, timerService) {
|
|
21
22
|
this.cdr = cdr;
|
|
22
23
|
this.timerService = timerService;
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
24
|
+
this.message = input.required();
|
|
25
|
+
this.messageDuration = input(9000);
|
|
26
|
+
this.ready = output();
|
|
27
|
+
this.dismiss = output();
|
|
28
|
+
this.action = output();
|
|
29
|
+
this.defaultIcons = {
|
|
30
|
+
success: 'done-check-tracked',
|
|
31
|
+
warning: 'warning-circle',
|
|
32
|
+
error: 'warning',
|
|
33
|
+
info: 'information-circle',
|
|
34
|
+
};
|
|
35
|
+
this.icon = computed(() => this.message().icon || this.defaultIcons[this.message().severity]);
|
|
36
|
+
this.showClose = computed(() => {
|
|
37
|
+
const msg = this.message();
|
|
38
|
+
return msg.showClose !== undefined ? msg.showClose : msg.severity === 'error';
|
|
39
|
+
});
|
|
40
|
+
this.duration = computed(() => {
|
|
41
|
+
const msg = this.message();
|
|
42
|
+
if (msg.duration) {
|
|
43
|
+
return msg.duration;
|
|
44
|
+
}
|
|
45
|
+
return msg.severity === 'error' ? 29000 : this.messageDuration();
|
|
46
|
+
});
|
|
47
|
+
this.color = computed(() => {
|
|
48
|
+
const severity = this.message().severity;
|
|
49
|
+
const colors = {
|
|
50
|
+
success: 'success',
|
|
51
|
+
warning: 'warning',
|
|
52
|
+
error: 'danger',
|
|
53
|
+
info: 'primary',
|
|
54
|
+
};
|
|
55
|
+
return colors[severity] || 'primary';
|
|
56
|
+
});
|
|
57
|
+
this.isTemplateRef = computed(() => this.message().message instanceof TemplateRef);
|
|
28
58
|
}
|
|
29
59
|
ngAfterViewInit() {
|
|
30
60
|
this.ready.emit(this);
|
|
31
61
|
this.cdr.markForCheck();
|
|
32
62
|
}
|
|
33
63
|
startTimer() {
|
|
34
|
-
|
|
35
|
-
this.messageDuration = this.message.duration;
|
|
36
|
-
}
|
|
37
|
-
this.timerService.start(this.messageDuration).then(() => {
|
|
64
|
+
this.timerService.start(this.duration()).then(() => {
|
|
38
65
|
this.handleDismiss();
|
|
39
66
|
this.cdr.markForCheck();
|
|
40
67
|
});
|
|
@@ -43,69 +70,26 @@ export class FwSnackbarComponent {
|
|
|
43
70
|
this.timerService.stop();
|
|
44
71
|
this.cdr.markForCheck();
|
|
45
72
|
}
|
|
46
|
-
ngOnInit() {
|
|
47
|
-
switch (this.message.severity) {
|
|
48
|
-
case 'success':
|
|
49
|
-
if (!this.message.icon) {
|
|
50
|
-
this.message.icon = 'done-check-tracked';
|
|
51
|
-
}
|
|
52
|
-
this.color = 'success';
|
|
53
|
-
break;
|
|
54
|
-
case 'warning':
|
|
55
|
-
if (!this.message.icon) {
|
|
56
|
-
this.message.icon = 'warning-circle';
|
|
57
|
-
}
|
|
58
|
-
this.color = 'warning';
|
|
59
|
-
break;
|
|
60
|
-
case 'error':
|
|
61
|
-
if (!this.message.icon) {
|
|
62
|
-
this.message.icon = 'warning';
|
|
63
|
-
}
|
|
64
|
-
if (this.message.showClose === undefined) {
|
|
65
|
-
this.message.showClose = true;
|
|
66
|
-
}
|
|
67
|
-
if (!this.message.duration) {
|
|
68
|
-
this.message.duration = 29000;
|
|
69
|
-
}
|
|
70
|
-
this.color = 'danger';
|
|
71
|
-
break;
|
|
72
|
-
case 'info':
|
|
73
|
-
if (!this.message.icon) {
|
|
74
|
-
this.message.icon = 'information-circle';
|
|
75
|
-
}
|
|
76
|
-
this.color = 'primary';
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
73
|
handleDismiss() {
|
|
81
|
-
this.dismiss.emit(this.message.id);
|
|
74
|
+
this.dismiss.emit(this.message().id);
|
|
82
75
|
this.cdr.markForCheck();
|
|
83
76
|
}
|
|
84
77
|
handleAction() {
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
const msg = this.message();
|
|
79
|
+
this.action.emit(msg.id);
|
|
80
|
+
if (msg.action) {
|
|
81
|
+
msg.action();
|
|
88
82
|
}
|
|
89
83
|
this.cdr.markForCheck();
|
|
90
84
|
}
|
|
91
85
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FwSnackbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.FwSnackbarTimerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
92
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
86
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FwSnackbarComponent, selector: "fw-snackbar", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, messageDuration: { classPropertyName: "messageDuration", publicName: "messageDuration", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", dismiss: "dismiss", action: "action" }, host: { properties: { "class": "this.cssClass" } }, providers: [FwSnackbarTimerService], ngImport: i0, template: "@if (message(); as msg) {\n @if (icon()) {\n <fw-icon>{{ icon() }}</fw-icon>\n }\n @if (isTemplateRef()) {\n <ng-container *ngTemplateOutlet=\"$any(msg.message); context: msg.templateContext\"></ng-container>\n } @else {\n @if (msg.message) {\n <h4 class=\"vision-h4\">{{ msg.message }}</h4>\n }\n }\n @if (msg.actionText) {\n <fw-button\n size=\"small\"\n variant=\"ghost\"\n [color]=\"color()\"\n (click)=\"handleAction()\"\n >\n {{ msg.actionText }}\n </fw-button>\n }\n @if (showClose()) {\n <fw-icon-button\n icon=\"close\"\n size=\"small\"\n [color]=\"msg.severity\"\n (click)=\"handleDismiss()\"\n ></fw-icon-button>\n }\n @if (!msg.actionText && !showClose()) {\n <div></div>\n }\n}\n", styles: [".vision-shadow-extra-large{box-shadow:0 8px 25px #0000001a}.vision-shadow-large,fw-snackbar{box-shadow:0 5px 15px #0000001a}.vision-shadow-medium{box-shadow:0 2px 5px #0000001a}.vision-shadow-small{box-shadow:0 1px 2px #0000000d}.vision-shadow-inner{box-shadow:0 2px 4px #00000014 inset}fw-snackbar{display:flex;align-items:flex-start;box-sizing:border-box;max-width:320px;min-width:200px;min-height:30px;padding:8px 8px 8px 16px;gap:8px;transform-origin:center;background-color:var(--card-header);color:var(--typography-base);white-space:pre-wrap;border-radius:4px;border:1px solid var(--separations-border);margin:8px}fw-snackbar>fw-icon{width:24px;height:24px;font-size:24px;white-space:nowrap;margin:3px 0}fw-snackbar h4{margin:6px 0 0;flex:1}fw-snackbar.primary fw-icon{color:var(--primary-base)}fw-snackbar.danger fw-icon{color:var(--red-base)}fw-snackbar.success fw-icon{color:var(--green-base)}fw-snackbar.warning fw-icon{color:var(--orange-base)}\n"], dependencies: [{ kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.FwButtonComponent, selector: "fw-button", inputs: ["color", "size", "variant", "type", "disabled", "fullWidth", "leftIcon", "rightIcon"] }, { kind: "component", type: i4.FwIconButtonComponent, selector: "fw-icon-button", inputs: ["color", "icon", "size", "disabled", "selected"] }, { kind: "component", type: i5.FwIconComponent, selector: "fw-icon", inputs: ["size", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
93
87
|
}
|
|
94
88
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FwSnackbarComponent, decorators: [{
|
|
95
89
|
type: Component,
|
|
96
|
-
args: [{ selector: 'fw-snackbar', providers: [FwSnackbarTimerService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "
|
|
97
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.FwSnackbarTimerService }], propDecorators: {
|
|
98
|
-
type: Input
|
|
99
|
-
}], messageDuration: [{
|
|
100
|
-
type: Input
|
|
101
|
-
}], ready: [{
|
|
102
|
-
type: Output
|
|
103
|
-
}], dismiss: [{
|
|
104
|
-
type: Output
|
|
105
|
-
}], action: [{
|
|
106
|
-
type: Output
|
|
107
|
-
}], cssClass: [{
|
|
90
|
+
args: [{ selector: 'fw-snackbar', providers: [FwSnackbarTimerService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (message(); as msg) {\n @if (icon()) {\n <fw-icon>{{ icon() }}</fw-icon>\n }\n @if (isTemplateRef()) {\n <ng-container *ngTemplateOutlet=\"$any(msg.message); context: msg.templateContext\"></ng-container>\n } @else {\n @if (msg.message) {\n <h4 class=\"vision-h4\">{{ msg.message }}</h4>\n }\n }\n @if (msg.actionText) {\n <fw-button\n size=\"small\"\n variant=\"ghost\"\n [color]=\"color()\"\n (click)=\"handleAction()\"\n >\n {{ msg.actionText }}\n </fw-button>\n }\n @if (showClose()) {\n <fw-icon-button\n icon=\"close\"\n size=\"small\"\n [color]=\"msg.severity\"\n (click)=\"handleDismiss()\"\n ></fw-icon-button>\n }\n @if (!msg.actionText && !showClose()) {\n <div></div>\n }\n}\n", styles: [".vision-shadow-extra-large{box-shadow:0 8px 25px #0000001a}.vision-shadow-large,fw-snackbar{box-shadow:0 5px 15px #0000001a}.vision-shadow-medium{box-shadow:0 2px 5px #0000001a}.vision-shadow-small{box-shadow:0 1px 2px #0000000d}.vision-shadow-inner{box-shadow:0 2px 4px #00000014 inset}fw-snackbar{display:flex;align-items:flex-start;box-sizing:border-box;max-width:320px;min-width:200px;min-height:30px;padding:8px 8px 8px 16px;gap:8px;transform-origin:center;background-color:var(--card-header);color:var(--typography-base);white-space:pre-wrap;border-radius:4px;border:1px solid var(--separations-border);margin:8px}fw-snackbar>fw-icon{width:24px;height:24px;font-size:24px;white-space:nowrap;margin:3px 0}fw-snackbar h4{margin:6px 0 0;flex:1}fw-snackbar.primary fw-icon{color:var(--primary-base)}fw-snackbar.danger fw-icon{color:var(--red-base)}fw-snackbar.success fw-icon{color:var(--green-base)}fw-snackbar.warning fw-icon{color:var(--orange-base)}\n"] }]
|
|
91
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.FwSnackbarTimerService }], propDecorators: { cssClass: [{
|
|
108
92
|
type: HostBinding,
|
|
109
93
|
args: ['class']
|
|
110
94
|
}] } });
|
|
111
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
95
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hY2tiYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc25hY2tiYXIvc25hY2tiYXIvc25hY2tiYXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2NvbXBvbmVudHMvc25hY2tiYXIvc25hY2tiYXIvc25hY2tiYXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsa0VBQWtFO0FBQ2xFLE9BQU8sRUFFTCx1QkFBdUIsRUFFdkIsU0FBUyxFQUNULFFBQVEsRUFDUixXQUFXLEVBQ1gsS0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KVwiXG4gICAgICAoY2xpY2spPVwiaGFuZGxlQWN0aW9uKClcIlxuICAgID5cbiAgICAgIHt7IG1zZy5hY3Rpb25UZXh0IH19XG4gICAgPC9mdy1idXR0b24+XG4gIH1cbiAgQGlmIChzaG93Q2xvc2UoKSkge1xuICAgIDxmdy1pY29uLWJ1dHRvblxuICAgICAgaWNvbj1cImNsb3NlXCJcbiAgICAgIHNpemU9XCJzbWFsbFwiXG4gICAgICBbY29sb3JdPVwibXNnLnNldmVyaXR5XCJcbiAgICAgIChjbGljayk9XCJoYW5kbGVEaXNtaXNzKClcIlxuICAgID48L2Z3LWljb24tYnV0dG9uPlxuICB9XG4gIEBpZiAoIW1zZy5hY3Rpb25UZXh0ICYmICFzaG93Q2xvc2UoKSkge1xuICAgIDxkaXY+PC9kaXY+XG4gIH1cbn1cbiJdfQ==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic25hY2tiYXItbWVzc2FnZS5tb2RlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3NuYWNrYmFyL3NuYWNrYmFyLW1lc3NhZ2UubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFRlbXBsYXRlUmVmIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB7IEZ3U25hY2tiYXJDb21wb25lbnQgfSBmcm9tICcuL3NuYWNrYmFyL3NuYWNrYmFyLmNvbXBvbmVudCc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgRndTbmFja2Jhck1lc3NhZ2Uge1xuICBpZD86IHN0cmluZztcbiAgc2V2ZXJpdHk6ICdpbmZvJyB8ICdzdWNjZXNzJyB8ICd3YXJuaW5nJyB8ICdlcnJvcic7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gIG1lc3NhZ2U6IHN0cmluZyB8IFRlbXBsYXRlUmVmPGFueT47XG4gIGljb24/OiBzdHJpbmc7XG4gIHNob3dDbG9zZT86IGJvb2xlYW47XG4gIGFjdGlvblRleHQ/OiBzdHJpbmcsXG4gIGFjdGlvbj86ICgpID0+IHZvaWQ7XG4gIGR1cmF0aW9uPzogbnVtYmVyO1xuICByZWY/OiBGd1NuYWNrYmFyQ29tcG9uZW50O1xuICB0ZW1wbGF0ZUNvbnRleHQ/OiBvYmplY3Q7XG59XG4iXX0=
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostBinding, Input, ChangeDetectionStrategy, Component, EventEmitter, Output, NgModule, input, model, computed, ViewEncapsulation, HostListener, signal, effect, inject, ElementRef, ViewContainerRef, Directive, contentChildren, viewChild, ChangeDetectorRef, ContentChildren, ViewChild, forwardRef, Optional, Inject, SkipSelf, Injectable, Pipe, ContentChild, output, Host, ViewChildren, Self, viewChildren } from '@angular/core';
|
|
2
|
+
import { HostBinding, Input, ChangeDetectionStrategy, Component, EventEmitter, Output, NgModule, input, model, computed, ViewEncapsulation, HostListener, signal, effect, inject, ElementRef, ViewContainerRef, Directive, contentChildren, viewChild, ChangeDetectorRef, ContentChildren, ViewChild, forwardRef, Optional, Inject, SkipSelf, Injectable, Pipe, ContentChild, output, Host, ViewChildren, Self, TemplateRef, viewChildren } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgClass } from '@angular/common';
|
|
5
5
|
import * as i1 from '@angular/platform-browser';
|
|
@@ -7582,8 +7582,9 @@ class FwSnackbarTimerService {
|
|
|
7582
7582
|
class FwSnackbarComponent {
|
|
7583
7583
|
get cssClass() {
|
|
7584
7584
|
const cssClass = 'fw-snackbar';
|
|
7585
|
-
|
|
7586
|
-
|
|
7585
|
+
const severity = this.message()?.severity;
|
|
7586
|
+
if (severity) {
|
|
7587
|
+
return cssClass + ' ' + this.color();
|
|
7587
7588
|
}
|
|
7588
7589
|
else {
|
|
7589
7590
|
return cssClass;
|
|
@@ -7592,21 +7593,47 @@ class FwSnackbarComponent {
|
|
|
7592
7593
|
constructor(cdr, timerService) {
|
|
7593
7594
|
this.cdr = cdr;
|
|
7594
7595
|
this.timerService = timerService;
|
|
7595
|
-
this.
|
|
7596
|
-
this.
|
|
7597
|
-
this.
|
|
7598
|
-
this.
|
|
7599
|
-
this.
|
|
7596
|
+
this.message = input.required();
|
|
7597
|
+
this.messageDuration = input(9000);
|
|
7598
|
+
this.ready = output();
|
|
7599
|
+
this.dismiss = output();
|
|
7600
|
+
this.action = output();
|
|
7601
|
+
this.defaultIcons = {
|
|
7602
|
+
success: 'done-check-tracked',
|
|
7603
|
+
warning: 'warning-circle',
|
|
7604
|
+
error: 'warning',
|
|
7605
|
+
info: 'information-circle',
|
|
7606
|
+
};
|
|
7607
|
+
this.icon = computed(() => this.message().icon || this.defaultIcons[this.message().severity]);
|
|
7608
|
+
this.showClose = computed(() => {
|
|
7609
|
+
const msg = this.message();
|
|
7610
|
+
return msg.showClose !== undefined ? msg.showClose : msg.severity === 'error';
|
|
7611
|
+
});
|
|
7612
|
+
this.duration = computed(() => {
|
|
7613
|
+
const msg = this.message();
|
|
7614
|
+
if (msg.duration) {
|
|
7615
|
+
return msg.duration;
|
|
7616
|
+
}
|
|
7617
|
+
return msg.severity === 'error' ? 29000 : this.messageDuration();
|
|
7618
|
+
});
|
|
7619
|
+
this.color = computed(() => {
|
|
7620
|
+
const severity = this.message().severity;
|
|
7621
|
+
const colors = {
|
|
7622
|
+
success: 'success',
|
|
7623
|
+
warning: 'warning',
|
|
7624
|
+
error: 'danger',
|
|
7625
|
+
info: 'primary',
|
|
7626
|
+
};
|
|
7627
|
+
return colors[severity] || 'primary';
|
|
7628
|
+
});
|
|
7629
|
+
this.isTemplateRef = computed(() => this.message().message instanceof TemplateRef);
|
|
7600
7630
|
}
|
|
7601
7631
|
ngAfterViewInit() {
|
|
7602
7632
|
this.ready.emit(this);
|
|
7603
7633
|
this.cdr.markForCheck();
|
|
7604
7634
|
}
|
|
7605
7635
|
startTimer() {
|
|
7606
|
-
|
|
7607
|
-
this.messageDuration = this.message.duration;
|
|
7608
|
-
}
|
|
7609
|
-
this.timerService.start(this.messageDuration).then(() => {
|
|
7636
|
+
this.timerService.start(this.duration()).then(() => {
|
|
7610
7637
|
this.handleDismiss();
|
|
7611
7638
|
this.cdr.markForCheck();
|
|
7612
7639
|
});
|
|
@@ -7615,68 +7642,25 @@ class FwSnackbarComponent {
|
|
|
7615
7642
|
this.timerService.stop();
|
|
7616
7643
|
this.cdr.markForCheck();
|
|
7617
7644
|
}
|
|
7618
|
-
ngOnInit() {
|
|
7619
|
-
switch (this.message.severity) {
|
|
7620
|
-
case 'success':
|
|
7621
|
-
if (!this.message.icon) {
|
|
7622
|
-
this.message.icon = 'done-check-tracked';
|
|
7623
|
-
}
|
|
7624
|
-
this.color = 'success';
|
|
7625
|
-
break;
|
|
7626
|
-
case 'warning':
|
|
7627
|
-
if (!this.message.icon) {
|
|
7628
|
-
this.message.icon = 'warning-circle';
|
|
7629
|
-
}
|
|
7630
|
-
this.color = 'warning';
|
|
7631
|
-
break;
|
|
7632
|
-
case 'error':
|
|
7633
|
-
if (!this.message.icon) {
|
|
7634
|
-
this.message.icon = 'warning';
|
|
7635
|
-
}
|
|
7636
|
-
if (this.message.showClose === undefined) {
|
|
7637
|
-
this.message.showClose = true;
|
|
7638
|
-
}
|
|
7639
|
-
if (!this.message.duration) {
|
|
7640
|
-
this.message.duration = 29000;
|
|
7641
|
-
}
|
|
7642
|
-
this.color = 'danger';
|
|
7643
|
-
break;
|
|
7644
|
-
case 'info':
|
|
7645
|
-
if (!this.message.icon) {
|
|
7646
|
-
this.message.icon = 'information-circle';
|
|
7647
|
-
}
|
|
7648
|
-
this.color = 'primary';
|
|
7649
|
-
break;
|
|
7650
|
-
}
|
|
7651
|
-
}
|
|
7652
7645
|
handleDismiss() {
|
|
7653
|
-
this.dismiss.emit(this.message.id);
|
|
7646
|
+
this.dismiss.emit(this.message().id);
|
|
7654
7647
|
this.cdr.markForCheck();
|
|
7655
7648
|
}
|
|
7656
7649
|
handleAction() {
|
|
7657
|
-
this.
|
|
7658
|
-
|
|
7659
|
-
|
|
7650
|
+
const msg = this.message();
|
|
7651
|
+
this.action.emit(msg.id);
|
|
7652
|
+
if (msg.action) {
|
|
7653
|
+
msg.action();
|
|
7660
7654
|
}
|
|
7661
7655
|
this.cdr.markForCheck();
|
|
7662
7656
|
}
|
|
7663
7657
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FwSnackbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: FwSnackbarTimerService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7664
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
7658
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: FwSnackbarComponent, selector: "fw-snackbar", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, messageDuration: { classPropertyName: "messageDuration", publicName: "messageDuration", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ready: "ready", dismiss: "dismiss", action: "action" }, host: { properties: { "class": "this.cssClass" } }, providers: [FwSnackbarTimerService], ngImport: i0, template: "@if (message(); as msg) {\n @if (icon()) {\n <fw-icon>{{ icon() }}</fw-icon>\n }\n @if (isTemplateRef()) {\n <ng-container *ngTemplateOutlet=\"$any(msg.message); context: msg.templateContext\"></ng-container>\n } @else {\n @if (msg.message) {\n <h4 class=\"vision-h4\">{{ msg.message }}</h4>\n }\n }\n @if (msg.actionText) {\n <fw-button\n size=\"small\"\n variant=\"ghost\"\n [color]=\"color()\"\n (click)=\"handleAction()\"\n >\n {{ msg.actionText }}\n </fw-button>\n }\n @if (showClose()) {\n <fw-icon-button\n icon=\"close\"\n size=\"small\"\n [color]=\"msg.severity\"\n (click)=\"handleDismiss()\"\n ></fw-icon-button>\n }\n @if (!msg.actionText && !showClose()) {\n <div></div>\n }\n}\n", styles: [".vision-shadow-extra-large{box-shadow:0 8px 25px #0000001a}.vision-shadow-large,fw-snackbar{box-shadow:0 5px 15px #0000001a}.vision-shadow-medium{box-shadow:0 2px 5px #0000001a}.vision-shadow-small{box-shadow:0 1px 2px #0000000d}.vision-shadow-inner{box-shadow:0 2px 4px #00000014 inset}fw-snackbar{display:flex;align-items:flex-start;box-sizing:border-box;max-width:320px;min-width:200px;min-height:30px;padding:8px 8px 8px 16px;gap:8px;transform-origin:center;background-color:var(--card-header);color:var(--typography-base);white-space:pre-wrap;border-radius:4px;border:1px solid var(--separations-border);margin:8px}fw-snackbar>fw-icon{width:24px;height:24px;font-size:24px;white-space:nowrap;margin:3px 0}fw-snackbar h4{margin:6px 0 0;flex:1}fw-snackbar.primary fw-icon{color:var(--primary-base)}fw-snackbar.danger fw-icon{color:var(--red-base)}fw-snackbar.success fw-icon{color:var(--green-base)}fw-snackbar.warning fw-icon{color:var(--orange-base)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FwButtonComponent, selector: "fw-button", inputs: ["color", "size", "variant", "type", "disabled", "fullWidth", "leftIcon", "rightIcon"] }, { kind: "component", type: FwIconButtonComponent, selector: "fw-icon-button", inputs: ["color", "icon", "size", "disabled", "selected"] }, { kind: "component", type: FwIconComponent, selector: "fw-icon", inputs: ["size", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
7665
7659
|
}
|
|
7666
7660
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FwSnackbarComponent, decorators: [{
|
|
7667
7661
|
type: Component,
|
|
7668
|
-
args: [{ selector: 'fw-snackbar', providers: [FwSnackbarTimerService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "
|
|
7669
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: FwSnackbarTimerService }], propDecorators: {
|
|
7670
|
-
type: Input
|
|
7671
|
-
}], messageDuration: [{
|
|
7672
|
-
type: Input
|
|
7673
|
-
}], ready: [{
|
|
7674
|
-
type: Output
|
|
7675
|
-
}], dismiss: [{
|
|
7676
|
-
type: Output
|
|
7677
|
-
}], action: [{
|
|
7678
|
-
type: Output
|
|
7679
|
-
}], cssClass: [{
|
|
7662
|
+
args: [{ selector: 'fw-snackbar', providers: [FwSnackbarTimerService], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (message(); as msg) {\n @if (icon()) {\n <fw-icon>{{ icon() }}</fw-icon>\n }\n @if (isTemplateRef()) {\n <ng-container *ngTemplateOutlet=\"$any(msg.message); context: msg.templateContext\"></ng-container>\n } @else {\n @if (msg.message) {\n <h4 class=\"vision-h4\">{{ msg.message }}</h4>\n }\n }\n @if (msg.actionText) {\n <fw-button\n size=\"small\"\n variant=\"ghost\"\n [color]=\"color()\"\n (click)=\"handleAction()\"\n >\n {{ msg.actionText }}\n </fw-button>\n }\n @if (showClose()) {\n <fw-icon-button\n icon=\"close\"\n size=\"small\"\n [color]=\"msg.severity\"\n (click)=\"handleDismiss()\"\n ></fw-icon-button>\n }\n @if (!msg.actionText && !showClose()) {\n <div></div>\n }\n}\n", styles: [".vision-shadow-extra-large{box-shadow:0 8px 25px #0000001a}.vision-shadow-large,fw-snackbar{box-shadow:0 5px 15px #0000001a}.vision-shadow-medium{box-shadow:0 2px 5px #0000001a}.vision-shadow-small{box-shadow:0 1px 2px #0000000d}.vision-shadow-inner{box-shadow:0 2px 4px #00000014 inset}fw-snackbar{display:flex;align-items:flex-start;box-sizing:border-box;max-width:320px;min-width:200px;min-height:30px;padding:8px 8px 8px 16px;gap:8px;transform-origin:center;background-color:var(--card-header);color:var(--typography-base);white-space:pre-wrap;border-radius:4px;border:1px solid var(--separations-border);margin:8px}fw-snackbar>fw-icon{width:24px;height:24px;font-size:24px;white-space:nowrap;margin:3px 0}fw-snackbar h4{margin:6px 0 0;flex:1}fw-snackbar.primary fw-icon{color:var(--primary-base)}fw-snackbar.danger fw-icon{color:var(--red-base)}fw-snackbar.success fw-icon{color:var(--green-base)}fw-snackbar.warning fw-icon{color:var(--orange-base)}\n"] }]
|
|
7663
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: FwSnackbarTimerService }], propDecorators: { cssClass: [{
|
|
7680
7664
|
type: HostBinding,
|
|
7681
7665
|
args: ['class']
|
|
7682
7666
|
}] } });
|