@acorex/components 21.0.1-next.3 → 21.0.1-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/index.d.ts +41 -19
- package/datetime-picker/index.d.ts +1 -1
- package/dialog/index.d.ts +18 -14
- package/dropdown/index.d.ts +3 -4
- package/fesm2022/acorex-components-action-sheet.mjs +141 -93
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-conversation2.mjs +2 -2
- package/fesm2022/acorex-components-conversation2.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +1 -0
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +25 -25
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +66 -45
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +5 -10
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-grid-layout-builder.mjs +2 -2
- package/fesm2022/acorex-components-grid-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-components-loading-dialog.mjs +73 -36
- package/fesm2022/acorex-components-loading-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +26 -5
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/{acorex-components-modal-acorex-components-modal-CXXcFToK.mjs → acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs} +27 -3
- package/fesm2022/acorex-components-modal-acorex-components-modal-Bmoz9DL5.mjs.map +1 -0
- package/fesm2022/{acorex-components-modal-modal-content.component-B4rhHeEz.mjs → acorex-components-modal-modal-content.component-CSJU1vRi.mjs} +2 -2
- package/fesm2022/{acorex-components-modal-modal-content.component-B4rhHeEz.mjs.map → acorex-components-modal-modal-content.component-CSJU1vRi.mjs.map} +1 -1
- package/fesm2022/acorex-components-modal.mjs +1 -1
- package/fesm2022/acorex-components-notification.mjs +374 -257
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-popover.mjs +136 -175
- package/fesm2022/acorex-components-popover.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +308 -105
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +2 -2
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +231 -123
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +2 -3
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/loading-dialog/index.d.ts +31 -15
- package/menu/index.d.ts +4 -0
- package/modal/index.d.ts +7 -0
- package/notification/index.d.ts +47 -32
- package/package.json +3 -3
- package/popover/index.d.ts +20 -27
- package/popup/index.d.ts +103 -27
- package/toast/index.d.ts +24 -18
- package/tooltip/index.d.ts +1 -2
- package/fesm2022/acorex-components-modal-acorex-components-modal-CXXcFToK.mjs.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
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';
|
|
5
4
|
import { AsyncPipe, CommonModule } from '@angular/common';
|
|
6
5
|
import * as i0 from '@angular/core';
|
|
7
|
-
import { InjectionToken, inject, signal, Injectable,
|
|
8
|
-
import {
|
|
6
|
+
import { InjectionToken, inject, signal, Injectable, input, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
7
|
+
import { AXOverlayService } from '@acorex/cdk/overlay';
|
|
9
8
|
import { AX_GLOBAL_CONFIG } from '@acorex/core/config';
|
|
10
9
|
import { set } from 'lodash-es';
|
|
11
10
|
import { AXButtonModule } from '@acorex/components/button';
|
|
@@ -35,18 +34,17 @@ function toastConfig(config = {}) {
|
|
|
35
34
|
return result;
|
|
36
35
|
}
|
|
37
36
|
|
|
37
|
+
let toastIdCounter = 0;
|
|
38
38
|
class AXToastService {
|
|
39
39
|
constructor() {
|
|
40
|
-
this.
|
|
41
|
-
this.dialog = inject(Dialog);
|
|
40
|
+
this.overlayService = inject(AXOverlayService);
|
|
42
41
|
this.defaultConfig = inject(AX_TOAST_CONFIG);
|
|
43
42
|
this.translationService = inject(AXTranslationService);
|
|
44
43
|
this.reserveCounter = signal(0, ...(ngDevMode ? [{ debugName: "reserveCounter" }] : []));
|
|
45
44
|
this.activeToasts = signal([], ...(ngDevMode ? [{ debugName: "activeToasts" }] : []));
|
|
46
45
|
this.reservedToasts = signal([], ...(ngDevMode ? [{ debugName: "reservedToasts" }] : []));
|
|
47
|
-
this.
|
|
46
|
+
this.toastCounterRef = signal(null, ...(ngDevMode ? [{ debugName: "toastCounterRef" }] : []));
|
|
48
47
|
this.moreToastsConfig = signal({ color: 'primary', location: 'bottom-center' }, ...(ngDevMode ? [{ debugName: "moreToastsConfig" }] : []));
|
|
49
|
-
this.scrollStrategy = this.scrollStrategyOptions.noop();
|
|
50
48
|
}
|
|
51
49
|
/**
|
|
52
50
|
* Shows a primary toast notification.
|
|
@@ -148,35 +146,63 @@ class AXToastService {
|
|
|
148
146
|
}
|
|
149
147
|
displayToast(config) {
|
|
150
148
|
const gap = this.defaultConfig.gap;
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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,
|
|
162
180
|
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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]);
|
|
172
201
|
this.handleReservedToastCounter();
|
|
173
|
-
setTimeout(() => {
|
|
174
|
-
this.reposition(config.location, gap);
|
|
175
|
-
});
|
|
176
202
|
});
|
|
177
203
|
return {
|
|
178
204
|
close: () => {
|
|
179
|
-
|
|
205
|
+
closeToast();
|
|
180
206
|
},
|
|
181
207
|
};
|
|
182
208
|
}
|
|
@@ -186,8 +212,17 @@ class AXToastService {
|
|
|
186
212
|
hideAll() {
|
|
187
213
|
this.reserveCounter.set(0);
|
|
188
214
|
this.reservedToasts.set([]);
|
|
215
|
+
// Close all active toasts
|
|
216
|
+
this.activeToasts().forEach((toast) => {
|
|
217
|
+
toast.overlayRef.dispose();
|
|
218
|
+
});
|
|
189
219
|
this.activeToasts.set([]);
|
|
190
|
-
|
|
220
|
+
// Close counter toast if exists
|
|
221
|
+
const counterRef = this.toastCounterRef();
|
|
222
|
+
if (counterRef) {
|
|
223
|
+
counterRef.overlayRef.dispose();
|
|
224
|
+
this.toastCounterRef.set(null);
|
|
225
|
+
}
|
|
191
226
|
this.handleReservedToastCounter();
|
|
192
227
|
}
|
|
193
228
|
handleShowReservedToast() {
|
|
@@ -195,29 +230,37 @@ class AXToastService {
|
|
|
195
230
|
return;
|
|
196
231
|
if (!this.reservedToasts().length)
|
|
197
232
|
return;
|
|
198
|
-
const
|
|
199
|
-
|
|
233
|
+
const reserved = this.reservedToasts()[0];
|
|
234
|
+
this.reservedToasts.update((prev) => prev.slice(1));
|
|
235
|
+
const displayedRef = this.displayToast(reserved.config);
|
|
200
236
|
this.handleReservedToastCounter();
|
|
201
|
-
reservedRef.close = displayedRef.close;
|
|
237
|
+
reserved.reservedRef.close = displayedRef.close;
|
|
202
238
|
}
|
|
203
239
|
handleReservedToastCounter() {
|
|
204
240
|
const reservedCount = this.reservedToasts().length;
|
|
205
241
|
if (reservedCount === this.reserveCounter())
|
|
206
242
|
return;
|
|
207
243
|
this.reserveCounter.set(reservedCount);
|
|
208
|
-
if (reservedCount === 0 && this.
|
|
209
|
-
this.
|
|
244
|
+
if (reservedCount === 0 && this.toastCounterRef() !== null) {
|
|
245
|
+
this.toastCounterRef().close();
|
|
246
|
+
this.toastCounterRef.set(null);
|
|
210
247
|
return;
|
|
211
248
|
}
|
|
212
249
|
if (reservedCount > 0) {
|
|
213
|
-
if (this.
|
|
214
|
-
this.
|
|
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);
|
|
215
259
|
}
|
|
216
|
-
const remainingTime = this.dialog.getDialogById(this.activeToasts()[0]).componentRef.instance.createdDate();
|
|
217
|
-
this.createReservedCounterToast(remainingTime);
|
|
218
260
|
}
|
|
219
261
|
}
|
|
220
262
|
async createReservedCounterToast(remainingTime) {
|
|
263
|
+
const gap = this.defaultConfig.gap;
|
|
221
264
|
const timeOut = Math.min(this.moreToastsConfig().timeOut - (new Date().getTime() - remainingTime), this.moreToastsConfig().timeOut);
|
|
222
265
|
const opt = {
|
|
223
266
|
closeButton: false,
|
|
@@ -230,88 +273,156 @@ class AXToastService {
|
|
|
230
273
|
timeOutProgress: this.moreToastsConfig().timeOutProgress,
|
|
231
274
|
closeAllButton: true,
|
|
232
275
|
};
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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,
|
|
245
292
|
panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],
|
|
246
|
-
positionStrategy,
|
|
247
|
-
scrollStrategy: this.scrollStrategy,
|
|
248
293
|
});
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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;
|
|
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);
|
|
279
303
|
}
|
|
280
|
-
|
|
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
|
|
281
321
|
switch (location) {
|
|
282
322
|
case 'bottom-center':
|
|
283
|
-
|
|
323
|
+
element.style.bottom = pos + 'px';
|
|
324
|
+
element.style.left = '50%';
|
|
325
|
+
element.style.transform = 'translateX(-50%)';
|
|
284
326
|
break;
|
|
285
327
|
case 'bottom-end':
|
|
286
|
-
|
|
328
|
+
element.style.bottom = pos + 'px';
|
|
329
|
+
element.style.right = gap + 'px';
|
|
287
330
|
break;
|
|
288
331
|
case 'bottom-start':
|
|
289
|
-
|
|
332
|
+
element.style.bottom = pos + 'px';
|
|
333
|
+
element.style.left = gap + 'px';
|
|
290
334
|
break;
|
|
291
335
|
case 'top-center':
|
|
292
|
-
|
|
336
|
+
element.style.top = pos + 'px';
|
|
337
|
+
element.style.left = '50%';
|
|
338
|
+
element.style.transform = 'translateX(-50%)';
|
|
293
339
|
break;
|
|
294
340
|
case 'top-end':
|
|
295
|
-
|
|
341
|
+
element.style.top = pos + 'px';
|
|
342
|
+
element.style.right = gap + 'px';
|
|
296
343
|
break;
|
|
297
344
|
case 'top-start':
|
|
298
|
-
|
|
345
|
+
element.style.top = pos + 'px';
|
|
346
|
+
element.style.left = gap + 'px';
|
|
299
347
|
break;
|
|
300
348
|
case 'center-start':
|
|
301
|
-
|
|
349
|
+
element.style.top = '50%';
|
|
350
|
+
element.style.left = gap + 'px';
|
|
351
|
+
element.style.transform = 'translateY(-50%)';
|
|
302
352
|
break;
|
|
303
353
|
case 'center-end':
|
|
304
|
-
|
|
354
|
+
element.style.top = '50%';
|
|
355
|
+
element.style.right = gap + 'px';
|
|
356
|
+
element.style.transform = 'translateY(-50%)';
|
|
305
357
|
break;
|
|
306
358
|
}
|
|
307
359
|
}
|
|
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
|
+
}
|
|
308
419
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
309
420
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, providedIn: 'root' }); }
|
|
310
421
|
}
|
|
311
422
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastService, decorators: [{
|
|
312
423
|
type: Injectable,
|
|
313
424
|
args: [{ providedIn: 'root' }]
|
|
314
|
-
}]
|
|
425
|
+
}] });
|
|
315
426
|
|
|
316
427
|
/**
|
|
317
428
|
* The Button is a component which detects user interaction and triggers a corresponding event
|
|
@@ -321,8 +432,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
|
|
|
321
432
|
class AXToastComponent extends MXBaseComponent {
|
|
322
433
|
constructor() {
|
|
323
434
|
super(...arguments);
|
|
324
|
-
|
|
325
|
-
this.
|
|
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" }] : []));
|
|
326
439
|
this.toastService = inject(AXToastService);
|
|
327
440
|
this.createdDate = signal(0, ...(ngDevMode ? [{ debugName: "createdDate" }] : []));
|
|
328
441
|
this.isPaused = signal(false, ...(ngDevMode ? [{ debugName: "isPaused" }] : []));
|
|
@@ -336,10 +449,10 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
336
449
|
super.ngOnInit();
|
|
337
450
|
this._initIcon();
|
|
338
451
|
this.createdDate.set(new Date().getTime());
|
|
339
|
-
this.remainingTime.set(this.config.timeOut);
|
|
452
|
+
this.remainingTime.set(this.config().timeOut);
|
|
340
453
|
this._handleTimeOut();
|
|
341
454
|
this.getHostElement().addEventListener('pointerenter', () => {
|
|
342
|
-
if (!this.config.pauseOnHover)
|
|
455
|
+
if (!this.config().pauseOnHover)
|
|
343
456
|
return;
|
|
344
457
|
if (this.isPaused())
|
|
345
458
|
return;
|
|
@@ -348,7 +461,7 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
348
461
|
this.pauseAnimation();
|
|
349
462
|
});
|
|
350
463
|
this.getHostElement().addEventListener('pointerleave', () => {
|
|
351
|
-
if (!this.config.pauseOnHover)
|
|
464
|
+
if (!this.config().pauseOnHover)
|
|
352
465
|
return;
|
|
353
466
|
if (!this.isPaused())
|
|
354
467
|
return;
|
|
@@ -361,7 +474,7 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
361
474
|
clearInterval(this.intervalId);
|
|
362
475
|
}
|
|
363
476
|
_handleTimeOut() {
|
|
364
|
-
if (this.config.timeOut) {
|
|
477
|
+
if (this.config().timeOut) {
|
|
365
478
|
this.intervalId = setInterval(() => {
|
|
366
479
|
this.remainingTime.update((prev) => prev - this.transitionDuration());
|
|
367
480
|
if (this.remainingTime() <= 0) {
|
|
@@ -372,8 +485,8 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
372
485
|
}
|
|
373
486
|
}
|
|
374
487
|
_initIcon() {
|
|
375
|
-
if (!this.config.icon) {
|
|
376
|
-
switch (this.config.color) {
|
|
488
|
+
if (!this.config().icon) {
|
|
489
|
+
switch (this.config().color) {
|
|
377
490
|
case 'success':
|
|
378
491
|
this._icon = 'ax-icon ax-icon-check-circle';
|
|
379
492
|
break;
|
|
@@ -384,12 +497,12 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
384
497
|
this._icon = 'ax-icon ax-icon-error';
|
|
385
498
|
break;
|
|
386
499
|
default:
|
|
387
|
-
this._icon = this.config.icon || 'ax-icon ax-icon-info';
|
|
500
|
+
this._icon = this.config().icon || 'ax-icon ax-icon-info';
|
|
388
501
|
break;
|
|
389
502
|
}
|
|
390
503
|
}
|
|
391
504
|
else {
|
|
392
|
-
this._icon = this.config.icon;
|
|
505
|
+
this._icon = this.config().icon;
|
|
393
506
|
}
|
|
394
507
|
}
|
|
395
508
|
/** @ignore */
|
|
@@ -398,18 +511,14 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
398
511
|
button.onClick({ source: button });
|
|
399
512
|
}
|
|
400
513
|
}
|
|
401
|
-
/** @ignore */
|
|
402
|
-
get __hostClass() {
|
|
403
|
-
return `ax-${this.config.color}`;
|
|
404
|
-
}
|
|
405
514
|
/**
|
|
406
515
|
* Closes the toast notification.
|
|
407
516
|
*/
|
|
408
517
|
close() {
|
|
409
|
-
this.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
518
|
+
const closeCallback = this.onClose();
|
|
519
|
+
if (closeCallback) {
|
|
520
|
+
closeCallback();
|
|
521
|
+
}
|
|
413
522
|
}
|
|
414
523
|
/**
|
|
415
524
|
* Closes all toast notifications.
|
|
@@ -418,27 +527,26 @@ class AXToastComponent extends MXBaseComponent {
|
|
|
418
527
|
this.toastService.hideAll();
|
|
419
528
|
}
|
|
420
529
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
421
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: AXToastComponent, isStandalone: true, selector: "ax-toast", host: { properties: { "class": "
|
|
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: [
|
|
422
531
|
{ provide: AXClosableComponent, useExisting: AXToastComponent },
|
|
423
532
|
{ provide: AXComponent, useExisting: AXToastComponent },
|
|
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 }); }
|
|
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 }); }
|
|
425
534
|
}
|
|
426
535
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastComponent, decorators: [{
|
|
427
536
|
type: Component,
|
|
428
|
-
args: [{ selector: 'ax-toast', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None,
|
|
537
|
+
args: [{ selector: 'ax-toast', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
538
|
+
'[class]': '"ax-" + config().color',
|
|
539
|
+
}, providers: [
|
|
429
540
|
{ provide: AXClosableComponent, useExisting: AXToastComponent },
|
|
430
541
|
{ provide: AXComponent, useExisting: AXToastComponent },
|
|
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: {
|
|
433
|
-
type: HostBinding,
|
|
434
|
-
args: ['class']
|
|
435
|
-
}] } });
|
|
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 }] }] } });
|
|
436
544
|
|
|
437
545
|
const COMPONENT = [AXToastComponent];
|
|
438
|
-
const MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule,
|
|
546
|
+
const MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule, AXTranslationModule];
|
|
439
547
|
class AXToastModule {
|
|
440
548
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
441
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, imports: [CommonModule, AXButtonModule, AXDecoratorModule, AXLoadingModule,
|
|
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] }); }
|
|
442
550
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, providers: [AXToastService], imports: [MODULES, COMPONENT] }); }
|
|
443
551
|
}
|
|
444
552
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXToastModule, decorators: [{
|