@igo2/core 21.0.0-next.17 → 21.0.0-next.19

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/style/style.css CHANGED
@@ -1,225 +1,3 @@
1
- /* based on angular-toastr css https://github.com/Foxandxss/angular-toastr/blob/cb508fe6801d6b288d3afc525bb40fee1b101650/dist/angular-toastr.css */
2
- /* position */
3
- .toast-center-center {
4
- top: 50%;
5
- left: 50%;
6
- transform: translate(-50%, -50%);
7
- }
8
-
9
- .toast-top-center {
10
- top: 0;
11
- right: 0;
12
- width: 100%;
13
- }
14
-
15
- .toast-bottom-center {
16
- bottom: 0;
17
- right: 0;
18
- width: 100%;
19
- }
20
-
21
- .toast-top-full-width {
22
- top: 0;
23
- right: 0;
24
- width: 100%;
25
- }
26
-
27
- .toast-bottom-full-width {
28
- bottom: 0;
29
- right: 0;
30
- width: 100%;
31
- }
32
-
33
- .toast-top-left {
34
- top: 12px;
35
- left: 12px;
36
- }
37
-
38
- .toast-top-right {
39
- top: 12px;
40
- right: 12px;
41
- }
42
-
43
- .toast-bottom-right {
44
- right: 12px;
45
- bottom: 12px;
46
- }
47
-
48
- .toast-bottom-left {
49
- bottom: 12px;
50
- left: 12px;
51
- }
52
-
53
- /* toast styles */
54
- .toast-title {
55
- font-weight: bold;
56
- }
57
-
58
- .toast-message {
59
- word-wrap: break-word;
60
- }
61
-
62
- .toast-message a,
63
- .toast-message label {
64
- color: #FFFFFF;
65
- }
66
-
67
- .toast-message a:hover {
68
- color: #CCCCCC;
69
- text-decoration: none;
70
- }
71
-
72
- .toast-close-button {
73
- position: relative;
74
- right: -0.3em;
75
- top: -0.3em;
76
- float: right;
77
- font-size: 20px;
78
- font-weight: bold;
79
- color: #FFFFFF;
80
- text-shadow: 0 1px 0 #ffffff;
81
- /* opacity: 0.8; */
82
- }
83
-
84
- .toast-close-button:hover,
85
- .toast-close-button:focus {
86
- color: #000000;
87
- text-decoration: none;
88
- cursor: pointer;
89
- opacity: 0.4;
90
- }
91
-
92
- /*Additional properties for button version
93
- iOS requires the button element instead of an anchor tag.
94
- If you want the anchor version, it requires `href="#"`.*/
95
- button.toast-close-button {
96
- padding: 0;
97
- cursor: pointer;
98
- background: transparent;
99
- border: 0;
100
- }
101
-
102
- .toast-container {
103
- pointer-events: none;
104
- position: fixed;
105
- z-index: 999999;
106
- }
107
-
108
- .toast-container * {
109
- box-sizing: border-box;
110
- }
111
-
112
- .toast-container .ngx-toastr {
113
- position: relative;
114
- overflow: hidden;
115
- margin: 0 0 6px;
116
- padding: 15px 15px 15px 50px;
117
- width: 300px;
118
- border-radius: 3px 3px 3px 3px;
119
- background-position: 15px center;
120
- background-repeat: no-repeat;
121
- background-size: 24px;
122
- box-shadow: 0 0 12px #999999;
123
- color: #FFFFFF;
124
- }
125
-
126
- .toast-container .ngx-toastr:hover {
127
- box-shadow: 0 0 12px #000000;
128
- opacity: 1;
129
- cursor: pointer;
130
- }
131
-
132
- /* https://github.com/FortAwesome/Font-Awesome-Pro/blob/master/advanced-options/raw-svg/regular/info-circle.svg */
133
- .toast-info {
134
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOS4wNDMgOCA4IDExOS4wODMgOCAyNTZjMCAxMzYuOTk3IDExMS4wNDMgMjQ4IDI0OCAyNDhzMjQ4LTExMS4wMDMgMjQ4LTI0OEM1MDQgMTE5LjA4MyAzOTIuOTU3IDggMjU2IDh6bTAgMTEwYzIzLjE5NiAwIDQyIDE4LjgwNCA0MiA0MnMtMTguODA0IDQyLTQyIDQyLTQyLTE4LjgwNC00Mi00MiAxOC44MDQtNDIgNDItNDJ6bTU2IDI1NGMwIDYuNjI3LTUuMzczIDEyLTEyIDEyaC04OGMtNi42MjcgMC0xMi01LjM3My0xMi0xMnYtMjRjMC02LjYyNyA1LjM3My0xMiAxMi0xMmgxMnYtNjRoLTEyYy02LjYyNyAwLTEyLTUuMzczLTEyLTEydi0yNGMwLTYuNjI3IDUuMzczLTEyIDEyLTEyaDY0YzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MTAwaDEyYzYuNjI3IDAgMTIgNS4zNzMgMTIgMTJ2MjR6Jy8+PC9zdmc+");
135
- }
136
-
137
- /* https://github.com/FortAwesome/Font-Awesome-Pro/blob/master/advanced-options/raw-svg/regular/times-circle.svg */
138
- .toast-error {
139
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTI1NiA4QzExOSA4IDggMTE5IDggMjU2czExMSAyNDggMjQ4IDI0OCAyNDgtMTExIDI0OC0yNDhTMzkzIDggMjU2IDh6bTEyMS42IDMxMy4xYzQuNyA0LjcgNC43IDEyLjMgMCAxN0wzMzggMzc3LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwyNTYgMzEybC02NS4xIDY1LjZjLTQuNyA0LjctMTIuMyA0LjctMTcgMEwxMzQuNCAzMzhjLTQuNy00LjctNC43LTEyLjMgMC0xN2w2NS42LTY1LTY1LjYtNjUuMWMtNC43LTQuNy00LjctMTIuMyAwLTE3bDM5LjYtMzkuNmM0LjctNC43IDEyLjMtNC43IDE3IDBsNjUgNjUuNyA2NS4xLTY1LjZjNC43LTQuNyAxMi4zLTQuNyAxNyAwbDM5LjYgMzkuNmM0LjcgNC43IDQuNyAxMi4zIDAgMTdMMzEyIDI1Nmw2NS42IDY1LjF6Jy8+PC9zdmc+");
140
- }
141
-
142
- /* https://github.com/FortAwesome/Font-Awesome-Pro/blob/master/advanced-options/raw-svg/regular/check.svg */
143
- .toast-success {
144
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1MTIgNTEyJyB3aWR0aD0nNTEyJyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTE3My44OTggNDM5LjQwNGwtMTY2LjQtMTY2LjRjLTkuOTk3LTkuOTk3LTkuOTk3LTI2LjIwNiAwLTM2LjIwNGwzNi4yMDMtMzYuMjA0YzkuOTk3LTkuOTk4IDI2LjIwNy05Ljk5OCAzNi4yMDQgMEwxOTIgMzEyLjY5IDQzMi4wOTUgNzIuNTk2YzkuOTk3LTkuOTk3IDI2LjIwNy05Ljk5NyAzNi4yMDQgMGwzNi4yMDMgMzYuMjA0YzkuOTk3IDkuOTk3IDkuOTk3IDI2LjIwNiAwIDM2LjIwNGwtMjk0LjQgMjk0LjQwMWMtOS45OTggOS45OTctMjYuMjA3IDkuOTk3LTM2LjIwNC0uMDAxeicvPjwvc3ZnPg==");
145
- }
146
-
147
- /* https://github.com/FortAwesome/Font-Awesome-Pro/blob/master/advanced-options/raw-svg/regular/exclamation-triangle.svg */
148
- .toast-warning {
149
- background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA1NzYgNTEyJyB3aWR0aD0nNTc2JyBoZWlnaHQ9JzUxMic+PHBhdGggZmlsbD0ncmdiKDI1NSwyNTUsMjU1KScgZD0nTTU2OS41MTcgNDQwLjAxM0M1ODcuOTc1IDQ3Mi4wMDcgNTY0LjgwNiA1MTIgNTI3Ljk0IDUxMkg0OC4wNTRjLTM2LjkzNyAwLTU5Ljk5OS00MC4wNTUtNDEuNTc3LTcxLjk4N0wyNDYuNDIzIDIzLjk4NWMxOC40NjctMzIuMDA5IDY0LjcyLTMxLjk1MSA4My4xNTQgMGwyMzkuOTQgNDE2LjAyOHpNMjg4IDM1NGMtMjUuNDA1IDAtNDYgMjAuNTk1LTQ2IDQ2czIwLjU5NSA0NiA0NiA0NiA0Ni0yMC41OTUgNDYtNDYtMjAuNTk1LTQ2LTQ2LTQ2em0tNDMuNjczLTE2NS4zNDZsNy40MTggMTM2Yy4zNDcgNi4zNjQgNS42MDkgMTEuMzQ2IDExLjk4MiAxMS4zNDZoNDguNTQ2YzYuMzczIDAgMTEuNjM1LTQuOTgyIDExLjk4Mi0xMS4zNDZsNy40MTgtMTM2Yy4zNzUtNi44NzQtNS4wOTgtMTIuNjU0LTExLjk4Mi0xMi42NTRoLTYzLjM4M2MtNi44ODQgMC0xMi4zNTYgNS43OC0xMS45ODEgMTIuNjU0eicvPjwvc3ZnPg==");
150
- }
151
-
152
- .toast-container.toast-top-center .ngx-toastr,
153
- .toast-container.toast-bottom-center .ngx-toastr {
154
- width: 300px;
155
- margin-left: auto;
156
- margin-right: auto;
157
- }
158
-
159
- .toast-container.toast-top-full-width .ngx-toastr,
160
- .toast-container.toast-bottom-full-width .ngx-toastr {
161
- width: 96%;
162
- margin-left: auto;
163
- margin-right: auto;
164
- }
165
-
166
- .ngx-toastr {
167
- background-color: #030303;
168
- pointer-events: auto;
169
- }
170
-
171
- .toast-success {
172
- background-color: #51A351;
173
- }
174
-
175
- .toast-error {
176
- background-color: #BD362F;
177
- }
178
-
179
- .toast-info {
180
- background-color: #2F96B4;
181
- }
182
-
183
- .toast-warning {
184
- background-color: #F89406;
185
- }
186
-
187
- .toast-progress {
188
- position: absolute;
189
- left: 0;
190
- bottom: 0;
191
- height: 4px;
192
- background-color: #000000;
193
- opacity: 0.4;
194
- }
195
-
196
- /* Responsive Design */
197
- @media all and (max-width: 240px) {
198
- .toast-container .ngx-toastr.div {
199
- padding: 8px 8px 8px 50px;
200
- width: 11em;
201
- }
202
- .toast-container .toast-close-button {
203
- right: -0.2em;
204
- top: -0.2em;
205
- }
206
- }
207
- @media all and (min-width: 241px) and (max-width: 480px) {
208
- .toast-container .ngx-toastr.div {
209
- padding: 8px 8px 8px 50px;
210
- width: 18em;
211
- }
212
- .toast-container .toast-close-button {
213
- right: -0.2em;
214
- top: -0.2em;
215
- }
216
- }
217
- @media all and (min-width: 481px) and (max-width: 768px) {
218
- .toast-container .ngx-toastr.div {
219
- padding: 15px 15px 15px 50px;
220
- width: 25em;
221
- }
222
- }
223
1
  button.mat-mdc-menu-item {
224
2
  line-height: 24px !important;
225
3
  }
