@acorex/components 18.12.39 → 18.12.41
Sign up to get free protection for your applications and to get access to all the features.
- package/dialog/lib/dialog.component.d.ts +11 -11
- package/dialog/lib/dialog.service.d.ts +2 -2
- package/esm2022/common/lib/types/placement.mjs +8 -2
- package/esm2022/datetime-picker/lib/datetime-picker.component.mjs +3 -3
- package/esm2022/dialog/lib/dialog.component.mjs +12 -12
- package/esm2022/dialog/lib/dialog.service.mjs +5 -5
- package/esm2022/form/lib/validation-rule.directive.mjs +1 -1
- package/esm2022/notification/lib/notification.component.mjs +4 -4
- package/esm2022/notification/lib/notification.config.mjs +2 -1
- package/esm2022/notification/lib/notification.service.mjs +137 -39
- package/esm2022/toast/lib/toast.component.mjs +2 -2
- package/esm2022/toast/lib/toast.config.mjs +2 -1
- package/esm2022/toast/lib/toast.service.mjs +140 -36
- package/fesm2022/acorex-components-common.mjs +7 -1
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +2 -2
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +15 -15
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +139 -40
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +140 -35
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/form/lib/validation-rule.directive.d.ts +1 -1
- package/notification/lib/notification.component.d.ts +3 -3
- package/notification/lib/notification.config.d.ts +1 -0
- package/notification/lib/notification.service.d.ts +13 -0
- package/package.json +1 -1
- package/toast/lib/toast.component.d.ts +1 -1
- package/toast/lib/toast.config.d.ts +1 -0
- package/toast/lib/toast.service.d.ts +13 -0
@@ -2,7 +2,7 @@ import { MXBaseComponent, AXClosbaleComponent } from '@acorex/components/common'
|
|
2
2
|
import * as i1 from '@angular/cdk/dialog';
|
3
3
|
import { DIALOG_DATA, Dialog, DialogModule } from '@angular/cdk/dialog';
|
4
4
|
import * as i0 from '@angular/core';
|
5
|
-
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, HostBinding, InjectionToken, inject, Injectable, NgModule } from '@angular/core';
|
5
|
+
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, HostBinding, InjectionToken, inject, signal, effect, Injectable, NgModule } from '@angular/core';
|
6
6
|
import * as i2 from '@acorex/components/decorators';
|
7
7
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
8
8
|
import * as i3 from '@angular/common';
|
@@ -107,6 +107,7 @@ const AXToastDefaultConfig = {
|
|
107
107
|
timeOut: 2500,
|
108
108
|
timeOutProgress: true,
|
109
109
|
location: 'bottom-center',
|
110
|
+
limit: 3,
|
110
111
|
};
|
111
112
|
function toastConfig(config = {}) {
|
112
113
|
const result = {
|
@@ -121,8 +122,22 @@ class AXToastService {
|
|
121
122
|
this.scrollStrategyOptions = scrollStrategyOptions;
|
122
123
|
this.dialog = inject(Dialog);
|
123
124
|
this.defaultConfig = inject(AX_TOAST_CONFIG);
|
125
|
+
this.activeToasts = signal([]);
|
126
|
+
this.reservedToasts = signal([]);
|
127
|
+
this.toastCounterElement = signal(null);
|
128
|
+
this.moreToastsColor = signal('primary');
|
129
|
+
this.moreToastsLocation = signal('bottom-center');
|
130
|
+
this.reserveCounter = signal(0);
|
131
|
+
this.#effect = effect(() => {
|
132
|
+
if (this.defaultConfig.limit <= 0)
|
133
|
+
return;
|
134
|
+
this.handleShowReservedToast();
|
135
|
+
this.handleShowReservedToastCounter();
|
136
|
+
this.handleReserveCounter();
|
137
|
+
}, { allowSignalWrites: true });
|
124
138
|
this.scrollStrategy = this.scrollStrategyOptions.noop();
|
125
139
|
}
|
140
|
+
#effect;
|
126
141
|
primary(content) {
|
127
142
|
this.show({
|
128
143
|
timeOut: this.defaultConfig.timeOut,
|
@@ -163,35 +178,21 @@ class AXToastService {
|
|
163
178
|
closeButton: true,
|
164
179
|
location: this.defaultConfig.location ?? 'bottom-center',
|
165
180
|
}, config);
|
181
|
+
this.moreToastsColor.set(opt.color);
|
182
|
+
this.moreToastsLocation.set(opt.location);
|
183
|
+
if (this.defaultConfig.limit > 0) {
|
184
|
+
if (this.activeToasts().length >= this.defaultConfig.limit) {
|
185
|
+
this.reservedToasts.update((value) => [...value, opt]);
|
186
|
+
return {
|
187
|
+
close: () => {
|
188
|
+
//TODO close reserved toast
|
189
|
+
},
|
190
|
+
};
|
191
|
+
}
|
192
|
+
}
|
166
193
|
const gap = this.defaultConfig.gap;
|
167
|
-
let positionStrategy = new GlobalPositionStrategy();
|
168
194
|
const pos = this.getPosition(opt.location) + gap + 'px';
|
169
|
-
|
170
|
-
case 'bottom-center':
|
171
|
-
positionStrategy = positionStrategy.bottom(pos).centerHorizontally();
|
172
|
-
break;
|
173
|
-
case 'bottom-end':
|
174
|
-
positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');
|
175
|
-
break;
|
176
|
-
case 'bottom-start':
|
177
|
-
positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');
|
178
|
-
break;
|
179
|
-
case 'top-center':
|
180
|
-
positionStrategy = positionStrategy.top(pos).centerHorizontally();
|
181
|
-
break;
|
182
|
-
case 'top-end':
|
183
|
-
positionStrategy = positionStrategy.top(pos).right(gap + 'px');
|
184
|
-
break;
|
185
|
-
case 'top-start':
|
186
|
-
positionStrategy = positionStrategy.top(pos).left(gap + 'px');
|
187
|
-
break;
|
188
|
-
case 'center-start':
|
189
|
-
positionStrategy = positionStrategy.centerVertically().left(gap + 'px');
|
190
|
-
break;
|
191
|
-
case 'center-end':
|
192
|
-
positionStrategy = positionStrategy.centerVertically().right(gap + 'px');
|
193
|
-
break;
|
194
|
-
}
|
195
|
+
const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);
|
195
196
|
const dialogRef = this.dialog.open(AXToastComponent, {
|
196
197
|
data: opt,
|
197
198
|
autoFocus: '__no_element__',
|
@@ -202,12 +203,16 @@ class AXToastService {
|
|
202
203
|
closeOnDestroy: true,
|
203
204
|
hasBackdrop: false,
|
204
205
|
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
205
|
-
positionStrategy
|
206
|
+
positionStrategy,
|
206
207
|
scrollStrategy: this.scrollStrategy,
|
207
208
|
});
|
209
|
+
this.activeToasts.update((value) => [...value, dialogRef.id]);
|
208
210
|
const toastRef = dialogRef.componentInstance;
|
209
211
|
dialogRef.closed.subscribe(() => {
|
210
|
-
this.
|
212
|
+
this.activeToasts.update((value) => [...value].filter((dialogID) => dialogID !== dialogRef.id));
|
213
|
+
setTimeout(() => {
|
214
|
+
this.reposition(opt.location, gap);
|
215
|
+
}, 0);
|
211
216
|
});
|
212
217
|
return {
|
213
218
|
close: () => {
|
@@ -218,18 +223,118 @@ class AXToastService {
|
|
218
223
|
hideAll() {
|
219
224
|
this.dialog.closeAll();
|
220
225
|
}
|
221
|
-
|
222
|
-
|
226
|
+
handleShowReservedToast() {
|
227
|
+
if (this.activeToasts().length > this.defaultConfig.limit - 1)
|
228
|
+
return;
|
229
|
+
if (!this.reservedToasts().length)
|
230
|
+
return;
|
231
|
+
this.show(this.reservedToasts()[0]);
|
232
|
+
this.reservedToasts.update((value) => {
|
233
|
+
const toasts = [...value];
|
234
|
+
toasts.shift();
|
235
|
+
return toasts;
|
236
|
+
});
|
237
|
+
}
|
238
|
+
handleShowReservedToastCounter() {
|
239
|
+
if (this.reservedToasts().length === this.reserveCounter())
|
240
|
+
return;
|
241
|
+
this.reserveCounter.set(this.reservedToasts().length);
|
242
|
+
if (this.toastCounterElement() !== null)
|
243
|
+
this.toastCounterElement().close();
|
244
|
+
this.createReservedCounterToast();
|
245
|
+
}
|
246
|
+
handleReserveCounter() {
|
247
|
+
if (this.reserveCounter() !== 0)
|
248
|
+
return;
|
249
|
+
if (this.toastCounterElement() === null)
|
250
|
+
return;
|
251
|
+
this.toastCounterElement().close();
|
252
|
+
}
|
253
|
+
createReservedCounterToast() {
|
254
|
+
const opt = {
|
255
|
+
closeButton: false,
|
256
|
+
color: this.moreToastsColor(),
|
257
|
+
location: this.moreToastsLocation(),
|
258
|
+
title: `And ${this.reserveCounter()} more...`,
|
259
|
+
timeOutProgress: false,
|
260
|
+
};
|
261
|
+
const gap = this.defaultConfig.gap;
|
262
|
+
const pos = this.getPosition(opt.location) + gap + 'px';
|
263
|
+
const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);
|
264
|
+
const dialogRef = this.dialog.open(AXToastComponent, {
|
265
|
+
data: opt,
|
266
|
+
autoFocus: '__no_element__',
|
267
|
+
restoreFocus: true,
|
268
|
+
role: 'dialog',
|
269
|
+
ariaModal: true,
|
270
|
+
closeOnNavigation: true,
|
271
|
+
closeOnDestroy: true,
|
272
|
+
hasBackdrop: false,
|
273
|
+
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
274
|
+
positionStrategy,
|
275
|
+
scrollStrategy: this.scrollStrategy,
|
276
|
+
});
|
277
|
+
this.toastCounterElement.set(dialogRef.componentInstance);
|
278
|
+
}
|
279
|
+
reposition(toastLocation, gap) {
|
280
|
+
const list = this.dialog.openDialogs
|
281
|
+
.map((c) => c.componentInstance)
|
282
|
+
.filter((c) => c.config?.location == toastLocation);
|
283
|
+
list.forEach((element, index) => {
|
284
|
+
const pos = this.getRepositionPosition(index, gap, list, toastLocation);
|
285
|
+
console.log(index, element);
|
286
|
+
this.getPositionStrategy(element.dialogRef.config.positionStrategy, toastLocation, pos, gap).apply();
|
287
|
+
});
|
288
|
+
}
|
289
|
+
getRepositionPosition(index, gap, list, toastLocation) {
|
290
|
+
if (index === 0)
|
291
|
+
return gap + 'px';
|
292
|
+
const previouseElement = list[index - 1];
|
293
|
+
if (toastLocation.split('-')[0] == 'bottom') {
|
294
|
+
return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';
|
295
|
+
}
|
296
|
+
return (previouseElement.getHostElement().offsetTop +
|
297
|
+
previouseElement.getHostElement().offsetHeight +
|
298
|
+
gap +
|
299
|
+
'px');
|
223
300
|
}
|
224
301
|
getPosition(location) {
|
225
|
-
const list = this.dialog.openDialogs
|
302
|
+
const list = this.dialog.openDialogs
|
303
|
+
.map((c) => c.componentInstance)
|
304
|
+
.filter((c) => c.config?.location == location);
|
226
305
|
if (list.length == 0)
|
227
306
|
return 0;
|
228
307
|
if (location.split('-')[0] == 'bottom') {
|
229
308
|
return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;
|
230
309
|
}
|
231
|
-
|
232
|
-
|
310
|
+
return (list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight);
|
311
|
+
}
|
312
|
+
getPositionStrategy(positionStrategy, location, pos, gap) {
|
313
|
+
switch (location) {
|
314
|
+
case 'bottom-center':
|
315
|
+
return positionStrategy.bottom(pos).centerHorizontally();
|
316
|
+
break;
|
317
|
+
case 'bottom-end':
|
318
|
+
return positionStrategy.bottom(pos).right(gap + 'px');
|
319
|
+
break;
|
320
|
+
case 'bottom-start':
|
321
|
+
return positionStrategy.bottom(pos).left(gap + 'px');
|
322
|
+
break;
|
323
|
+
case 'top-center':
|
324
|
+
return positionStrategy.top(pos).centerHorizontally();
|
325
|
+
break;
|
326
|
+
case 'top-end':
|
327
|
+
return positionStrategy.top(pos).right(gap + 'px');
|
328
|
+
break;
|
329
|
+
case 'top-start':
|
330
|
+
return positionStrategy.top(pos).left(gap + 'px');
|
331
|
+
break;
|
332
|
+
case 'center-start':
|
333
|
+
return positionStrategy.centerVertically().left(gap + 'px');
|
334
|
+
break;
|
335
|
+
case 'center-end':
|
336
|
+
return positionStrategy.centerVertically().right(gap + 'px');
|
337
|
+
break;
|
233
338
|
}
|
234
339
|
}
|
235
340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXToastService, deps: [{ token: i1$1.ScrollStrategyOptions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../libs/components/toast/src/lib/toast.component.ts","../../../../libs/components/toast/src/lib/toast.component.html","../../../../libs/components/toast/src/lib/toast.config.ts","../../../../libs/components/toast/src/lib/toast.service.ts","../../../../libs/components/toast/src/lib/toast.module.ts","../../../../libs/components/toast/src/acorex-components-toast.ts"],"sourcesContent":["import { AXButtonItem } from '@acorex/components/button';\nimport { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport { ChangeDetectionStrategy, Component, HostBinding, Inject, OnInit, ViewEncapsulation } from '@angular/core';\nimport { AXToastData } from './toast.class';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\n})\nexport class AXToastComponent extends MXBaseComponent implements OnInit {\n /** @ignore */\n protected _toastWidth = 100;\n\n /** @ignore */\n protected _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXToastData,\n private dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n if (this.config.timeOut) {\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\n if (!this.config.icon) {\n switch (this.config.color) {\n case 'success':\n this._icon = 'ax-icon ax-icon-check-circle';\n break;\n case 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n case 'info':\n this._icon = 'ax-icon ax-icon-info';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-check-circle';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n _handleButtonClick(button: AXButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-${this.config.color}`;\n }\n\n /** @ignore */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n}\n","<span class=\"ax-toast-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-toast-content\">\n <div class=\"ax-toast-title\" [class.ax-mb-2]=\"config.title && config.content\">{{ config.title | translate | async }}\n </div>\n <div class=\"ax-toast-content\" [innerHTML]=\"config.content\"></div>\n</div>\n@if(config.closeButton){\n<ax-close-button></ax-close-button>\n}\n@if(config.timeOutProgress && config.timeOut){\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\n}","import { AXLocation } from '@acorex/components/common';\nimport { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXToastConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n}\n\nexport const AX_TOAST_CONFIG = new InjectionToken<AXToastConfig>('AX_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.toast', AX_TOAST_CONFIG);\n return AXToastDefaultConfig;\n },\n});\n\nexport const AXToastDefaultConfig: AXToastConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n location: 'bottom-center',\n};\n\nexport type PartialToastConfig = Partial<AXToastConfig>;\n\nexport function toastConfig(config: PartialToastConfig = {}): AXToastConfig {\n const result = {\n ...AXToastDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy, ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { Injectable, inject } from '@angular/core';\nimport { AXToastDisplayConfig, AXToastRef } from './toast.class';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastConfig, AX_TOAST_CONFIG } from './toast.config';\n\n@Injectable()\nexport class AXToastService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXToastConfig = inject(AX_TOAST_CONFIG);\n\n scrollStrategy: ScrollStrategy;\n\n constructor(private readonly scrollStrategyOptions: ScrollStrategyOptions) {\n this.scrollStrategy = this.scrollStrategyOptions.noop();\n }\n primary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'primary',\n content: content,\n });\n }\n secondary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'secondary',\n content: content,\n });\n }\n success(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'success',\n content: content,\n });\n }\n\n warning(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'warning',\n content: content,\n });\n }\n danger(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'danger',\n content: content,\n });\n }\n show(config: AXToastDisplayConfig): AXToastRef {\n const opt = Object.assign(\n {\n closeButton: true,\n location: this.defaultConfig.location ?? 'bottom-center',\n },\n config,\n );\n const gap = this.defaultConfig.gap;\n\n let positionStrategy = new GlobalPositionStrategy();\n const pos = this.getPosition(opt.location) + gap + 'px';\n switch (opt.location) {\n case 'bottom-center':\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n positionStrategy = positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\n break;\n }\n\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: opt,\n autoFocus: '__no_element__',\n restoreFocus: true,\n role: 'dialog',\n ariaModal: true,\n closeOnNavigation: true,\n closeOnDestroy: true,\n hasBackdrop: false,\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\n positionStrategy: positionStrategy,\n scrollStrategy: this.scrollStrategy,\n });\n\n const toastRef = dialogRef.componentInstance as AXToastComponent;\n dialogRef.closed.subscribe(() => {\n this.reposition();\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n public hideAll() {\n this.dialog.closeAll();\n }\n\n private reposition(): void {\n //TODO: reposition vertically afer close toast\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs.map((c) => c.componentInstance as AXToastComponent).filter((c) => c.config?.location == location);\n if (list.length == 0) return 0;\n if (location.split('-')[0] == 'bottom') {\n return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;\n } else {\n return list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight;\n }\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { DialogModule } from '@angular/cdk/dialog';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastService } from './toast.service';\n\nconst COMPONENT = [AXToastComponent];\nconst MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXToastService],\n})\nexport class AXToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;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,EAAA,CAAA,gBAAgB,CAClB,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,aADjG,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAStB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,EAFb,SAAA,EAAA,CAAC,cAAc,CAAC,YAFd,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;oBACvB,SAAS,EAAE,CAAC,cAAc,CAAC;AAC5B,iBAAA;;;AClBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../libs/components/toast/src/lib/toast.component.ts","../../../../libs/components/toast/src/lib/toast.component.html","../../../../libs/components/toast/src/lib/toast.config.ts","../../../../libs/components/toast/src/lib/toast.service.ts","../../../../libs/components/toast/src/lib/toast.module.ts","../../../../libs/components/toast/src/acorex-components-toast.ts"],"sourcesContent":["import { AXButtonItem } from '@acorex/components/button';\nimport { AXClosbaleComponent, AXComponentCloseEvent, MXBaseComponent } from '@acorex/components/common';\nimport { DIALOG_DATA, DialogRef } from '@angular/cdk/dialog';\nimport {\n ChangeDetectionStrategy,\n Component,\n HostBinding,\n Inject,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXToastData } from './toast.class';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category Components\n */\n@Component({\n selector: 'ax-toast',\n templateUrl: './toast.component.html',\n styleUrls: ['./toast.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\n})\nexport class AXToastComponent extends MXBaseComponent implements OnInit {\n /** @ignore */\n protected _toastWidth = 100;\n\n /** @ignore */\n protected _icon: string;\n\n /**\n * @ignore\n */\n constructor(\n @Inject(DIALOG_DATA)\n public config: AXToastData,\n public dialogRef: DialogRef<AXComponentCloseEvent>,\n ) {\n super();\n }\n\n /** @ignore */\n override ngOnInit() {\n super.ngOnInit();\n if (this.config.timeOut) {\n setTimeout(() => {\n this.close();\n }, this.config.timeOut);\n }\n if (!this.config.icon) {\n switch (this.config.color) {\n case 'success':\n this._icon = 'ax-icon ax-icon-check-circle';\n break;\n case 'warning':\n this._icon = 'ax-icon ax-icon-warning';\n break;\n case 'danger':\n this._icon = 'ax-icon ax-icon-error';\n break;\n case 'info':\n this._icon = 'ax-icon ax-icon-info';\n break;\n default:\n this._icon = this.config.icon || 'ax-icon ax-icon-check-circle';\n break;\n }\n } else {\n this._icon = this.config.icon;\n }\n }\n\n /** @ignore */\n _handleButtonClick(button: AXButtonItem) {\n if (button.onClick) {\n button.onClick({ source: button });\n }\n }\n\n /** @ignore */\n @HostBinding('class')\n private get __hostClass(): string {\n return `ax-${this.config.color}`;\n }\n\n /** @ignore */\n close() {\n this.dialogRef.close({\n component: this,\n htmlElement: this.getHostElement(),\n });\n }\n}\n","<span class=\"ax-toast-icon ax-icon-solid {{ _icon }}\"></span>\n<div class=\"ax-toast-content\">\n <div class=\"ax-toast-title\" [class.ax-mb-2]=\"config.title && config.content\">{{ config.title | translate | async }}\n </div>\n <div class=\"ax-toast-content\" [innerHTML]=\"config.content\"></div>\n</div>\n@if(config.closeButton){\n<ax-close-button></ax-close-button>\n}\n@if(config.timeOutProgress && config.timeOut){\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"config.timeOut\"></div>\n}","import { AXLocation } from '@acorex/components/common';\nimport { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\n\nexport interface AXToastConfig {\n gap: number;\n timeOut: number;\n timeOutProgress: boolean;\n location: AXLocation;\n limit: number;\n}\n\nexport const AX_TOAST_CONFIG = new InjectionToken<AXToastConfig>('AX_TOAST_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'layout.toast', AX_TOAST_CONFIG);\n return AXToastDefaultConfig;\n },\n});\n\nexport const AXToastDefaultConfig: AXToastConfig = {\n gap: 5,\n timeOut: 2500,\n timeOutProgress: true,\n location: 'bottom-center',\n limit: 3,\n};\n\nexport type PartialToastConfig = Partial<AXToastConfig>;\n\nexport function toastConfig(config: PartialToastConfig = {}): AXToastConfig {\n const result = {\n ...AXToastDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXLocation, AXStyleColorType } from '@acorex/components/common';\nimport { Dialog } from '@angular/cdk/dialog';\nimport { GlobalPositionStrategy, ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { Injectable, effect, inject, signal } from '@angular/core';\nimport { AXToastData, AXToastDisplayConfig, AXToastRef } from './toast.class';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastConfig, AX_TOAST_CONFIG } from './toast.config';\n\n@Injectable()\nexport class AXToastService {\n private dialog: Dialog = inject(Dialog);\n private defaultConfig: AXToastConfig = inject(AX_TOAST_CONFIG);\n private activeToasts = signal<string[]>([]);\n private reservedToasts = signal<AXToastDisplayConfig[]>([]);\n private toastCounterElement = signal<AXToastComponent | null>(null);\n private moreToastsColor = signal<AXStyleColorType>('primary');\n private moreToastsLocation = signal<AXLocation>('bottom-center');\n private reserveCounter = signal(0);\n\n scrollStrategy: ScrollStrategy;\n\n constructor(private readonly scrollStrategyOptions: ScrollStrategyOptions) {\n this.scrollStrategy = this.scrollStrategyOptions.noop();\n }\n\n #effect = effect(\n () => {\n if (this.defaultConfig.limit <= 0) return;\n this.handleShowReservedToast();\n this.handleShowReservedToastCounter();\n this.handleReserveCounter();\n },\n { allowSignalWrites: true },\n );\n\n primary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'primary',\n content: content,\n });\n }\n secondary(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'secondary',\n content: content,\n });\n }\n success(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'success',\n content: content,\n });\n }\n warning(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'warning',\n content: content,\n });\n }\n danger(content: string) {\n this.show({\n timeOut: this.defaultConfig.timeOut,\n color: 'danger',\n content: content,\n });\n }\n\n show(config: AXToastDisplayConfig): AXToastRef {\n const opt = Object.assign(\n {\n closeButton: true,\n location: this.defaultConfig.location ?? 'bottom-center',\n },\n config,\n );\n this.moreToastsColor.set(opt.color);\n this.moreToastsLocation.set(opt.location);\n\n if (this.defaultConfig.limit > 0) {\n if (this.activeToasts().length >= this.defaultConfig.limit) {\n this.reservedToasts.update((value) => [...value, opt]);\n return {\n close: () => {\n //TODO close reserved toast\n },\n };\n }\n }\n\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(opt.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: opt,\n autoFocus: '__no_element__',\n restoreFocus: true,\n role: 'dialog',\n ariaModal: true,\n closeOnNavigation: true,\n closeOnDestroy: true,\n hasBackdrop: false,\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n });\n\n this.activeToasts.update((value) => [...value, dialogRef.id]);\n\n const toastRef = dialogRef.componentInstance as AXToastComponent;\n dialogRef.closed.subscribe(() => {\n this.activeToasts.update((value) => [...value].filter((dialogID) => dialogID !== dialogRef.id));\n setTimeout(() => {\n this.reposition(opt.location, gap);\n }, 0);\n });\n\n return {\n close: () => {\n toastRef.close();\n },\n };\n }\n\n hideAll() {\n this.dialog.closeAll();\n }\n\n private handleShowReservedToast() {\n if (this.activeToasts().length > this.defaultConfig.limit - 1) return;\n if (!this.reservedToasts().length) return;\n this.show(this.reservedToasts()[0]);\n this.reservedToasts.update((value) => {\n const toasts = [...value];\n toasts.shift();\n return toasts;\n });\n }\n\n private handleShowReservedToastCounter() {\n if (this.reservedToasts().length === this.reserveCounter()) return;\n this.reserveCounter.set(this.reservedToasts().length);\n if (this.toastCounterElement() !== null) this.toastCounterElement().close();\n this.createReservedCounterToast();\n }\n\n private handleReserveCounter() {\n if (this.reserveCounter() !== 0) return;\n if (this.toastCounterElement() === null) return;\n this.toastCounterElement().close();\n }\n\n private createReservedCounterToast() {\n const opt: AXToastData = {\n closeButton: false,\n color: this.moreToastsColor(),\n location: this.moreToastsLocation(),\n title: `And ${this.reserveCounter()} more...`,\n timeOutProgress: false,\n };\n const gap = this.defaultConfig.gap;\n const pos = this.getPosition(opt.location) + gap + 'px';\n const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);\n const dialogRef = this.dialog.open(AXToastComponent, {\n data: opt,\n autoFocus: '__no_element__',\n restoreFocus: true,\n role: 'dialog',\n ariaModal: true,\n closeOnNavigation: true,\n closeOnDestroy: true,\n hasBackdrop: false,\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\n positionStrategy,\n scrollStrategy: this.scrollStrategy,\n });\n this.toastCounterElement.set(dialogRef.componentInstance as AXToastComponent);\n }\n\n private reposition(toastLocation: AXLocation, gap: number): void {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\n .filter((c) => c.config?.location == toastLocation);\n\n list.forEach((element, index) => {\n const pos = this.getRepositionPosition(index, gap, list, toastLocation);\n console.log(index, element);\n\n this.getPositionStrategy(\n element.dialogRef.config.positionStrategy as GlobalPositionStrategy,\n toastLocation,\n pos,\n gap,\n ).apply();\n });\n }\n\n private getRepositionPosition(index: number, gap: number, list: AXToastComponent[], toastLocation: string) {\n if (index === 0) return gap + 'px';\n const previouseElement = list[index - 1];\n if (toastLocation.split('-')[0] == 'bottom') {\n return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';\n }\n return (\n previouseElement.getHostElement().offsetTop +\n previouseElement.getHostElement().offsetHeight +\n gap +\n 'px'\n );\n }\n\n private getPosition(location: string) {\n const list = this.dialog.openDialogs\n .map((c) => c.componentInstance as AXToastComponent)\n .filter((c) => c.config?.location == location);\n if (list.length == 0) return 0;\n if (location.split('-')[0] == 'bottom') {\n return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;\n }\n return (\n list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight\n );\n }\n\n private getPositionStrategy(\n positionStrategy: GlobalPositionStrategy,\n location: AXLocation,\n pos: string,\n gap: number,\n ) {\n switch (location) {\n case 'bottom-center':\n return positionStrategy.bottom(pos).centerHorizontally();\n break;\n case 'bottom-end':\n return positionStrategy.bottom(pos).right(gap + 'px');\n break;\n case 'bottom-start':\n return positionStrategy.bottom(pos).left(gap + 'px');\n break;\n case 'top-center':\n return positionStrategy.top(pos).centerHorizontally();\n break;\n case 'top-end':\n return positionStrategy.top(pos).right(gap + 'px');\n break;\n case 'top-start':\n return positionStrategy.top(pos).left(gap + 'px');\n break;\n case 'center-start':\n return positionStrategy.centerVertically().left(gap + 'px');\n break;\n case 'center-end':\n return positionStrategy.centerVertically().right(gap + 'px');\n break;\n }\n }\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { DialogModule } from '@angular/cdk/dialog';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXToastComponent } from './toast.component';\nimport { AXToastService } from './toast.service';\n\nconst COMPONENT = [AXToastComponent];\nconst MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXToastService],\n})\nexport class AXToastModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;AAaA;;;;AAIG;AASG,MAAO,gBAAiB,SAAQ,eAAe,CAAA;AAOnD;;AAEG;IACH,WAES,CAAA,MAAmB,EACnB,SAA2C,EAAA;AAElD,QAAA,KAAK,EAAE;QAHA,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAS,CAAA,SAAA,GAAT,SAAS;;QAXR,IAAW,CAAA,WAAA,GAAG,GAAG;;;IAiBlB,QAAQ,GAAA;QACf,KAAK,CAAC,QAAQ,EAAE;AAChB,QAAA,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACvB,UAAU,CAAC,MAAK;gBACd,IAAI,CAAC,KAAK,EAAE;AACd,aAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;;AAEzB,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AACrB,YAAA,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK;AACvB,gBAAA,KAAK,SAAS;AACZ,oBAAA,IAAI,CAAC,KAAK,GAAG,8BAA8B;oBAC3C;AACF,gBAAA,KAAK,SAAS;AACZ,oBAAA,IAAI,CAAC,KAAK,GAAG,yBAAyB;oBACtC;AACF,gBAAA,KAAK,QAAQ;AACX,oBAAA,IAAI,CAAC,KAAK,GAAG,uBAAuB;oBACpC;AACF,gBAAA,KAAK,MAAM;AACT,oBAAA,IAAI,CAAC,KAAK,GAAG,sBAAsB;oBACnC;AACF,gBAAA;oBACE,IAAI,CAAC,KAAK,GAA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,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAb,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,EATP,YAAA,EAAA,CAAA,gBAAgB,CAClB,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,aADjG,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAStB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,EAFb,SAAA,EAAA,CAAC,cAAc,CAAC,YAFd,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,aAAa,EAAA,UAAA,EAAA,CAAA;kBANzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;oBACvB,SAAS,EAAE,CAAC,cAAc,CAAC;AAC5B,iBAAA;;;AClBD;;AAEG;;;;"}
|
@@ -4,7 +4,7 @@ import { OnDestroy, OnInit } from '@angular/core';
|
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
export declare class AXValidationRuleDirective implements OnInit, OnDestroy {
|
6
6
|
private host;
|
7
|
-
rule:
|
7
|
+
rule: string;
|
8
8
|
options: Omit<AXValidationRuleOptions, 'message'>;
|
9
9
|
message: string;
|
10
10
|
constructor(host: AXValuableComponent);
|
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
|
|
10
10
|
*/
|
11
11
|
export declare class AXNotificationComponent extends MXBaseComponent {
|
12
12
|
config: AXNotificationData;
|
13
|
-
|
13
|
+
dialogRef: DialogRef<AXComponentCloseEvent>;
|
14
14
|
/** @ignore */
|
15
15
|
_selectedPortal: Portal<unknown>;
|
16
16
|
/** @ignore */
|
@@ -32,8 +32,8 @@ export declare class AXNotificationComponent extends MXBaseComponent {
|
|
32
32
|
/** @ignore */
|
33
33
|
private get __hostClass();
|
34
34
|
/**
|
35
|
-
|
36
|
-
|
35
|
+
* Closes the dialog and provides the component and HTML element for reference.
|
36
|
+
*/
|
37
37
|
close(): void;
|
38
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXNotificationComponent, never>;
|
39
39
|
static ɵcmp: i0.ɵɵComponentDeclaration<AXNotificationComponent, "ax-notification", never, {}, {}, never, never, false, never>;
|
@@ -6,6 +6,7 @@ export interface AXNotificationConfig {
|
|
6
6
|
timeOutProgress: boolean;
|
7
7
|
location: AXLocation;
|
8
8
|
closeButton: boolean;
|
9
|
+
limit: number;
|
9
10
|
}
|
10
11
|
export declare const AX_NOTIFICATION_CONFIG: InjectionToken<AXNotificationConfig>;
|
11
12
|
export declare const AXNotificationDefaultConfig: AXNotificationConfig;
|
@@ -1,12 +1,25 @@
|
|
1
1
|
import { AXNotificationOptions as AXNotificationDisplayConfig, AXNotificationRef } from './notification.class';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export declare class AXNotificationService {
|
4
|
+
#private;
|
4
5
|
private dialog;
|
5
6
|
private defaultConfig;
|
7
|
+
private activeNotifications;
|
8
|
+
private reservedNotifications;
|
9
|
+
private notificationCounterElement;
|
10
|
+
private moreNotificationsColor;
|
11
|
+
private moreNotificationsLocation;
|
12
|
+
private reserveCounter;
|
6
13
|
show(config: AXNotificationDisplayConfig): AXNotificationRef;
|
7
14
|
hideAll(): void;
|
15
|
+
private handleShowReservedNotification;
|
16
|
+
private handleShowReservedNotificationCounter;
|
17
|
+
private handleReserveCounter;
|
18
|
+
private createReservedCounterToast;
|
8
19
|
private reposition;
|
20
|
+
private getRepositionPosition;
|
9
21
|
private getPosition;
|
22
|
+
private getPositionStrategy;
|
10
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXNotificationService, never>;
|
11
24
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXNotificationService>;
|
12
25
|
}
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@ import * as i0 from "@angular/core";
|
|
11
11
|
*/
|
12
12
|
export declare class AXToastComponent extends MXBaseComponent implements OnInit {
|
13
13
|
config: AXToastData;
|
14
|
-
|
14
|
+
dialogRef: DialogRef<AXComponentCloseEvent>;
|
15
15
|
/** @ignore */
|
16
16
|
protected _toastWidth: number;
|
17
17
|
/** @ignore */
|
@@ -2,9 +2,16 @@ import { ScrollStrategy, ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
2
2
|
import { AXToastDisplayConfig, AXToastRef } from './toast.class';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
export declare class AXToastService {
|
5
|
+
#private;
|
5
6
|
private readonly scrollStrategyOptions;
|
6
7
|
private dialog;
|
7
8
|
private defaultConfig;
|
9
|
+
private activeToasts;
|
10
|
+
private reservedToasts;
|
11
|
+
private toastCounterElement;
|
12
|
+
private moreToastsColor;
|
13
|
+
private moreToastsLocation;
|
14
|
+
private reserveCounter;
|
8
15
|
scrollStrategy: ScrollStrategy;
|
9
16
|
constructor(scrollStrategyOptions: ScrollStrategyOptions);
|
10
17
|
primary(content: string): void;
|
@@ -14,8 +21,14 @@ export declare class AXToastService {
|
|
14
21
|
danger(content: string): void;
|
15
22
|
show(config: AXToastDisplayConfig): AXToastRef;
|
16
23
|
hideAll(): void;
|
24
|
+
private handleShowReservedToast;
|
25
|
+
private handleShowReservedToastCounter;
|
26
|
+
private handleReserveCounter;
|
27
|
+
private createReservedCounterToast;
|
17
28
|
private reposition;
|
29
|
+
private getRepositionPosition;
|
18
30
|
private getPosition;
|
31
|
+
private getPositionStrategy;
|
19
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXToastService, never>;
|
20
33
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXToastService>;
|
21
34
|
}
|