@acorex/components 21.0.1-next.2 → 21.0.1-next.3

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 (47) hide show
  1. package/action-sheet/index.d.ts +19 -41
  2. package/dialog/index.d.ts +14 -18
  3. package/dropdown/index.d.ts +4 -3
  4. package/fesm2022/acorex-components-action-sheet.mjs +93 -141
  5. package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
  6. package/fesm2022/acorex-components-conversation2.mjs +2 -2
  7. package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
  8. package/fesm2022/acorex-components-dialog.mjs +45 -66
  9. package/fesm2022/acorex-components-dialog.mjs.map +1 -1
  10. package/fesm2022/acorex-components-dropdown.mjs +4 -0
  11. package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
  12. package/fesm2022/acorex-components-grid-layout-builder.mjs +2 -2
  13. package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
  14. package/fesm2022/acorex-components-loading-dialog.mjs +36 -73
  15. package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
  16. package/fesm2022/acorex-components-menu.mjs +5 -26
  17. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  18. package/fesm2022/{acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs → acorex-components-modal-acorex-components-modal-CXXcFToK.mjs} +3 -27
  19. package/fesm2022/acorex-components-modal-acorex-components-modal-CXXcFToK.mjs.map +1 -0
  20. package/fesm2022/{acorex-components-modal-modal-content.component-CSJU1vRi.mjs → acorex-components-modal-modal-content.component-B4rhHeEz.mjs} +2 -2
  21. package/fesm2022/{acorex-components-modal-modal-content.component-CSJU1vRi.mjs.map → acorex-components-modal-modal-content.component-B4rhHeEz.mjs.map} +1 -1
  22. package/fesm2022/acorex-components-modal.mjs +1 -1
  23. package/fesm2022/acorex-components-notification.mjs +257 -374
  24. package/fesm2022/acorex-components-notification.mjs.map +1 -1
  25. package/fesm2022/acorex-components-popover.mjs +175 -136
  26. package/fesm2022/acorex-components-popover.mjs.map +1 -1
  27. package/fesm2022/acorex-components-popup.mjs +105 -308
  28. package/fesm2022/acorex-components-popup.mjs.map +1 -1
  29. package/fesm2022/acorex-components-routing-progress.mjs +2 -2
  30. package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
  31. package/fesm2022/acorex-components-scheduler.mjs +1195 -136
  32. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  33. package/fesm2022/acorex-components-toast.mjs +123 -231
  34. package/fesm2022/acorex-components-toast.mjs.map +1 -1
  35. package/fesm2022/acorex-components-tooltip.mjs +3 -2
  36. package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
  37. package/loading-dialog/index.d.ts +15 -31
  38. package/menu/index.d.ts +0 -4
  39. package/modal/index.d.ts +0 -7
  40. package/notification/index.d.ts +32 -47
  41. package/package.json +7 -7
  42. package/popover/index.d.ts +27 -20
  43. package/popup/index.d.ts +27 -103
  44. package/scheduler/index.d.ts +281 -27
  45. package/toast/index.d.ts +18 -24
  46. package/tooltip/index.d.ts +2 -1
  47. package/fesm2022/acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs.map +0 -1
@@ -1,10 +1,11 @@
1
1
  import { MXBaseComponent, AXClosableComponent, AXComponent } from '@acorex/cdk/common';
2
2
  import { AXDecoratorCloseButtonComponent, AXDecoratorModule } from '@acorex/components/decorators';
3
3
  import { AXTranslationService, AXTranslatorPipe, AXTranslationModule } from '@acorex/core/translation';
4
+ import { Dialog, DIALOG_DATA, DialogRef, DialogModule } from '@angular/cdk/dialog';
4
5
  import { AsyncPipe, CommonModule } from '@angular/common';
5
6
  import * as i0 from '@angular/core';
