@igo2/core 21.0.0-next.4 → 21.0.0-next.40

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.
Files changed (41) hide show
  1. package/fesm2022/igo2-core-activity.mjs +10 -10
  2. package/fesm2022/igo2-core-activity.mjs.map +1 -1
  3. package/fesm2022/igo2-core-analytics.mjs +3 -3
  4. package/fesm2022/igo2-core-analytics.mjs.map +1 -1
  5. package/fesm2022/igo2-core-auth.mjs +14 -0
  6. package/fesm2022/igo2-core-auth.mjs.map +1 -0
  7. package/fesm2022/igo2-core-config.mjs +10 -27
  8. package/fesm2022/igo2-core-config.mjs.map +1 -1
  9. package/fesm2022/igo2-core-language.mjs +14 -8
  10. package/fesm2022/igo2-core-language.mjs.map +1 -1
  11. package/fesm2022/igo2-core-media.mjs +3 -3
  12. package/fesm2022/igo2-core-media.mjs.map +1 -1
  13. package/fesm2022/igo2-core-message.mjs +340 -169
  14. package/fesm2022/igo2-core-message.mjs.map +1 -1
  15. package/fesm2022/igo2-core-monitoring.mjs.map +1 -1
  16. package/fesm2022/igo2-core-network.mjs +3 -3
  17. package/fesm2022/igo2-core-network.mjs.map +1 -1
  18. package/fesm2022/igo2-core-regex.mjs +3 -3
  19. package/fesm2022/igo2-core-regex.mjs.map +1 -1
  20. package/fesm2022/igo2-core-request.mjs +14 -14
  21. package/fesm2022/igo2-core-request.mjs.map +1 -1
  22. package/fesm2022/igo2-core-route.mjs +3 -3
  23. package/fesm2022/igo2-core-route.mjs.map +1 -1
  24. package/fesm2022/igo2-core-storage.mjs +5 -5
  25. package/fesm2022/igo2-core-storage.mjs.map +1 -1
  26. package/fesm2022/igo2-core.mjs +5 -6
  27. package/fesm2022/igo2-core.mjs.map +1 -1
  28. package/locale/en.json +1 -1
  29. package/locale/fr.json +1 -1
  30. package/package.json +6 -3
  31. package/src/style/style.scss +0 -2
  32. package/src/theming/themes/_theme.scss +0 -4
  33. package/style/all-style.css +13 -223
  34. package/style/style.css +0 -222
  35. package/theming/prebuilt-themes/blue-theme.css +0 -3
  36. package/theming/prebuilt-themes/bluedark-theme.css +0 -3
  37. package/theming/prebuilt-themes/bluedq-theme.css +0 -3
  38. package/theming/prebuilt-themes/teal-theme.css +0 -3
  39. package/types/igo2-core-auth.d.ts +15 -0
  40. package/types/igo2-core-message.d.ts +113 -28
  41. package/types/igo2-core-storage.d.ts +1 -1
@@ -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 sanitizer;
43
+ readonly removed: i0.OutputEmitterRef<number>;
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, {}, { "removed": "removed"; }, 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 };
@@ -26,7 +26,7 @@ declare enum StorageServiceEventEnum {
26
26
  declare abstract class BaseStorage<T extends StorageOptions = StorageOptions> {
27
27
  protected options?: T;
28
28
  storageChange$: BehaviorSubject<StorageServiceEvent | undefined>;
29
- constructor(config: ConfigService);
29
+ constructor(config?: ConfigService | null);
30
30
  /**
31
31
  * Use to get the data found in storage file
32
32
  */