@@ -198,9 +198,6 @@ html .blue-theme mat-icon[igocollapse].igo-chevron.collapsed {
198
198
  transform: rotateZ(180deg);
199
199
  transition: 300ms ease-in-out;
200
200
  }
201
- html .blue-theme .toastr-message-title {
202
- font-size: var(--sdg-font-size-h5);
203
- }
204
201
  html .blue-theme {
205
202
  --mat-sys-background: light-dark(#ffffff, #101319);
206
203
  --mat-sys-error: light-dark(#f44336, #ffb4ab);
@@ -198,9 +198,6 @@ html .bluedark-theme mat-icon[igocollapse].igo-chevron.collapsed {
198
198
  transform: rotateZ(180deg);
199
199
  transition: 300ms ease-in-out;
200
200
  }
201
- html .bluedark-theme .toastr-message-title {
202
- font-size: var(--sdg-font-size-h5);
203
- }
204
201
  html .bluedark-theme {
205
202
  --mat-sys-background: light-dark(#f9f9fb, #111415);
206
203
  --mat-sys-error: light-dark(#f44336, #ffb4ab);
@@ -198,9 +198,6 @@ html .bluedq-theme mat-icon[igocollapse].igo-chevron.collapsed {
198
198
  transform: rotateZ(180deg);
199
199
  transition: 300ms ease-in-out;
200
200
  }
201
- html .bluedq-theme .toastr-message-title {
202
- font-size: var(--sdg-font-size-h5);
203
- }
204
201
  html .bluedq-theme {
205
202
  --mat-sys-background: light-dark(#f8f9ff, #111418);
206
203
  --mat-sys-error: light-dark(#f44336, #ffb4ab);
@@ -198,9 +198,6 @@ html .teal-theme mat-icon[igocollapse].igo-chevron.collapsed {
198
198
  transform: rotateZ(180deg);
199
199
  transition: 300ms ease-in-out;
200
200
  }
201
- html .teal-theme .toastr-message-title {
202
- font-size: var(--sdg-font-size-h5);
203
- }
204
201
  html .teal-theme {
205
202
  --mat-sys-background: light-dark(#f6faf8, #0f1413);
206
203
  --mat-sys-error: light-dark(#f44336, #ffb4ab);
@@ -1,32 +1,113 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ModuleWithProviders, TemplateRef, EnvironmentProviders } from '@angular/core';
3
- import { IndividualConfig, ActiveToast } from 'ngx-toastr';
2
+ import { OnInit, OnDestroy, EnvironmentProviders } from '@angular/core';
4
3
  import { HttpErrorResponse } from '@angular/common/http';
5
4
  import { BehaviorSubject } from 'rxjs';
6
-
7
- /**
8
- * @deprecated import the provideMessage directly
9
- */
10
- declare class IgoMessageModule {
11
- static forRoot(): ModuleWithProviders<IgoMessageModule>;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<IgoMessageModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<IgoMessageModule, never, never, never>;
14
- static ɵinj: i0.ɵɵInjectorDeclaration<IgoMessageModule>;
15
- }
5
+ import { SafeHtml } from '@angular/platform-browser';
16
6
 
17
7
  declare enum MessageType {
18
8
  ERROR = "error",
19
- ALERT = "warning",// todo delete (transition to ngx-toastr)
9
+ ALERT = "warning",
20
10
  WARNING = "warning",
21
11
  INFO = "info",
22
12
  SUCCESS = "success",
23
13
  SHOW = "show"
24
14
  }
25
15
 
16
+ interface ToastConfig {
17
+ timeOut: number;
18
+ extendedTimeOut: number;
19
+ closeButton: boolean;
20
+ progressBar: boolean;
21
+ tapToDismiss: boolean;
22
+ positionClass: string;
23
+ maxOpened: number;
24
+ preventDuplicates: boolean;
25
+ enableHtml: boolean;
26
+ disableTimeOut: boolean;
27
+ showIcon: boolean;
28
+ freezeProgressOnHover: boolean;
29
+ }
30
+ type IndividualToastConfig = Partial<ToastConfig>;
31
+ interface ToastRef {
32
+ toastId: number;
33
+ message: string;
34
+ title: string;
35
+ type: ToastType;
36
+ config: ToastConfig;
37
+ }
38
+ type ToastType = 'success' | 'error' | 'info' | 'warning' | 'show';
39
+ declare const DEFAULT_TOAST_CONFIG: ToastConfig;
40
+
41
+ declare class ToastComponent implements OnInit, OnDestroy {
42
+ private toastService;
43
+ private sanitizer;
44
+ toastId: number;
45
+ type: ToastType;
46
+ title: string;
47
+ config: ToastConfig;
48
+ enableHtml: boolean;
49
+ showIcon: boolean;
50
+ private _message;
51
+ safeMessage: SafeHtml;
52
+ get message(): string;
53
+ set message(value: string);
54
+ progress: i0.WritableSignal<number>;
55
+ animationState: i0.WritableSignal<"inactive" | "active" | "removed">;
56
+ private timeoutId;
57
+ private progressIntervalId;
58
+ private startTime;
59
+ private remainingTime;
60
+ private totalTimeOut;
61
+ ngOnInit(): void;
62
+ ngOnDestroy(): void;
63
+ onEnter(): void;
64
+ onLeave(): void;
65
+ onTap(): void;
66
+ close(event: Event): void;
67
+ remove(): void;
68
+ private startTimer;
69
+ private clearTimers;
70
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastComponent, never>;
71
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToastComponent, "igo-toast", never, {}, {}, never, never, true, never>;
72
+ }
73
+
74
+ declare class ToastContainerComponent {
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastContainerComponent, never>;
76
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToastContainerComponent, "igo-toast-container", never, {}, {}, never, ["*"], true, never>;
77
+ }
78
+
79
+ interface ActiveToast {
80
+ toastId: number;
81
+ }
82
+ declare class ToastService {
83
+ private appRef;
84
+ private document;
85
+ private toastIdCounter;
86
+ private toasts;
87
+ private containerRef;
88
+ private config;
89
+ private lastMessage;
90
+ private lastTitle;
91
+ configure(config: Partial<ToastConfig>): void;
92
+ success(message: string, title: string, options?: IndividualToastConfig): ActiveToast;
93
+ error(message: string, title: string, options?: IndividualToastConfig): ActiveToast;
94
+ info(message: string, title: string, options?: IndividualToastConfig): ActiveToast;
95
+ warning(message: string, title: string, options?: IndividualToastConfig): ActiveToast;
96
+ remove(toastId: number): void;
97
+ /** Called by ToastComponent when removal animation completes */
98
+ removeToast(toastId: number): void;
99
+ getActiveToasts(): ToastRef[];
100
+ updateToast(toastId: number, message: string, title: string): void;
101
+ private show;
102
+ private getOrCreateContainer;
103
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
104
+ static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
105
+ }
106
+
26
107
  interface Message {
27
108
  title?: string;
28
109
  text: string;
29
- html?: string | TemplateRef<unknown>;
110
+ html?: string;
30
111
  type: MessageType;
31
112
  options?: MessageOptions;
32
113
  format?: 'text' | 'html';
@@ -34,7 +115,7 @@ interface Message {
34
115
  titleInterpolateParams?: Record<string, unknown>;
35
116
  showIcon?: boolean;
36
117
  }
37
- interface MessageOptions extends IndividualConfig {
118
+ interface MessageOptions extends IndividualToastConfig {
38
119
  template?: string;
39
120
  from?: Date | string;
40
121
  to?: Date | string;
@@ -42,25 +123,29 @@ interface MessageOptions extends IndividualConfig {
42
123
  showOnEachLayerVisibility?: boolean;
43
124
  }
44
125
 
45
- declare function provideMessage(): EnvironmentProviders;
126
+ /**
127
+ * Provides the message service with custom toast configuration.
128
+ * Since ToastService is providedIn: 'root', this simply configures it.
129
+ */
130
+ declare function provideMessage(config?: Partial<ToastConfig>): EnvironmentProviders;
46
131
 
47
132
  declare class MessageService {
48
- private injector;
49
133
  private configService;
50
134
  private languageService;
135
+ private toastService;
51
136
  messages$: BehaviorSubject<Message[]>;
52
137
  private options?;
53
- private activeMessageTranslations;
54
138
  constructor();
55
- private get toastr();
56
- showError(httpError: HttpErrorResponse): ActiveToast<any>;
139
+ showError(httpError: HttpErrorResponse): ActiveToast;
57
140
  message(message: Message): void;
58
- success(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast<any>;
59
- error(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast<any>;
60
- info(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast<any>;
61
- alert(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast<any>;
62
- show(text: string, title?: string, options?: Partial<IndividualConfig>, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast<any>;
63
- private handleNgxToastr;
141
+ success(text: string, title?: string, options?: IndividualToastConfig, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast;
142
+ error(text: string, title?: string, options?: IndividualToastConfig, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast;
143
+ info(text: string, title?: string, options?: IndividualToastConfig, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast;
144
+ alert(text: string, title?: string, options?: IndividualToastConfig, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast;
145
+ show(text: string, title?: string, options?: IndividualToastConfig, textInterpolateParams?: Record<string, unknown>, titleInterpolateParams?: Record<string, unknown>): ActiveToast;
146
+ private handleToast;
147
+ private parseDate;
148
+ private translateInterpolateParams;
64
149
  remove(id: number): void;
65
150
  removeAllAreNotError(): void;
66
151
  private handleTemplate;
@@ -68,5 +153,5 @@ declare class MessageService {
68
153
  static ɵprov: i0.ɵɵInjectableDeclaration<MessageService>;
69
154
  }
70
155
 
71
- export { IgoMessageModule, MessageService, MessageType, provideMessage };
72
- export type { Message, MessageOptions };
156
+ export { DEFAULT_TOAST_CONFIG, MessageService, MessageType, ToastComponent, ToastContainerComponent, ToastService, provideMessage };
157
+ export type { ActiveToast, IndividualToastConfig, Message, MessageOptions, ToastConfig, ToastRef, ToastType };