6
- import { InjectionToken, inject, signal, Injectable, input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
7
- import { AXOverlayService } from '@acorex/cdk/overlay';
7
+ import { InjectionToken, inject, signal, Injectable, HostBinding, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
8
+ import { ScrollStrategyOptions, GlobalPositionStrategy } from '@angular/cdk/overlay';
8
9
  import { AX_GLOBAL_CONFIG } from '@acorex/core/config';
9
10
  import { set } from 'lodash-es';
10
11
  import { AXButtonModule } from '@acorex/components/button';
@@ -34,17 +35,18 @@ function toastConfig(config = {}) {
34
35
  return result;
35
36
  }
36
37
 
37
- let toastIdCounter = 0;
38
38
  class AXToastService {
39
39
  constructor() {
40
- this.overlayService = inject(AXOverlayService);
40
+ this.scrollStrategyOptions = inject(ScrollStrategyOptions);
41
+ this.dialog = inject(Dialog);
41
42
  this.defaultConfig = inject(AX_TOAST_CONFIG);
42
43
  this.translationService = inject(AXTranslationService);
43
44
  this.reserveCounter = signal(0, ...(ngDevMode ? [{ debugName: "reserveCounter" }] : []));
44
45
  this.activeToasts = signal([], ...(ngDevMode ? [{ debugName: "activeToasts" }] : []));
45
46
  this.reservedToasts = signal([], ...(ngDevMode ? [{ debugName: "reservedToasts" }] : []));
46
- this.toastCounterRef = signal(null, ...(ngDevMode ? [{ debugName: "toastCounterRef" }] : []));
47
+ this.toastCounterElement = signal(null, ...(ngDevMode ? [{ debugName: "toastCounterElement" }] : []));
47
48
  this.moreToastsConfig = signal({ color: 'primary', location: 'bottom-center' }, ...(ngDevMode ? [{ debugName: "moreToastsConfig" }] : []));
49
+ this.scrollStrategy = this.scrollStrategyOptions.noop();
48
50
  }
49
51
  /**
50
52
  * Shows a primary toast notification.
@@ -146,63 +148,35 @@ class AXToastService {
146
148
  }
147
149
  displayToast(config) {
148
150
  const gap = this.defaultConfig.gap;
149
- const toastData = {
150
- icon: config.icon,
151
- title: config.title,
152
- content: config.content,
153
- location: config.location,
154
- closeButton: config.closeButton ?? true,
155
- color: config.color,
156
- timeOut: config.timeOut,
157
- timeOutProgress: config.timeOutProgress ?? true,
158
- pauseOnHover: config.pauseOnHover,
159
- };
160
- const toastId = `toast-${++toastIdCounter}`;
161
- let internalRef;
162
- const closeToast = () => {
163
- if (internalRef) {
164
- internalRef.overlayRef.dispose();
165
- this.activeToasts.set(this.activeToasts().filter((t) => t.id !== internalRef.id));
166
- this.handleShowReservedToast();
167
- this.handleReservedToastCounter();
168
- setTimeout(() => {
169
- this.reposition(config.location, gap);
170
- });
171
- }
172
- };
173
- this.overlayService
174
- .create(AXToastComponent, {
175
- inputs: {
176
- config: toastData,
177
- onClose: closeToast,
178
- },
179
- centered: false,
151
+ const pos = this.getPosition(config.location) + gap + 'px';
152
+ const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), config.location, pos, gap);
153
+ const dialogRef = this.dialog.open(AXToastComponent, {
154
+ data: config,
155
+ autoFocus: '__no_element__',
156
+ restoreFocus: true,
157
+ role: 'dialog',
158
+ ariaModal: true,
159
+ closeOnNavigation: true,
160
+ closeOnDestroy: true,
161
+ hasBackdrop: false,
180
162
  panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
181
- onDispose: () => {
182
- // Clean up when disposed externally
183
- const currentToasts = this.activeToasts();
184
- if (internalRef && currentToasts.find((t) => t.id === internalRef.id)) {
185
- this.activeToasts.set(currentToasts.filter((t) => t.id !== internalRef.id));
186
- this.handleShowReservedToast();
187
- this.handleReservedToastCounter();
188
- }
189
- },
190
- })
191
- .then((overlayRef) => {
192
- internalRef = {
193
- id: toastId,
194
- overlayRef,
195
- config: toastData,
196
- close: closeToast,
197
- };
198
- // Position the toast BEFORE adding to activeToasts (so getPosition calculates correctly)
199
- this.positionToast(overlayRef.overlayElement, config.location, gap);
200
- this.activeToasts.update((prev) => [...prev, internalRef]);
163
+ positionStrategy,
164
+ scrollStrategy: this.scrollStrategy,
165
+ });
166
+ this.activeToasts.update((prev) => [...prev, dialogRef.id]);
167
+ this.handleReservedToastCounter();
168
+ const toastRef = dialogRef.componentInstance;
169
+ dialogRef.closed.subscribe(() => {
170
+ this.activeToasts.set(this.activeToasts().filter((id) => id !== dialogRef.id));
171
+ this.handleShowReservedToast();
201
172
  this.handleReservedToastCounter();
173
+ setTimeout(() => {
174
+ this.reposition(config.location, gap);
175
+ });
202
176
  });
203
177
  return {
204
178
  close: () => {
205
- closeToast();
179
+ toastRef.close();
206
180
  },
207
181
  };
208
182
  }
@@ -212,17 +186,8 @@ class AXToastService {
212
186
  hideAll() {
213
187
  this.reserveCounter.set(0);
214
188
  this.reservedToasts.set([]);
215
- // Close all active toasts
216
- this.activeToasts().forEach((toast) => {
217
- toast.overlayRef.dispose();
218
- });
219
189
  this.activeToasts.set([]);
220
- // Close counter toast if exists
221
- const counterRef = this.toastCounterRef();
222
- if (counterRef) {
223
- counterRef.overlayRef.dispose();
224
- this.toastCounterRef.set(null);
225
- }
190
+ this.dialog.closeAll();
226
191
  this.handleReservedToastCounter();
227
192
  }
228
193
  handleShowReservedToast() {
@@ -230,37 +195,29 @@ class AXToastService {
230
195
  return;
231
196
  if (!this.reservedToasts().length)
232
197
  return;
233
- const reserved = this.reservedToasts()[0];
234
- this.reservedToasts.update((prev) => prev.slice(1));
235
- const displayedRef = this.displayToast(reserved.config);
198
+ const { config, reservedRef } = this.reservedToasts().shift();
199
+ const displayedRef = this.displayToast(config);
236
200
  this.handleReservedToastCounter();
237
- reserved.reservedRef.close = displayedRef.close;
201
+ reservedRef.close = displayedRef.close;
238
202
  }
239
203
  handleReservedToastCounter() {
240
204
  const reservedCount = this.reservedToasts().length;
241
205
  if (reservedCount === this.reserveCounter())
242
206
  return;
243
207
  this.reserveCounter.set(reservedCount);
244
- if (reservedCount === 0 && this.toastCounterRef() !== null) {
245
- this.toastCounterRef().close();
246
- this.toastCounterRef.set(null);
208
+ if (reservedCount === 0 && this.toastCounterElement() !== null) {
209
+ this.toastCounterElement().close();
247
210
  return;
248
211
  }
249
212
  if (reservedCount > 0) {
250
- if (this.toastCounterRef() !== null) {
251
- this.toastCounterRef().close();
252
- this.toastCounterRef.set(null);
253
- }
254
- const firstToast = this.activeToasts()[0];
255
- if (firstToast) {
256
- const toastComponent = firstToast.overlayRef.instance.instance;
257
- const remainingTime = toastComponent.createdDate();
258
- this.createReservedCounterToast(remainingTime);
213
+ if (this.toastCounterElement() !== null) {
214
+ this.toastCounterElement().close();
259
215
  }
216
+ const remainingTime = this.dialog.getDialogById(this.activeToasts()[0]).componentRef.instance.createdDate();
217
+ this.createReservedCounterToast(remainingTime);
260
218
  }
261
219
  }
262
220
  async createReservedCounterToast(remainingTime) {
263
- const gap = this.defaultConfig.gap;
264
221
  const timeOut = Math.min(this.moreToastsConfig().timeOut - (new Date().getTime() - remainingTime), this.moreToastsConfig().timeOut);
265
222
  const opt = {
266
223
  closeButton: false,
@@ -273,156 +230,88 @@ class AXToastService {
273
230
  timeOutProgress: this.moreToastsConfig().timeOutProgress,
274
231
  closeAllButton: true,
275
232
  };
276
- const toastId = `toast-counter-${++toastIdCounter}`;
277
- let counterInternalRef;
278
- const closeCounter = () => {
279
- if (counterInternalRef) {
280
- counterInternalRef.overlayRef.dispose();
281
- if (this.toastCounterRef()?.id === counterInternalRef.id) {
282
- this.toastCounterRef.set(null);
283
- }
284
- }
285
- };
286
- const overlayRef = await this.overlayService.create(AXToastComponent, {
287
- inputs: {
288
- config: opt,
289
- onClose: closeCounter,
290
- },
291
- centered: false,
233
+ const gap = this.defaultConfig.gap;
234
+ const pos = this.getPosition(opt.location) + gap + 'px';
235
+ const positionStrategy = this.getPositionStrategy(new GlobalPositionStrategy(), opt.location, pos, gap);
236
+ const dialogRef = this.dialog.open(AXToastComponent, {
237
+ data: opt,
238
+ autoFocus: '__no_element__',
239
+ restoreFocus: true,
240
+ role: 'dialog',
241
+ ariaModal: true,
242
+ closeOnNavigation: true,
243
+ closeOnDestroy: true,
244
+ hasBackdrop: false,
292
245
  panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
246
+ positionStrategy,
247
+ scrollStrategy: this.scrollStrategy,
293
248
  });
294
- counterInternalRef = {
295
- id: toastId,
296
- overlayRef,
297
- config: opt,
298
- close: closeCounter,
299
- };
300
- this.toastCounterRef.set(counterInternalRef);
301
- // Position the counter toast
302
- this.positionToast(overlayRef.overlayElement, opt.location, gap);
249
+ this.toastCounterElement.set(dialogRef.componentInstance);
303
250
  }
304
- positionToast(element, location, gap) {
305
- if (!element)
306
- return;
307
- const pos = this.getPosition(location) + gap;
308
- // Override the centered overlay container styles for toast positioning
309
- element.style.width = 'max-content';
310
- element.style.height = 'auto';
311
- element.style.display = 'block';
312
- element.style.alignItems = '';
313
- element.style.justifyContent = '';
314
- // Reset all positioning styles
315
- element.style.top = '';
316
- element.style.bottom = '';
317
- element.style.left = '';
318
- element.style.right = '';
319
- element.style.transform = '';
320
- // Apply position based on location
251
+ reposition(toastLocation, gap) {
252
+ const list = this.dialog.openDialogs
253
+ .map((c) => c.componentInstance)
254
+ .filter((c) => c.config?.location == toastLocation);
255
+ list.forEach((element, index) => {
256
+ const pos = this.getRepositionPosition(index, gap, list, toastLocation);
257
+ this.getPositionStrategy(element.dialogRef.config.positionStrategy, toastLocation, pos, gap).apply();
258
+ });
259
+ }
260
+ getRepositionPosition(index, gap, list, toastLocation) {
261
+ if (index === 0)
262
+ return gap + 'px';
263
+ const previouseElement = list[index - 1];
264
+ if (toastLocation.split('-')[0] == 'bottom') {
265
+ return window.innerHeight - previouseElement.getHostElement().offsetTop + gap + 'px';
266
+ }
267
+ return previouseElement.getHostElement().offsetTop + previouseElement.getHostElement().offsetHeight + gap + 'px';
268
+ }
269
+ getPosition(location) {
270
+ const list = this.dialog.openDialogs
271
+ .map((c) => c.componentInstance)
272
+ .filter((c) => c.config?.location == location);
273
+ if (list.length == 0)
274
+ return 0;
275
+ if (location.split('-')[0] == 'bottom') {
276
+ return window.innerHeight - list[list.length - 1].getHostElement().offsetTop;
277
+ }
278
+ return list[list.length - 1].getHostElement().offsetTop + list[list.length - 1].getHostElement().offsetHeight;
279
+ }
280
+ getPositionStrategy(positionStrategy, location, pos, gap) {
321
281
  switch (location) {
322
282
  case 'bottom-center':
323
- element.style.bottom = pos + 'px';
324
- element.style.left = '50%';
325
- element.style.transform = 'translateX(-50%)';
283
+ return positionStrategy.bottom(pos).centerHorizontally();
326
284
  break;
327
285
  case 'bottom-end':
328
- element.style.bottom = pos + 'px';
329
- element.style.right = gap + 'px';
286
+ return positionStrategy.bottom(pos).right(gap + 'px');
330
287
  break;
331
288
  case 'bottom-start':
332
- element.style.bottom = pos + 'px';
333
- element.style.left = gap + 'px';
289
+ return positionStrategy.bottom(pos).left(gap + 'px');
334
290
  break;
335
291
  case 'top-center':
336
- element.style.top = pos + 'px';
337
- element.style.left = '50%';
338
- element.style.transform = 'translateX(-50%)';
292
+ return positionStrategy.top(pos).centerHorizontally();
339
293
  break;
340
294
  case 'top-end':
341
- element.style.top = pos + 'px';
342
- element.style.right = gap + 'px';
295
+ return positionStrategy.top(pos).right(gap + 'px');
343
296
  break;
344
297
  case 'top-start':
345
- element.style.top = pos + 'px';
346
- element.style.left = gap + 'px';
298
+ return positionStrategy.top(pos).left(gap + 'px');
347
299
  break;
348
300
  case 'center-start':
349
- element.style.top = '50%';
350
- element.style.left = gap + 'px';
351
- element.style.transform = 'translateY(-50%)';
301
+ return positionStrategy.centerVertically().left(gap + 'px');
352
302
  break;
353
303
  case 'center-end':
354
- element.style.top = '50%';
355
- element.style.right = gap + 'px';
356
- element.style.transform = 'translateY(-50%)';
304
+ return positionStrategy.centerVertically().right(gap + 'px');
357
305
  break;
358
306
  }
359
307
  }
360
- reposition(toastLocation, gap) {
361
- const list = this.activeToasts().filter((t) => t.config?.location === toastLocation);
362
- list.forEach((toast, index) => {
363
- const element = toast.overlayRef.overlayElement;
364
- if (!element)
365
- return;
366
- const pos = this.getRepositionPosition(index, gap, list, toastLocation);
367
- this.applyRepositionPosition(element, toastLocation, pos, gap);
368
- });
369
- }
370
- getRepositionPosition(index, gap, list, toastLocation) {
371
- if (index === 0)
372
- return gap;
373
- const previousToast = list[index - 1];
374
- const previousElement = previousToast.overlayRef.overlayElement;
375
- if (!previousElement)
376
- return gap;
377
- if (toastLocation.split('-')[0] === 'bottom') {
378
- return window.innerHeight - previousElement.offsetTop + gap;
379
- }
380
- return previousElement.offsetTop + previousElement.offsetHeight + gap;
381
- }
382
- applyRepositionPosition(element, location, pos, gap) {
383
- // Reset transform if needed, then apply position
384
- const isVerticalCenter = location === 'center-start' || location === 'center-end';
385
- const isHorizontalCenter = location === 'bottom-center' || location === 'top-center';
386
- if (location.startsWith('bottom')) {
387
- element.style.bottom = pos + 'px';
388
- element.style.top = '';
389
- if (isHorizontalCenter) {
390
- element.style.transform = 'translateX(-50%)';
391
- }
392
- }
393
- else if (location.startsWith('top')) {
394
- element.style.top = pos + 'px';
395
- element.style.bottom = '';
396
- if (isHorizontalCenter) {
397
- element.style.transform = 'translateX(-50%)';
398
- }
399
- }
400
- else if (isVerticalCenter) {
401
- element.style.top = pos + 'px';
402
- element.style.bottom = '';
403
- element.style.transform = '';
404
- }
405
- }
406
- getPosition(location) {
407
- const list = this.activeToasts().filter((t) => t.config?.location === location);
408
- if (list.length === 0)
409
- return 0;
410
- const lastToast = list[list.length - 1];
411
- const element = lastToast.overlayRef.overlayElement;
412
- if (!element)
413
- return 0;
414
- if (location.split('-')[0] === 'bottom') {
415
- return window.innerHeight - element.offsetTop;
416
- }
417
- return element.offsetTop + element.offsetHeight;
418
- }
419
308
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
420
309
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, providedIn: 'root' }); }
421
310
  }
422
311
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, decorators: [{
423
312
  type: Injectable,
424
313
  args: [{ providedIn: 'root' }]
425
- }] });
314
+ }], ctorParameters: () => [] });
426
315
 
427
316
  /**
428
317
  * The Button is a component which detects user interaction and triggers a corresponding event
@@ -432,10 +321,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
432
321
  class AXToastComponent extends MXBaseComponent {
433
322
  constructor() {
434
323
  super(...arguments);
435
- /** Toast configuration data */
436
- this.config = input.required(...(ngDevMode ? [{ debugName: "config" }] : []));
437
- /** @internal Callback function to close the toast */
438
- this.onClose = input(...(ngDevMode ? [undefined, { debugName: "onClose" }] : []));
324
+ this.config = inject(DIALOG_DATA);
325
+ this.dialogRef = inject(DialogRef);
439
326
  this.toastService = inject(AXToastService);
440
327
  this.createdDate = signal(0, ...(ngDevMode ? [{ debugName: "createdDate" }] : []));
441
328
  this.isPaused = signal(false, ...(ngDevMode ? [{ debugName: "isPaused" }] : []));
@@ -449,10 +336,10 @@ class AXToastComponent extends MXBaseComponent {
449
336
  super.ngOnInit();
450
337
  this._initIcon();
451
338
  this.createdDate.set(new Date().getTime());
452
- this.remainingTime.set(this.config().timeOut);
339
+ this.remainingTime.set(this.config.timeOut);
453
340
  this._handleTimeOut();
454
341
  this.getHostElement().addEventListener('pointerenter', () => {
455
- if (!this.config().pauseOnHover)
342
+ if (!this.config.pauseOnHover)
456
343
  return;
457
344
  if (this.isPaused())
458
345
  return;
@@ -461,7 +348,7 @@ class AXToastComponent extends MXBaseComponent {
461
348
  this.pauseAnimation();
462
349
  });
463
350
  this.getHostElement().addEventListener('pointerleave', () => {
464
- if (!this.config().pauseOnHover)
351
+ if (!this.config.pauseOnHover)
465
352
  return;
466
353
  if (!this.isPaused())
467
354
  return;
@@ -474,7 +361,7 @@ class AXToastComponent extends MXBaseComponent {
474
361
  clearInterval(this.intervalId);
475
362
  }
476
363
  _handleTimeOut() {
477
- if (this.config().timeOut) {
364
+ if (this.config.timeOut) {
478
365
  this.intervalId = setInterval(() => {
479
366
  this.remainingTime.update((prev) => prev - this.transitionDuration());
480
367
  if (this.remainingTime() <= 0) {
@@ -485,8 +372,8 @@ class AXToastComponent extends MXBaseComponent {
485
372
  }
486
373
  }
487
374
  _initIcon() {
488
- if (!this.config().icon) {
489
- switch (this.config().color) {
375
+ if (!this.config.icon) {
376
+ switch (this.config.color) {
490
377
  case 'success':
491
378
  this._icon = 'ax-icon ax-icon-check-circle';
492
379
  break;
@@ -497,12 +384,12 @@ class AXToastComponent extends MXBaseComponent {
497
384
  this._icon = 'ax-icon ax-icon-error';
498
385
  break;
499
386
  default:
500
- this._icon = this.config().icon || 'ax-icon ax-icon-info';
387
+ this._icon = this.config.icon || 'ax-icon ax-icon-info';
501
388
  break;
502
389
  }
503
390
  }
504
391
  else {
505
- this._icon = this.config().icon;
392
+ this._icon = this.config.icon;
506
393
  }
507
394
  }
508
395
  /** @ignore */
@@ -511,14 +398,18 @@ class AXToastComponent extends MXBaseComponent {
511
398
  button.onClick({ source: button });
512
399
  }
513
400
  }
401
+ /** @ignore */
402
+ get __hostClass() {
403
+ return `ax-${this.config.color}`;
404
+ }
514
405
  /**
515
406
  * Closes the toast notification.
516
407
  */
517
408
  close() {
518
- const closeCallback = this.onClose();
519
- if (closeCallback) {
520
- closeCallback();
521
- }
409
+ this.dialogRef.close({
410
+ component: this,
411
+ htmlElement: this.getHostElement(),
412
+ });
522
413
  }
523
414
  /**
524
415
  * Closes all toast notifications.
@@ -527,26 +418,27 @@ class AXToastComponent extends MXBaseComponent {
527
418
  this.toastService.hideAll();
528
419
  }
529
420
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
530
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AXToastComponent, isStandalone: true, selector: "ax-toast", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null }, onClose: { classPropertyName: "onClose", publicName: "onClose", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "\"ax-\" + config().color" } }, providers: [
421
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AXToastComponent, isStandalone: true, selector: "ax-toast", host: { properties: { "class": "this.__hostClass" } }, providers: [
531
422
  { provide: AXClosableComponent, useExisting: AXToastComponent },
532
423
  { provide: AXComponent, useExisting: AXToastComponent },
533
- ], usesInheritance: true, ngImport: i0, template: "<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\">\n {{ config().title | translate | async }}\n </div>\n <div>{{ config().content | translate | async }}</div>\n</div>\n@if (config().closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config().closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config().timeOutProgress && config().timeOut) {\n <div\n class=\"ax-toast-progress\"\n [style.transition-duration]=\"transitionDuration()\"\n [style.width]=\"(remainingTime() * 100) / config().timeOut + '%'\"\n ></div>\n}\n", styles: ["ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-lighter-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-lighter-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-darkest-surface)}.ax-dark ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-darker-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-darker-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-lightest-surface)}ax-toast.ax-primary{--ax-comp-toast-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-primary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-primary-darker-surface)}ax-toast.ax-secondary{--ax-comp-toast-bg-color: var(--ax-sys-color-secondary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-secondary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-secondary-darker-surface)}ax-toast.ax-success{--ax-comp-toast-bg-color: var(--ax-sys-color-success-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-success-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-success-darker-surface)}ax-toast.ax-warning{--ax-comp-toast-bg-color: var(--ax-sys-color-warning-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-warning-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-warning-darker-surface)}ax-toast.ax-danger{--ax-comp-toast-bg-color: var(--ax-sys-color-danger-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-danger-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-danger-darker-surface)}ax-toast.ax-accent1{--ax-comp-toast-bg-color: var(--ax-sys-color-accent1-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent1-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent1-darker-surface)}ax-toast.ax-accent2{--ax-comp-toast-bg-color: var(--ax-sys-color-accent2-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent2-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent2-darker-surface)}ax-toast.ax-accent3{--ax-comp-toast-bg-color: var(--ax-sys-color-accent3-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent3-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent3-darker-surface)}ax-toast.ax-accent4{--ax-comp-toast-bg-color: var(--ax-sys-color-accent4-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent4-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent4-darker-surface)}ax-toast.ax-accent5{--ax-comp-toast-bg-color: var(--ax-sys-color-accent5-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent5-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent5-darker-surface)}ax-toast.ax-accent6{--ax-comp-toast-bg-color: var(--ax-sys-color-accent6-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent6-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent6-darker-surface)}ax-toast.ax-accent7{--ax-comp-toast-bg-color: var(--ax-sys-color-accent7-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent7-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent7-darker-surface)}ax-toast{position:relative;display:flex;width:98vw;overflow:hidden;padding:.75rem 1rem;--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);color:rgba(var(--ax-comp-toast-text-color));background-color:rgba(var(--ax-comp-toast-bg-color));font-size:var(--ax-comp-toast-font-size, .875rem);line-height:var(--ax-comp-toast-line-height, 1.25rem);border-radius:var(--ax-comp-toast-border-radius, var(--ax-sys-border-radius))}@media (min-width: 768px){ax-toast{width:24rem}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem;max-width:fit-content;align-items:start}ax-toast .ax-toast-icon{margin-inline-end:.5rem}ax-toast .ax-toast-content{display:flex;flex:1 1 0%;flex-direction:column}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;line-height:1.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.75rem;margin-bottom:.75rem;display:flex;gap:.5rem}ax-toast ax-icon-close{height:fit-content}ax-toast ax-icon-close:hover{opacity:.75}ax-toast .ax-toast-progress{width:100%;bottom:0;height:.25rem;position:absolute;inset-inline-end:0px;inset-inline-start:0px;transition-property:width;transition-timing-function:linear;transition-duration:var(--ax-sys-transition-duration);background-color:rgba(var(--ax-comp-toast-progress-bg-color, 255, 255, 255, .46))}\n"], dependencies: [{ kind: "component", type: AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
424
+ ], usesInheritance: true, ngImport: i0, template: "<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\">\n {{ config.title | translate | async }}\n </div>\n <div>{{ config.content | translate | async }}</div>\n</div>\n@if (config.closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config.closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config.timeOutProgress && config.timeOut) {\n <div\n class=\"ax-toast-progress\"\n [style.transition-duration]=\"transitionDuration()\"\n [style.width]=\"(remainingTime() * 100) / config.timeOut + '%'\"\n ></div>\n}\n", styles: ["ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-lighter-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-lighter-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-darkest-surface)}.ax-dark ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-darker-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-darker-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-lightest-surface)}ax-toast.ax-primary{--ax-comp-toast-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-primary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-primary-darker-surface)}ax-toast.ax-secondary{--ax-comp-toast-bg-color: var(--ax-sys-color-secondary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-secondary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-secondary-darker-surface)}ax-toast.ax-success{--ax-comp-toast-bg-color: var(--ax-sys-color-success-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-success-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-success-darker-surface)}ax-toast.ax-warning{--ax-comp-toast-bg-color: var(--ax-sys-color-warning-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-warning-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-warning-darker-surface)}ax-toast.ax-danger{--ax-comp-toast-bg-color: var(--ax-sys-color-danger-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-danger-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-danger-darker-surface)}ax-toast.ax-accent1{--ax-comp-toast-bg-color: var(--ax-sys-color-accent1-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent1-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent1-darker-surface)}ax-toast.ax-accent2{--ax-comp-toast-bg-color: var(--ax-sys-color-accent2-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent2-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent2-darker-surface)}ax-toast.ax-accent3{--ax-comp-toast-bg-color: var(--ax-sys-color-accent3-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent3-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent3-darker-surface)}ax-toast.ax-accent4{--ax-comp-toast-bg-color: var(--ax-sys-color-accent4-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent4-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent4-darker-surface)}ax-toast.ax-accent5{--ax-comp-toast-bg-color: var(--ax-sys-color-accent5-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent5-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent5-darker-surface)}ax-toast.ax-accent6{--ax-comp-toast-bg-color: var(--ax-sys-color-accent6-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent6-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent6-darker-surface)}ax-toast.ax-accent7{--ax-comp-toast-bg-color: var(--ax-sys-color-accent7-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent7-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent7-darker-surface)}ax-toast{position:relative;display:flex;width:98vw;overflow:hidden;padding:.75rem 1rem;--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);color:rgba(var(--ax-comp-toast-text-color));background-color:rgba(var(--ax-comp-toast-bg-color));font-size:var(--ax-comp-toast-font-size, .875rem);line-height:var(--ax-comp-toast-line-height, 1.25rem);border-radius:var(--ax-comp-toast-border-radius, var(--ax-sys-border-radius))}@media (min-width: 768px){ax-toast{width:24rem}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem;max-width:fit-content;align-items:start}ax-toast .ax-toast-icon{margin-inline-end:.5rem}ax-toast .ax-toast-content{display:flex;flex:1 1 0%;flex-direction:column}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;line-height:1.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.75rem;margin-bottom:.75rem;display:flex;gap:.5rem}ax-toast ax-icon-close{height:fit-content}ax-toast ax-icon-close:hover{opacity:.75}ax-toast .ax-toast-progress{width:100%;bottom:0;height:.25rem;position:absolute;inset-inline-end:0px;inset-inline-start:0px;transition-property:width;transition-timing-function:linear;transition-duration:var(--ax-sys-transition-duration);background-color:rgba(var(--ax-comp-toast-progress-bg-color, 255, 255, 255, .46))}\n"], dependencies: [{ kind: "component", type: AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["closeAll", "icon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
534
425
  }
535
426
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastComponent, decorators: [{
536
427
  type: Component,
537
- args: [{ selector: 'ax-toast', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
538
- '[class]': '"ax-" + config().color',
539
- }, providers: [
428
+ args: [{ selector: 'ax-toast', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [
540
429
  { provide: AXClosableComponent, useExisting: AXToastComponent },
541
430
  { provide: AXComponent, useExisting: AXToastComponent },
542
- ], imports: [AXDecoratorCloseButtonComponent, AsyncPipe, AXTranslatorPipe], template: "<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\">\n {{ config().title | translate | async }}\n </div>\n <div>{{ config().content | translate | async }}</div>\n</div>\n@if (config().closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config().closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config().timeOutProgress && config().timeOut) {\n <div\n class=\"ax-toast-progress\"\n [style.transition-duration]=\"transitionDuration()\"\n [style.width]=\"(remainingTime() * 100) / config().timeOut + '%'\"\n ></div>\n}\n", styles: ["ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-lighter-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-lighter-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-darkest-surface)}.ax-dark ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-darker-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-darker-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-lightest-surface)}ax-toast.ax-primary{--ax-comp-toast-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-primary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-primary-darker-surface)}ax-toast.ax-secondary{--ax-comp-toast-bg-color: var(--ax-sys-color-secondary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-secondary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-secondary-darker-surface)}ax-toast.ax-success{--ax-comp-toast-bg-color: var(--ax-sys-color-success-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-success-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-success-darker-surface)}ax-toast.ax-warning{--ax-comp-toast-bg-color: var(--ax-sys-color-warning-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-warning-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-warning-darker-surface)}ax-toast.ax-danger{--ax-comp-toast-bg-color: var(--ax-sys-color-danger-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-danger-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-danger-darker-surface)}ax-toast.ax-accent1{--ax-comp-toast-bg-color: var(--ax-sys-color-accent1-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent1-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent1-darker-surface)}ax-toast.ax-accent2{--ax-comp-toast-bg-color: var(--ax-sys-color-accent2-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent2-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent2-darker-surface)}ax-toast.ax-accent3{--ax-comp-toast-bg-color: var(--ax-sys-color-accent3-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent3-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent3-darker-surface)}ax-toast.ax-accent4{--ax-comp-toast-bg-color: var(--ax-sys-color-accent4-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent4-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent4-darker-surface)}ax-toast.ax-accent5{--ax-comp-toast-bg-color: var(--ax-sys-color-accent5-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent5-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent5-darker-surface)}ax-toast.ax-accent6{--ax-comp-toast-bg-color: var(--ax-sys-color-accent6-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent6-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent6-darker-surface)}ax-toast.ax-accent7{--ax-comp-toast-bg-color: var(--ax-sys-color-accent7-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent7-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent7-darker-surface)}ax-toast{position:relative;display:flex;width:98vw;overflow:hidden;padding:.75rem 1rem;--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);color:rgba(var(--ax-comp-toast-text-color));background-color:rgba(var(--ax-comp-toast-bg-color));font-size:var(--ax-comp-toast-font-size, .875rem);line-height:var(--ax-comp-toast-line-height, 1.25rem);border-radius:var(--ax-comp-toast-border-radius, var(--ax-sys-border-radius))}@media (min-width: 768px){ax-toast{width:24rem}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem;max-width:fit-content;align-items:start}ax-toast .ax-toast-icon{margin-inline-end:.5rem}ax-toast .ax-toast-content{display:flex;flex:1 1 0%;flex-direction:column}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;line-height:1.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.75rem;margin-bottom:.75rem;display:flex;gap:.5rem}ax-toast ax-icon-close{height:fit-content}ax-toast ax-icon-close:hover{opacity:.75}ax-toast .ax-toast-progress{width:100%;bottom:0;height:.25rem;position:absolute;inset-inline-end:0px;inset-inline-start:0px;transition-property:width;transition-timing-function:linear;transition-duration:var(--ax-sys-transition-duration);background-color:rgba(var(--ax-comp-toast-progress-bg-color, 255, 255, 255, .46))}\n"] }]
543
- }], propDecorators: { config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: true }] }], onClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "onClose", required: false }] }] } });
431
+ ], imports: [AXDecoratorCloseButtonComponent, AsyncPipe, AXTranslatorPipe], template: "<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\">\n {{ config.title | translate | async }}\n </div>\n <div>{{ config.content | translate | async }}</div>\n</div>\n@if (config.closeButton) {\n <ax-close-button></ax-close-button>\n} @else if (config.closeAllButton) {\n <ax-close-button [closeAll]=\"true\"></ax-close-button>\n}\n@if (config.timeOutProgress && config.timeOut) {\n <div\n class=\"ax-toast-progress\"\n [style.transition-duration]=\"transitionDuration()\"\n [style.width]=\"(remainingTime() * 100) / config.timeOut + '%'\"\n ></div>\n}\n", styles: ["ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-lighter-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-lighter-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-darkest-surface)}.ax-dark ax-toast.ax-default{--ax-comp-toast-bg-color: var(--ax-sys-color-darker-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-darker-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-lightest-surface)}ax-toast.ax-primary{--ax-comp-toast-bg-color: var(--ax-sys-color-primary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-primary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-primary-darker-surface)}ax-toast.ax-secondary{--ax-comp-toast-bg-color: var(--ax-sys-color-secondary-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-secondary-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-secondary-darker-surface)}ax-toast.ax-success{--ax-comp-toast-bg-color: var(--ax-sys-color-success-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-success-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-success-darker-surface)}ax-toast.ax-warning{--ax-comp-toast-bg-color: var(--ax-sys-color-warning-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-warning-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-warning-darker-surface)}ax-toast.ax-danger{--ax-comp-toast-bg-color: var(--ax-sys-color-danger-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-danger-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-danger-darker-surface)}ax-toast.ax-accent1{--ax-comp-toast-bg-color: var(--ax-sys-color-accent1-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent1-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent1-darker-surface)}ax-toast.ax-accent2{--ax-comp-toast-bg-color: var(--ax-sys-color-accent2-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent2-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent2-darker-surface)}ax-toast.ax-accent3{--ax-comp-toast-bg-color: var(--ax-sys-color-accent3-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent3-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent3-darker-surface)}ax-toast.ax-accent4{--ax-comp-toast-bg-color: var(--ax-sys-color-accent4-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent4-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent4-darker-surface)}ax-toast.ax-accent5{--ax-comp-toast-bg-color: var(--ax-sys-color-accent5-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent5-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent5-darker-surface)}ax-toast.ax-accent6{--ax-comp-toast-bg-color: var(--ax-sys-color-accent6-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent6-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent6-darker-surface)}ax-toast.ax-accent7{--ax-comp-toast-bg-color: var(--ax-sys-color-accent7-surface);--ax-comp-toast-text-color: var(--ax-sys-color-on-accent7-surface);--ax-comp-toast-progress-bg-color: var(--ax-sys-color-accent7-darker-surface)}ax-toast{position:relative;display:flex;width:98vw;overflow:hidden;padding:.75rem 1rem;--ax-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--ax-shadow-colored: 0 4px 6px -1px var(--ax-shadow-color), 0 2px 4px -2px var(--ax-shadow-color);box-shadow:var(--ax-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--ax-shadow);color:rgba(var(--ax-comp-toast-text-color));background-color:rgba(var(--ax-comp-toast-bg-color));font-size:var(--ax-comp-toast-font-size, .875rem);line-height:var(--ax-comp-toast-line-height, 1.25rem);border-radius:var(--ax-comp-toast-border-radius, var(--ax-sys-border-radius))}@media (min-width: 768px){ax-toast{width:24rem}}ax-toast .ax-toast-icon,ax-toast .ax-icon-close{font-size:1.25rem;max-width:fit-content;align-items:start}ax-toast .ax-toast-icon{margin-inline-end:.5rem}ax-toast .ax-toast-content{display:flex;flex:1 1 0%;flex-direction:column}ax-toast .ax-toast-content .ax-toast-title{font-weight:500;line-height:1.5rem}ax-toast .ax-toast-content .ax-toast-buttons{margin-top:.75rem;margin-bottom:.75rem;display:flex;gap:.5rem}ax-toast ax-icon-close{height:fit-content}ax-toast ax-icon-close:hover{opacity:.75}ax-toast .ax-toast-progress{width:100%;bottom:0;height:.25rem;position:absolute;inset-inline-end:0px;inset-inline-start:0px;transition-property:width;transition-timing-function:linear;transition-duration:var(--ax-sys-transition-duration);background-color:rgba(var(--ax-comp-toast-progress-bg-color, 255, 255, 255, .46))}\n"] }]
432
+ }], propDecorators: { __hostClass: [{
433
+ type: HostBinding,
434
+ args: ['class']
435
+ }] } });
544
436
 
545
437
  const COMPONENT = [AXToastComponent];
546
- const MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, AXTranslationModule];
438
+ const MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule];
547
439
  class AXToastModule {
548
440
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
549
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, AXTranslationModule, AXToastComponent], exports: [AXToastComponent] }); }
441
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, DialogModule, AXTranslationModule, AXToastComponent], exports: [AXToastComponent] }); }
550
442
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, providers: [AXToastService], imports: [MODULES, COMPONENT] }); }
551
443
  }
552
444
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, decorators: [{