@weeehaoooz/talos-ui 0.1.0 → 0.1.2
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/README.md +2 -0
- package/fesm2022/{weeehaoooz-talos-ui-button-button-group.mjs → weeehaoooz-talos-ui-button.mjs} +115 -18
- package/fesm2022/weeehaoooz-talos-ui-button.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-data-display.mjs +3110 -0
- package/fesm2022/weeehaoooz-talos-ui-data-display.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs +2414 -0
- package/fesm2022/weeehaoooz-talos-ui-data-viz.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs +1039 -0
- package/fesm2022/weeehaoooz-talos-ui-dropdown.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-feedback.mjs +2885 -0
- package/fesm2022/weeehaoooz-talos-ui-feedback.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-form.mjs +10799 -0
- package/fesm2022/weeehaoooz-talos-ui-form.mjs.map +1 -0
- package/fesm2022/weeehaoooz-talos-ui-layout.mjs +1320 -11
- package/fesm2022/weeehaoooz-talos-ui-layout.mjs.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui-nav.mjs +119 -72
- package/fesm2022/weeehaoooz-talos-ui-nav.mjs.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui.mjs +22190 -15213
- package/fesm2022/weeehaoooz-talos-ui.mjs.map +1 -1
- package/package.json +20 -135
- package/styles/_breadcrumb.scss +16 -0
- package/styles/_button-group.scss +156 -7
- package/styles/_buttons.scss +156 -8
- package/styles/_dropdown.scss +438 -0
- package/styles/_form-controls.scss +13 -0
- package/styles/_progress-bar.scss +43 -0
- package/styles/_skeleton.scss +176 -0
- package/styles/_spinner.scss +58 -0
- package/styles/_variables.scss +37 -0
- package/styles/index.scss +6 -1
- package/types/weeehaoooz-talos-ui-button.d.ts +92 -0
- package/types/weeehaoooz-talos-ui-button.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-data-display.d.ts +1018 -0
- package/types/weeehaoooz-talos-ui-data-display.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-data-viz.d.ts +839 -0
- package/types/weeehaoooz-talos-ui-data-viz.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-dropdown.d.ts +187 -0
- package/types/weeehaoooz-talos-ui-dropdown.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-feedback.d.ts +1495 -0
- package/types/weeehaoooz-talos-ui-feedback.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-form.d.ts +2639 -0
- package/types/weeehaoooz-talos-ui-form.d.ts.map +1 -0
- package/types/weeehaoooz-talos-ui-layout.d.ts +851 -3
- package/types/weeehaoooz-talos-ui-layout.d.ts.map +1 -1
- package/types/weeehaoooz-talos-ui-nav.d.ts +36 -10
- package/types/weeehaoooz-talos-ui-nav.d.ts.map +1 -1
- package/types/weeehaoooz-talos-ui.d.ts +6949 -4137
- package/types/weeehaoooz-talos-ui.d.ts.map +1 -1
- package/fesm2022/weeehaoooz-talos-ui-button-button-group.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-button-button.mjs +0 -93
- package/fesm2022/weeehaoooz-talos-ui-button-button.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs +0 -233
- package/fesm2022/weeehaoooz-talos-ui-data-display-badge.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs +0 -361
- package/fesm2022/weeehaoooz-talos-ui-data-display-status-tag.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs +0 -312
- package/fesm2022/weeehaoooz-talos-ui-data-display-timeline.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs +0 -235
- package/fesm2022/weeehaoooz-talos-ui-data-display-trend-indicator.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs +0 -462
- package/fesm2022/weeehaoooz-talos-ui-data-viz-category-bar.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs +0 -805
- package/fesm2022/weeehaoooz-talos-ui-data-viz-heatmap.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs +0 -267
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-donut.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs +0 -351
- package/fesm2022/weeehaoooz-talos-ui-data-viz-mini-gauge.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs +0 -566
- package/fesm2022/weeehaoooz-talos-ui-data-viz-sparkline.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs +0 -534
- package/fesm2022/weeehaoooz-talos-ui-feedback-alert.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs +0 -446
- package/fesm2022/weeehaoooz-talos-ui-feedback-dialog.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs +0 -376
- package/fesm2022/weeehaoooz-talos-ui-feedback-snackbar.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs +0 -147
- package/fesm2022/weeehaoooz-talos-ui-feedback-tooltip.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs +0 -242
- package/fesm2022/weeehaoooz-talos-ui-form-affix.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs +0 -514
- package/fesm2022/weeehaoooz-talos-ui-form-autocomplete.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs +0 -548
- package/fesm2022/weeehaoooz-talos-ui-form-checkbox.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs +0 -692
- package/fesm2022/weeehaoooz-talos-ui-form-chips.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs +0 -761
- package/fesm2022/weeehaoooz-talos-ui-form-color-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs +0 -896
- package/fesm2022/weeehaoooz-talos-ui-form-date-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs +0 -872
- package/fesm2022/weeehaoooz-talos-ui-form-date-range-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs +0 -119
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs +0 -135
- package/fesm2022/weeehaoooz-talos-ui-form-date-time-range-picker.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs +0 -666
- package/fesm2022/weeehaoooz-talos-ui-form-drop-zone.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs +0 -147
- package/fesm2022/weeehaoooz-talos-ui-form-form-field.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-input.mjs +0 -33
- package/fesm2022/weeehaoooz-talos-ui-form-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs +0 -455
- package/fesm2022/weeehaoooz-talos-ui-form-otp.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs +0 -379
- package/fesm2022/weeehaoooz-talos-ui-form-password-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs +0 -297
- package/fesm2022/weeehaoooz-talos-ui-form-radio.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs +0 -661
- package/fesm2022/weeehaoooz-talos-ui-form-range-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs +0 -346
- package/fesm2022/weeehaoooz-talos-ui-form-rating.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs +0 -896
- package/fesm2022/weeehaoooz-talos-ui-form-select-input.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs +0 -252
- package/fesm2022/weeehaoooz-talos-ui-form-slide-toggle.mjs.map +0 -1
- package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs +0 -916
- package/fesm2022/weeehaoooz-talos-ui-form-transfer-list.mjs.map +0 -1
- package/types/weeehaoooz-talos-ui-button-button-group.d.ts +0 -59
- package/types/weeehaoooz-talos-ui-button-button-group.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-button-button.d.ts +0 -38
- package/types/weeehaoooz-talos-ui-button-button.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-badge.d.ts +0 -119
- package/types/weeehaoooz-talos-ui-data-display-badge.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts +0 -135
- package/types/weeehaoooz-talos-ui-data-display-status-tag.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts +0 -144
- package/types/weeehaoooz-talos-ui-data-display-timeline.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts +0 -83
- package/types/weeehaoooz-talos-ui-data-display-trend-indicator.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts +0 -255
- package/types/weeehaoooz-talos-ui-data-viz-category-bar.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts +0 -204
- package/types/weeehaoooz-talos-ui-data-viz-heatmap.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts +0 -101
- package/types/weeehaoooz-talos-ui-data-viz-mini-donut.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts +0 -138
- package/types/weeehaoooz-talos-ui-data-viz-mini-gauge.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts +0 -161
- package/types/weeehaoooz-talos-ui-data-viz-sparkline.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-alert.d.ts +0 -212
- package/types/weeehaoooz-talos-ui-feedback-alert.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts +0 -259
- package/types/weeehaoooz-talos-ui-feedback-dialog.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts +0 -147
- package/types/weeehaoooz-talos-ui-feedback-snackbar.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts +0 -32
- package/types/weeehaoooz-talos-ui-feedback-tooltip.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-affix.d.ts +0 -88
- package/types/weeehaoooz-talos-ui-form-affix.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts +0 -113
- package/types/weeehaoooz-talos-ui-form-autocomplete.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-checkbox.d.ts +0 -165
- package/types/weeehaoooz-talos-ui-form-checkbox.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-chips.d.ts +0 -152
- package/types/weeehaoooz-talos-ui-form-chips.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-color-picker.d.ts +0 -144
- package/types/weeehaoooz-talos-ui-form-color-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-picker.d.ts +0 -138
- package/types/weeehaoooz-talos-ui-form-date-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts +0 -148
- package/types/weeehaoooz-talos-ui-form-date-range-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts +0 -44
- package/types/weeehaoooz-talos-ui-form-date-time-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts +0 -48
- package/types/weeehaoooz-talos-ui-form-date-time-range-picker.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts +0 -227
- package/types/weeehaoooz-talos-ui-form-drop-zone.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-form-field.d.ts +0 -42
- package/types/weeehaoooz-talos-ui-form-form-field.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-input.d.ts +0 -15
- package/types/weeehaoooz-talos-ui-form-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-otp.d.ts +0 -111
- package/types/weeehaoooz-talos-ui-form-otp.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-password-input.d.ts +0 -145
- package/types/weeehaoooz-talos-ui-form-password-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-radio.d.ts +0 -84
- package/types/weeehaoooz-talos-ui-form-radio.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-range-input.d.ts +0 -181
- package/types/weeehaoooz-talos-ui-form-range-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-rating.d.ts +0 -110
- package/types/weeehaoooz-talos-ui-form-rating.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-select-input.d.ts +0 -195
- package/types/weeehaoooz-talos-ui-form-select-input.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts +0 -79
- package/types/weeehaoooz-talos-ui-form-slide-toggle.d.ts.map +0 -1
- package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts +0 -192
- package/types/weeehaoooz-talos-ui-form-transfer-list.d.ts.map +0 -1
|
@@ -0,0 +1,2885 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, TemplateRef, Injectable, Directive, input, output, computed, Component, inject, NgModule, InjectionToken, Injector, booleanAttribute, contentChild, ViewEncapsulation, ElementRef, Renderer2, ApplicationRef, EnvironmentInjector, effect, createComponent, DestroyRef } from '@angular/core';
|
|
3
|
+
import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
|
|
4
|
+
import { LucideInfo, LucideCheckCircle2, LucideAlertTriangle, LucideCircleAlert, LucideAlertOctagon, LucideShieldAlert, LucideX, LucideAlertCircle } from '@lucide/angular';
|
|
5
|
+
import { DialogRef, Dialog } from '@angular/cdk/dialog';
|
|
6
|
+
import { TalosButtonDirective } from '@weeehaoooz/talos-ui/button';
|
|
7
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
8
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
9
|
+
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
10
|
+
|
|
11
|
+
class TalosAlertService {
|
|
12
|
+
/** Reactive list of currently active programmatic alerts */
|
|
13
|
+
alerts = signal([], /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "alerts" }] : /* istanbul ignore next */ []));
|
|
15
|
+
/** Reactive list of currently active top-level banner alerts */
|
|
16
|
+
bannerAlerts = signal([], /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "bannerAlerts" }] : /* istanbul ignore next */ []));
|
|
18
|
+
idCounter = 0;
|
|
19
|
+
/** Default global configurations */
|
|
20
|
+
defaultConfig = {
|
|
21
|
+
severity: 'success',
|
|
22
|
+
appearance: 'subtle',
|
|
23
|
+
size: 'md',
|
|
24
|
+
showIcon: true,
|
|
25
|
+
dismissible: true
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Override default global configurations.
|
|
29
|
+
*/
|
|
30
|
+
setDefaultConfig(config) {
|
|
31
|
+
this.defaultConfig = { ...this.defaultConfig, ...config };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Main entry point to create a programmatic alert instance.
|
|
35
|
+
*/
|
|
36
|
+
show(messageOrConfig, configOverrides = {}) {
|
|
37
|
+
let fullConfig;
|
|
38
|
+
if (typeof messageOrConfig === 'string' ||
|
|
39
|
+
messageOrConfig instanceof TemplateRef) {
|
|
40
|
+
fullConfig = {
|
|
41
|
+
message: messageOrConfig,
|
|
42
|
+
...configOverrides
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
fullConfig = {
|
|
47
|
+
...messageOrConfig,
|
|
48
|
+
...configOverrides
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const instance = {
|
|
52
|
+
id: fullConfig.id || `talos-alert-${++this.idCounter}-${Date.now()}`,
|
|
53
|
+
severity: fullConfig.severity ?? this.defaultConfig.severity ?? 'success',
|
|
54
|
+
variant: fullConfig.variant,
|
|
55
|
+
appearance: fullConfig.appearance ?? this.defaultConfig.appearance ?? 'subtle',
|
|
56
|
+
size: fullConfig.size ?? this.defaultConfig.size ?? 'md',
|
|
57
|
+
showIcon: fullConfig.showIcon ?? this.defaultConfig.showIcon ?? true,
|
|
58
|
+
icon: fullConfig.icon,
|
|
59
|
+
showSeverityBadge: fullConfig.showSeverityBadge ?? false,
|
|
60
|
+
dismissible: fullConfig.dismissible ?? this.defaultConfig.dismissible ?? true,
|
|
61
|
+
title: fullConfig.title,
|
|
62
|
+
message: fullConfig.message,
|
|
63
|
+
actionLabel: fullConfig.actionLabel,
|
|
64
|
+
onAction: fullConfig.onAction,
|
|
65
|
+
onDismiss: fullConfig.onDismiss,
|
|
66
|
+
customClass: fullConfig.customClass,
|
|
67
|
+
bordered: fullConfig.bordered,
|
|
68
|
+
duration: fullConfig.duration,
|
|
69
|
+
data: fullConfig.data,
|
|
70
|
+
createdAt: Date.now()
|
|
71
|
+
};
|
|
72
|
+
this.alerts.update((current) => [...current, instance]);
|
|
73
|
+
if (instance.duration && instance.duration > 0) {
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
this.dismiss(instance.id);
|
|
76
|
+
}, instance.duration);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
id: instance.id,
|
|
80
|
+
dismiss: () => this.dismiss(instance.id)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Display a high-visibility global banner alert.
|
|
85
|
+
*/
|
|
86
|
+
banner(messageOrConfig, configOverrides = {}) {
|
|
87
|
+
let fullConfig;
|
|
88
|
+
if (typeof messageOrConfig === 'string' ||
|
|
89
|
+
messageOrConfig instanceof TemplateRef) {
|
|
90
|
+
fullConfig = {
|
|
91
|
+
message: messageOrConfig,
|
|
92
|
+
appearance: 'filled',
|
|
93
|
+
severity: 'info',
|
|
94
|
+
...configOverrides
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
fullConfig = {
|
|
99
|
+
appearance: 'filled',
|
|
100
|
+
severity: 'info',
|
|
101
|
+
...messageOrConfig,
|
|
102
|
+
...configOverrides
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const instance = {
|
|
106
|
+
id: fullConfig.id || `talos-banner-alert-${++this.idCounter}-${Date.now()}`,
|
|
107
|
+
severity: fullConfig.severity ?? 'info',
|
|
108
|
+
variant: fullConfig.variant,
|
|
109
|
+
appearance: fullConfig.appearance ?? 'filled',
|
|
110
|
+
size: fullConfig.size ?? 'md',
|
|
111
|
+
showIcon: fullConfig.showIcon ?? true,
|
|
112
|
+
icon: fullConfig.icon,
|
|
113
|
+
showSeverityBadge: fullConfig.showSeverityBadge ?? false,
|
|
114
|
+
dismissible: fullConfig.dismissible ?? true,
|
|
115
|
+
title: fullConfig.title,
|
|
116
|
+
message: fullConfig.message,
|
|
117
|
+
actionLabel: fullConfig.actionLabel,
|
|
118
|
+
onAction: fullConfig.onAction,
|
|
119
|
+
onDismiss: fullConfig.onDismiss,
|
|
120
|
+
customClass: fullConfig.customClass,
|
|
121
|
+
bordered: fullConfig.bordered,
|
|
122
|
+
duration: fullConfig.duration,
|
|
123
|
+
data: fullConfig.data,
|
|
124
|
+
createdAt: Date.now()
|
|
125
|
+
};
|
|
126
|
+
this.bannerAlerts.update((current) => [...current, instance]);
|
|
127
|
+
if (instance.duration && instance.duration > 0) {
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
this.dismissBanner(instance.id);
|
|
130
|
+
}, instance.duration);
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
id: instance.id,
|
|
134
|
+
dismiss: () => this.dismissBanner(instance.id)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** Convenience method for Success alerts (Default severity) */
|
|
138
|
+
success(message, config) {
|
|
139
|
+
return this.show(message, { ...config, severity: 'success' });
|
|
140
|
+
}
|
|
141
|
+
/** Convenience method for Info alerts */
|
|
142
|
+
info(message, config) {
|
|
143
|
+
return this.show(message, { ...config, severity: 'info' });
|
|
144
|
+
}
|
|
145
|
+
/** Convenience method for Warning alerts */
|
|
146
|
+
warning(message, config) {
|
|
147
|
+
return this.show(message, { ...config, severity: 'warning' });
|
|
148
|
+
}
|
|
149
|
+
/** Convenience method for Error alerts */
|
|
150
|
+
error(message, config) {
|
|
151
|
+
return this.show(message, { ...config, severity: 'error' });
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Dismiss a specific programmatic alert by ID, or the oldest if no ID is provided.
|
|
155
|
+
*/
|
|
156
|
+
dismiss(id) {
|
|
157
|
+
if (!id) {
|
|
158
|
+
const current = this.alerts();
|
|
159
|
+
if (current.length === 0)
|
|
160
|
+
return;
|
|
161
|
+
id = current[0].id;
|
|
162
|
+
}
|
|
163
|
+
const target = this.alerts().find((a) => a.id === id);
|
|
164
|
+
if (target?.onDismiss) {
|
|
165
|
+
target.onDismiss();
|
|
166
|
+
}
|
|
167
|
+
this.alerts.update((current) => current.filter((item) => item.id !== id));
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Dismiss a banner alert by ID.
|
|
171
|
+
*/
|
|
172
|
+
dismissBanner(id) {
|
|
173
|
+
if (!id) {
|
|
174
|
+
const current = this.bannerAlerts();
|
|
175
|
+
if (current.length === 0)
|
|
176
|
+
return;
|
|
177
|
+
id = current[0].id;
|
|
178
|
+
}
|
|
179
|
+
const target = this.bannerAlerts().find((a) => a.id === id);
|
|
180
|
+
if (target?.onDismiss) {
|
|
181
|
+
target.onDismiss();
|
|
182
|
+
}
|
|
183
|
+
this.bannerAlerts.update((current) => current.filter((item) => item.id !== id));
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Dismiss all currently active alerts and banners.
|
|
187
|
+
*/
|
|
188
|
+
dismissAll() {
|
|
189
|
+
this.alerts().forEach((a) => a.onDismiss?.());
|
|
190
|
+
this.bannerAlerts().forEach((b) => b.onDismiss?.());
|
|
191
|
+
this.alerts.set([]);
|
|
192
|
+
this.bannerAlerts.set([]);
|
|
193
|
+
}
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
195
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertService, providedIn: 'root' });
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertService, decorators: [{
|
|
198
|
+
type: Injectable,
|
|
199
|
+
args: [{
|
|
200
|
+
providedIn: 'root'
|
|
201
|
+
}]
|
|
202
|
+
}] });
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Structural / Slot directive for alert title projection.
|
|
206
|
+
*
|
|
207
|
+
* Usage:
|
|
208
|
+
* ```html
|
|
209
|
+
* <talos-alert>
|
|
210
|
+
* <div talosAlertTitle>System Maintenance</div>
|
|
211
|
+
* <div talosAlertDescription>All services will undergo updates tonight.</div>
|
|
212
|
+
* </talos-alert>
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
class TalosAlertTitleDirective {
|
|
216
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
217
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosAlertTitleDirective, isStandalone: true, selector: "[talosAlertTitle], talos-alert-title", host: { classAttribute: "talos-alert-title-directive" }, ngImport: i0 });
|
|
218
|
+
}
|
|
219
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertTitleDirective, decorators: [{
|
|
220
|
+
type: Directive,
|
|
221
|
+
args: [{
|
|
222
|
+
selector: '[talosAlertTitle], talos-alert-title',
|
|
223
|
+
host: {
|
|
224
|
+
'class': 'talos-alert-title-directive'
|
|
225
|
+
}
|
|
226
|
+
}]
|
|
227
|
+
}] });
|
|
228
|
+
/**
|
|
229
|
+
* Slot directive for alert description / message body.
|
|
230
|
+
*/
|
|
231
|
+
class TalosAlertDescriptionDirective {
|
|
232
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
233
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosAlertDescriptionDirective, isStandalone: true, selector: "[talosAlertDescription], talos-alert-description", host: { classAttribute: "talos-alert-description-directive" }, ngImport: i0 });
|
|
234
|
+
}
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertDescriptionDirective, decorators: [{
|
|
236
|
+
type: Directive,
|
|
237
|
+
args: [{
|
|
238
|
+
selector: '[talosAlertDescription], talos-alert-description',
|
|
239
|
+
host: {
|
|
240
|
+
'class': 'talos-alert-description-directive'
|
|
241
|
+
}
|
|
242
|
+
}]
|
|
243
|
+
}] });
|
|
244
|
+
/**
|
|
245
|
+
* Slot directive for custom alert actions / button group.
|
|
246
|
+
*/
|
|
247
|
+
class TalosAlertActionsDirective {
|
|
248
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
249
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosAlertActionsDirective, isStandalone: true, selector: "[talosAlertActions], talos-alert-actions", host: { classAttribute: "talos-alert-actions-directive" }, ngImport: i0 });
|
|
250
|
+
}
|
|
251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertActionsDirective, decorators: [{
|
|
252
|
+
type: Directive,
|
|
253
|
+
args: [{
|
|
254
|
+
selector: '[talosAlertActions], talos-alert-actions',
|
|
255
|
+
host: {
|
|
256
|
+
'class': 'talos-alert-actions-directive'
|
|
257
|
+
}
|
|
258
|
+
}]
|
|
259
|
+
}] });
|
|
260
|
+
/**
|
|
261
|
+
* Slot directive for custom alert icon.
|
|
262
|
+
*/
|
|
263
|
+
class TalosAlertIconDirective {
|
|
264
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertIconDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
265
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosAlertIconDirective, isStandalone: true, selector: "[talosAlertIcon], talos-alert-icon", host: { classAttribute: "talos-alert-icon-directive" }, ngImport: i0 });
|
|
266
|
+
}
|
|
267
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertIconDirective, decorators: [{
|
|
268
|
+
type: Directive,
|
|
269
|
+
args: [{
|
|
270
|
+
selector: '[talosAlertIcon], talos-alert-icon',
|
|
271
|
+
host: {
|
|
272
|
+
'class': 'talos-alert-icon-directive'
|
|
273
|
+
}
|
|
274
|
+
}]
|
|
275
|
+
}] });
|
|
276
|
+
|
|
277
|
+
class TalosAlertComponent {
|
|
278
|
+
/** Alert severity state: 'success' (default), 'info', 'warning', 'error' */
|
|
279
|
+
severity = input('success', /* @ts-ignore */
|
|
280
|
+
...(ngDevMode ? [{ debugName: "severity" }] : /* istanbul ignore next */ []));
|
|
281
|
+
/** Visual variant theme fallback */
|
|
282
|
+
variant = input(undefined, /* @ts-ignore */
|
|
283
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
284
|
+
/** Visual surface appearance style */
|
|
285
|
+
appearance = input('subtle', /* @ts-ignore */
|
|
286
|
+
...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
287
|
+
/** Sizing of padding and typography */
|
|
288
|
+
size = input('md', /* @ts-ignore */
|
|
289
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
290
|
+
/** Header title text or custom TemplateRef */
|
|
291
|
+
title = input(undefined, /* @ts-ignore */
|
|
292
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
293
|
+
/** Main message content or custom TemplateRef */
|
|
294
|
+
message = input(undefined, /* @ts-ignore */
|
|
295
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
296
|
+
/** Whether to display the icon */
|
|
297
|
+
showIcon = input(true, /* @ts-ignore */
|
|
298
|
+
...(ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []));
|
|
299
|
+
/** Custom Lucide icon component, TemplateRef, or boolean */
|
|
300
|
+
icon = input(null, /* @ts-ignore */
|
|
301
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
302
|
+
/** Whether to display a dedicated severity pill badge */
|
|
303
|
+
showSeverityBadge = input(false, /* @ts-ignore */
|
|
304
|
+
...(ngDevMode ? [{ debugName: "showSeverityBadge" }] : /* istanbul ignore next */ []));
|
|
305
|
+
/** Whether the alert can be dismissed */
|
|
306
|
+
dismissible = input(false, /* @ts-ignore */
|
|
307
|
+
...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
308
|
+
/** Action button text label */
|
|
309
|
+
actionLabel = input(undefined, /* @ts-ignore */
|
|
310
|
+
...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
311
|
+
/** Optional explicit border outline */
|
|
312
|
+
bordered = input(false, /* @ts-ignore */
|
|
313
|
+
...(ngDevMode ? [{ debugName: "bordered" }] : /* istanbul ignore next */ []));
|
|
314
|
+
/** Additional CSS class */
|
|
315
|
+
customClass = input('', /* @ts-ignore */
|
|
316
|
+
...(ngDevMode ? [{ debugName: "customClass" }] : /* istanbul ignore next */ []));
|
|
317
|
+
/** Emitted when dismiss close button is clicked */
|
|
318
|
+
dismiss = output();
|
|
319
|
+
/** Emitted when action button is clicked */
|
|
320
|
+
action = output();
|
|
321
|
+
/** Emitted when dismiss animation has finished and alert is removed */
|
|
322
|
+
closed = output();
|
|
323
|
+
isDismissing = signal(false, /* @ts-ignore */
|
|
324
|
+
...(ngDevMode ? [{ debugName: "isDismissing" }] : /* istanbul ignore next */ []));
|
|
325
|
+
isDismissed = signal(false, /* @ts-ignore */
|
|
326
|
+
...(ngDevMode ? [{ debugName: "isDismissed" }] : /* istanbul ignore next */ []));
|
|
327
|
+
/** Resolved visual variant considering severity */
|
|
328
|
+
resolvedVariant = computed(() => {
|
|
329
|
+
const sev = this.severity();
|
|
330
|
+
if (sev) {
|
|
331
|
+
return sev;
|
|
332
|
+
}
|
|
333
|
+
return this.variant() ?? 'success';
|
|
334
|
+
}, /* @ts-ignore */
|
|
335
|
+
...(ngDevMode ? [{ debugName: "resolvedVariant" }] : /* istanbul ignore next */ []));
|
|
336
|
+
/** Severity display label for badge */
|
|
337
|
+
severityLabel = computed(() => {
|
|
338
|
+
const sev = this.severity();
|
|
339
|
+
if (sev)
|
|
340
|
+
return sev.toUpperCase();
|
|
341
|
+
return '';
|
|
342
|
+
}, /* @ts-ignore */
|
|
343
|
+
...(ngDevMode ? [{ debugName: "severityLabel" }] : /* istanbul ignore next */ []));
|
|
344
|
+
isTitleTemplate = computed(() => this.title() instanceof TemplateRef, /* @ts-ignore */
|
|
345
|
+
...(ngDevMode ? [{ debugName: "isTitleTemplate" }] : /* istanbul ignore next */ []));
|
|
346
|
+
titleTemplate = computed(() => this.title(), /* @ts-ignore */
|
|
347
|
+
...(ngDevMode ? [{ debugName: "titleTemplate" }] : /* istanbul ignore next */ []));
|
|
348
|
+
isMessageTemplate = computed(() => this.message() instanceof TemplateRef, /* @ts-ignore */
|
|
349
|
+
...(ngDevMode ? [{ debugName: "isMessageTemplate" }] : /* istanbul ignore next */ []));
|
|
350
|
+
messageTemplate = computed(() => this.message(), /* @ts-ignore */
|
|
351
|
+
...(ngDevMode ? [{ debugName: "messageTemplate" }] : /* istanbul ignore next */ []));
|
|
352
|
+
isIconTemplate = computed(() => this.icon() instanceof TemplateRef, /* @ts-ignore */
|
|
353
|
+
...(ngDevMode ? [{ debugName: "isIconTemplate" }] : /* istanbul ignore next */ []));
|
|
354
|
+
iconTemplate = computed(() => this.icon(), /* @ts-ignore */
|
|
355
|
+
...(ngDevMode ? [{ debugName: "iconTemplate" }] : /* istanbul ignore next */ []));
|
|
356
|
+
customIconComponent = computed(() => {
|
|
357
|
+
const ic = this.icon();
|
|
358
|
+
return typeof ic === 'function' ? ic : null;
|
|
359
|
+
}, /* @ts-ignore */
|
|
360
|
+
...(ngDevMode ? [{ debugName: "customIconComponent" }] : /* istanbul ignore next */ []));
|
|
361
|
+
ariaRole = computed(() => {
|
|
362
|
+
const v = this.resolvedVariant();
|
|
363
|
+
return v === 'error' || v === 'warning' || v === 'critical' ? 'alert' : 'status';
|
|
364
|
+
}, /* @ts-ignore */
|
|
365
|
+
...(ngDevMode ? [{ debugName: "ariaRole" }] : /* istanbul ignore next */ []));
|
|
366
|
+
ariaLive = computed(() => {
|
|
367
|
+
const v = this.resolvedVariant();
|
|
368
|
+
return v === 'error' || v === 'critical' ? 'assertive' : 'polite';
|
|
369
|
+
}, /* @ts-ignore */
|
|
370
|
+
...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
371
|
+
onActionClick() {
|
|
372
|
+
this.action.emit();
|
|
373
|
+
}
|
|
374
|
+
onCloseClick() {
|
|
375
|
+
if (this.isDismissing() || this.isDismissed())
|
|
376
|
+
return;
|
|
377
|
+
this.isDismissing.set(true);
|
|
378
|
+
this.dismiss.emit();
|
|
379
|
+
setTimeout(() => {
|
|
380
|
+
this.isDismissed.set(true);
|
|
381
|
+
this.closed.emit();
|
|
382
|
+
}, 200);
|
|
383
|
+
}
|
|
384
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
385
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosAlertComponent, isStandalone: true, selector: "talos-alert", inputs: { severity: { classPropertyName: "severity", publicName: "severity", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showSeverityBadge: { classPropertyName: "showSeverityBadge", publicName: "showSeverityBadge", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, bordered: { classPropertyName: "bordered", publicName: "bordered", isSignal: true, isRequired: false, transformFunction: null }, customClass: { classPropertyName: "customClass", publicName: "customClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismiss: "dismiss", action: "action", closed: "closed" }, host: { properties: { "class.talos-alert-host": "true", "class.is-dismissing": "isDismissing()", "class.is-dismissed": "isDismissed()" } }, ngImport: i0, template: "@if (!isDismissed()) {\n<div\n class=\"talos-alert\"\n [class.variant-default]=\"resolvedVariant() === 'default'\"\n [class.variant-info]=\"resolvedVariant() === 'info'\"\n [class.variant-success]=\"resolvedVariant() === 'success'\"\n [class.variant-warning]=\"resolvedVariant() === 'warning'\"\n [class.variant-error]=\"resolvedVariant() === 'error'\"\n [class.variant-primary]=\"resolvedVariant() === 'primary'\"\n [class.variant-critical]=\"resolvedVariant() === 'critical'\"\n [class.appearance-subtle]=\"appearance() === 'subtle'\"\n [class.appearance-outline]=\"appearance() === 'outline'\"\n [class.appearance-filled]=\"appearance() === 'filled'\"\n [class.appearance-accent]=\"appearance() === 'accent'\"\n [class.appearance-left-border]=\"appearance() === 'left-border'\"\n [class.size-sm]=\"size() === 'sm'\"\n [class.size-md]=\"size() === 'md'\"\n [class.size-lg]=\"size() === 'lg'\"\n [class.is-bordered]=\"bordered()\"\n [class.is-dismissing]=\"isDismissing()\"\n [class]=\"customClass()\"\n [attr.role]=\"ariaRole()\"\n [attr.aria-live]=\"ariaLive()\"\n>\n <!-- Icon Section -->\n @if (showIcon() && icon() !== false) {\n <div class=\"talos-alert-icon\" aria-hidden=\"true\">\n @if (isIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"iconTemplate()\"></ng-container>\n } @else if (customIconComponent()) {\n <ng-container *ngComponentOutlet=\"customIconComponent()\"></ng-container>\n } @else {\n <ng-content select=\"[talosAlertIcon], talos-alert-icon\"></ng-content>\n @switch (resolvedVariant()) {\n @case ('critical') {\n <svg lucideAlertOctagon [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('error') {\n <svg lucideCircleAlert [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('primary') {\n <svg lucideShieldAlert [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n }\n }\n </div>\n }\n\n <!-- Main Alert Body & Details -->\n <div class=\"talos-alert-body\">\n <!-- Header: Title & Severity Badge -->\n <div class=\"talos-alert-header\">\n @if (title()) {\n @if (isTitleTemplate()) {\n <div class=\"talos-alert-title\">\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n </div>\n } @else {\n <h4 class=\"talos-alert-title\">{{ title() }}</h4>\n }\n }\n <ng-content select=\"[talosAlertTitle], talos-alert-title\"></ng-content>\n\n @if (showSeverityBadge() && severityLabel()) {\n <span class=\"talos-alert-severity-badge\" [attr.data-severity]=\"resolvedVariant()\">\n {{ severityLabel() }}\n </span>\n }\n </div>\n\n <!-- Message Description Content -->\n <div class=\"talos-alert-message\">\n @if (message()) {\n @if (isMessageTemplate()) {\n <ng-container *ngTemplateOutlet=\"messageTemplate()\"></ng-container>\n } @else {\n <span>{{ message() }}</span>\n }\n }\n <ng-content select=\"[talosAlertDescription], talos-alert-description\"></ng-content>\n <ng-content></ng-content>\n </div>\n </div>\n\n <!-- Actions & Close Button -->\n <div class=\"talos-alert-actions\">\n <ng-content select=\"[talosAlertActions], talos-alert-actions\"></ng-content>\n\n @if (actionLabel()) {\n <button type=\"button\" class=\"talos-alert-action-btn\" (click)=\"onActionClick()\">\n {{ actionLabel() }}\n </button>\n }\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"talos-alert-close-btn\"\n aria-label=\"Dismiss alert\"\n (click)=\"onCloseClick()\"\n >\n <svg lucideX [size]=\"size() === 'sm' ? 14 : 16\"></svg>\n </button>\n }\n </div>\n</div>\n}\n", styles: [":host{display:block;width:100%;transition:opacity .2s ease,transform .2s ease,max-height .2s ease,margin .2s ease}:host.is-dismissing{opacity:0;transform:translateY(-4px) scale(.98);pointer-events:none}:host.is-dismissed{display:none!important}.talos-alert{position:relative;display:flex;align-items:flex-start;gap:var(--talos-alert-gap, .75rem);width:100%;border-radius:var(--talos-alert-radius, .5rem);box-sizing:border-box;font-family:inherit;transition:all .2s ease-in-out}.talos-alert.size-sm{padding:var(--talos-alert-padding-sm, .5rem .75rem);font-size:.8125rem}.talos-alert.size-sm .talos-alert-title{font-size:.875rem}.talos-alert.size-md{padding:var(--talos-alert-padding-md, .75rem 1rem);font-size:.875rem}.talos-alert.size-md .talos-alert-title{font-size:.9375rem}.talos-alert.size-lg{padding:var(--talos-alert-padding-lg, 1rem 1.25rem);font-size:.9375rem}.talos-alert.size-lg .talos-alert-title{font-size:1.0625rem}.talos-alert.is-bordered{border-width:1px;border-style:solid}.talos-alert.appearance-subtle{border:1px solid transparent}.talos-alert.appearance-subtle.variant-default{background-color:var(--talos-alert-default-bg);border-color:var(--talos-alert-default-border);color:var(--talos-alert-default-text)}.talos-alert.appearance-subtle.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-subtle.variant-info{background-color:var(--talos-alert-info-bg);border-color:var(--talos-alert-info-border);color:var(--talos-alert-info-text)}.talos-alert.appearance-subtle.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-subtle.variant-success{background-color:var(--talos-alert-success-bg);border-color:var(--talos-alert-success-border);color:var(--talos-alert-success-text)}.talos-alert.appearance-subtle.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-subtle.variant-warning{background-color:var(--talos-alert-warning-bg);border-color:var(--talos-alert-warning-border);color:var(--talos-alert-warning-text)}.talos-alert.appearance-subtle.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-subtle.variant-error{background-color:var(--talos-alert-error-bg);border-color:var(--talos-alert-error-border);color:var(--talos-alert-error-text)}.talos-alert.appearance-subtle.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-subtle.variant-critical{background-color:var(--talos-alert-critical-bg);border-color:var(--talos-alert-critical-border);color:var(--talos-alert-critical-text)}.talos-alert.appearance-subtle.variant-critical .talos-alert-icon{color:var(--talos-alert-critical-icon)}.talos-alert.appearance-subtle.variant-primary{background-color:var(--talos-alert-primary-bg);border-color:var(--talos-alert-primary-border);color:var(--talos-alert-primary-text)}.talos-alert.appearance-subtle.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert.appearance-outline{background-color:transparent;border:1px solid currentColor}.talos-alert.appearance-outline.variant-default{border-color:var(--talos-alert-default-border);color:var(--talos-alert-default-text)}.talos-alert.appearance-outline.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-outline.variant-info{border-color:var(--talos-alert-info-icon);color:var(--talos-alert-info-icon)}.talos-alert.appearance-outline.variant-info .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-outline.variant-success{border-color:var(--talos-alert-success-icon);color:var(--talos-alert-success-icon)}.talos-alert.appearance-outline.variant-success .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-outline.variant-warning{border-color:var(--talos-alert-warning-icon);color:var(--talos-alert-warning-icon)}.talos-alert.appearance-outline.variant-warning .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-outline.variant-error{border-color:var(--talos-alert-error-icon);color:var(--talos-alert-error-icon)}.talos-alert.appearance-outline.variant-error .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-outline.variant-critical{border-color:var(--talos-alert-critical-border);color:var(--talos-alert-critical-icon)}.talos-alert.appearance-outline.variant-critical .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-critical .talos-alert-icon{color:var(--talos-alert-critical-icon)}.talos-alert.appearance-outline.variant-primary{border-color:var(--talos-alert-primary-icon);color:var(--talos-alert-primary-icon)}.talos-alert.appearance-outline.variant-primary .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert.appearance-filled{border:1px solid transparent;color:#fff}.talos-alert.appearance-filled .talos-alert-icon,.talos-alert.appearance-filled .talos-alert-title{color:#fff}.talos-alert.appearance-filled .talos-alert-message{color:#ffffffeb}.talos-alert.appearance-filled.variant-default{background-color:#475569}.talos-alert.appearance-filled.variant-info{background-color:#2563eb}.talos-alert.appearance-filled.variant-success{background-color:#16a34a}.talos-alert.appearance-filled.variant-warning{background-color:#d97706}.talos-alert.appearance-filled.variant-error{background-color:#dc2626}.talos-alert.appearance-filled.variant-critical{background-color:#991b1b;box-shadow:0 0 15px #dc262666}.talos-alert.appearance-filled.variant-primary{background-color:#2563eb}.talos-alert.appearance-filled .talos-alert-action-btn{background-color:#fff3;color:#fff;border-color:#ffffff59}.talos-alert.appearance-filled .talos-alert-action-btn:hover{background-color:#ffffff4d}.talos-alert.appearance-filled .talos-alert-close-btn{color:#fffc}.talos-alert.appearance-filled .talos-alert-close-btn:hover{background-color:#fff3;color:#fff}.talos-alert.appearance-accent,.talos-alert.appearance-left-border{background-color:var(--talos-card-bg, #ffffff);border:1px solid var(--talos-border-color, #e2e8f0);border-left-width:4px;box-shadow:var(--talos-alert-shadow);color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-accent.variant-default,.talos-alert.appearance-left-border.variant-default{border-left-color:var(--talos-alert-default-icon)}.talos-alert.appearance-accent.variant-default .talos-alert-icon,.talos-alert.appearance-left-border.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-accent.variant-info,.talos-alert.appearance-left-border.variant-info{border-left-color:var(--talos-alert-info-icon)}.talos-alert.appearance-accent.variant-info .talos-alert-icon,.talos-alert.appearance-left-border.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-accent.variant-success,.talos-alert.appearance-left-border.variant-success{border-left-color:var(--talos-alert-success-icon)}.talos-alert.appearance-accent.variant-success .talos-alert-icon,.talos-alert.appearance-left-border.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-accent.variant-warning,.talos-alert.appearance-left-border.variant-warning{border-left-color:var(--talos-alert-warning-icon)}.talos-alert.appearance-accent.variant-warning .talos-alert-icon,.talos-alert.appearance-left-border.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-accent.variant-error,.talos-alert.appearance-left-border.variant-error{border-left-color:var(--talos-alert-error-icon)}.talos-alert.appearance-accent.variant-error .talos-alert-icon,.talos-alert.appearance-left-border.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-accent.variant-critical,.talos-alert.appearance-left-border.variant-critical{border-left-color:#ef4444}.talos-alert.appearance-accent.variant-critical .talos-alert-icon,.talos-alert.appearance-left-border.variant-critical .talos-alert-icon{color:#ef4444}.talos-alert.appearance-accent.variant-primary,.talos-alert.appearance-left-border.variant-primary{border-left-color:var(--talos-alert-primary-icon)}.talos-alert.appearance-accent.variant-primary .talos-alert-icon,.talos-alert.appearance-left-border.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px;line-height:1}.talos-alert-icon svg{display:block}.talos-alert-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:.25rem}.talos-alert-header{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}.talos-alert-title{margin:0;font-weight:600;line-height:1.35;color:inherit}.talos-alert-message{line-height:1.45;color:inherit;opacity:.95}.talos-alert-severity-badge{display:inline-flex;align-items:center;padding:.125rem .4375rem;border-radius:9999px;font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;background-color:#00000014;color:inherit}.talos-alert-severity-badge[data-severity=critical]{background-color:#ef4444;color:#fff}.talos-alert-severity-badge[data-severity=error]{background-color:#ef444433;color:#dc2626}.talos-alert-severity-badge[data-severity=warning]{background-color:#f59e0b33;color:#b45309}.talos-alert-severity-badge[data-severity=info]{background-color:#3b82f633;color:#1d4ed8}.talos-alert-severity-badge[data-severity=success]{background-color:#22c55e33;color:#15803d}.talos-alert-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0;margin-left:auto}.talos-alert-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem .625rem;font-size:.75rem;font-weight:600;border-radius:var(--talos-border-radius, .375rem);border:1px solid currentColor;background-color:transparent;color:inherit;cursor:pointer;transition:all .15s ease}.talos-alert-action-btn:hover{background-color:#0000000f}.talos-alert-action-btn:active{transform:scale(.97)}.talos-alert-close-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border:none;background:transparent;color:inherit;opacity:.7;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:all .15s ease}.talos-alert-close-btn:hover{opacity:1;background-color:#00000014}.talos-alert-close-btn:active{transform:scale(.92)}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideInfo, selector: "svg[lucideInfo]" }, { kind: "component", type: LucideCheckCircle2, selector: "svg[lucideCircleCheck], svg[lucideCheckCircle2]" }, { kind: "component", type: LucideAlertTriangle, selector: "svg[lucideTriangleAlert], svg[lucideAlertTriangle]" }, { kind: "component", type: LucideCircleAlert, selector: "svg[lucideCircleAlert], svg[lucideAlertCircle]" }, { kind: "component", type: LucideAlertOctagon, selector: "svg[lucideOctagonAlert], svg[lucideAlertOctagon]" }, { kind: "component", type: LucideShieldAlert, selector: "svg[lucideShieldAlert]" }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] });
|
|
386
|
+
}
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertComponent, decorators: [{
|
|
388
|
+
type: Component,
|
|
389
|
+
args: [{ selector: 'talos-alert', imports: [
|
|
390
|
+
NgComponentOutlet,
|
|
391
|
+
NgTemplateOutlet,
|
|
392
|
+
LucideInfo,
|
|
393
|
+
LucideCheckCircle2,
|
|
394
|
+
LucideAlertTriangle,
|
|
395
|
+
LucideCircleAlert,
|
|
396
|
+
LucideAlertOctagon,
|
|
397
|
+
LucideShieldAlert,
|
|
398
|
+
LucideX
|
|
399
|
+
], host: {
|
|
400
|
+
'[class.talos-alert-host]': 'true',
|
|
401
|
+
'[class.is-dismissing]': 'isDismissing()',
|
|
402
|
+
'[class.is-dismissed]': 'isDismissed()'
|
|
403
|
+
}, template: "@if (!isDismissed()) {\n<div\n class=\"talos-alert\"\n [class.variant-default]=\"resolvedVariant() === 'default'\"\n [class.variant-info]=\"resolvedVariant() === 'info'\"\n [class.variant-success]=\"resolvedVariant() === 'success'\"\n [class.variant-warning]=\"resolvedVariant() === 'warning'\"\n [class.variant-error]=\"resolvedVariant() === 'error'\"\n [class.variant-primary]=\"resolvedVariant() === 'primary'\"\n [class.variant-critical]=\"resolvedVariant() === 'critical'\"\n [class.appearance-subtle]=\"appearance() === 'subtle'\"\n [class.appearance-outline]=\"appearance() === 'outline'\"\n [class.appearance-filled]=\"appearance() === 'filled'\"\n [class.appearance-accent]=\"appearance() === 'accent'\"\n [class.appearance-left-border]=\"appearance() === 'left-border'\"\n [class.size-sm]=\"size() === 'sm'\"\n [class.size-md]=\"size() === 'md'\"\n [class.size-lg]=\"size() === 'lg'\"\n [class.is-bordered]=\"bordered()\"\n [class.is-dismissing]=\"isDismissing()\"\n [class]=\"customClass()\"\n [attr.role]=\"ariaRole()\"\n [attr.aria-live]=\"ariaLive()\"\n>\n <!-- Icon Section -->\n @if (showIcon() && icon() !== false) {\n <div class=\"talos-alert-icon\" aria-hidden=\"true\">\n @if (isIconTemplate()) {\n <ng-container *ngTemplateOutlet=\"iconTemplate()\"></ng-container>\n } @else if (customIconComponent()) {\n <ng-container *ngComponentOutlet=\"customIconComponent()\"></ng-container>\n } @else {\n <ng-content select=\"[talosAlertIcon], talos-alert-icon\"></ng-content>\n @switch (resolvedVariant()) {\n @case ('critical') {\n <svg lucideAlertOctagon [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('error') {\n <svg lucideCircleAlert [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @case ('primary') {\n <svg lucideShieldAlert [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"size() === 'sm' ? 16 : size() === 'lg' ? 24 : 20\"></svg>\n }\n }\n }\n </div>\n }\n\n <!-- Main Alert Body & Details -->\n <div class=\"talos-alert-body\">\n <!-- Header: Title & Severity Badge -->\n <div class=\"talos-alert-header\">\n @if (title()) {\n @if (isTitleTemplate()) {\n <div class=\"talos-alert-title\">\n <ng-container *ngTemplateOutlet=\"titleTemplate()\"></ng-container>\n </div>\n } @else {\n <h4 class=\"talos-alert-title\">{{ title() }}</h4>\n }\n }\n <ng-content select=\"[talosAlertTitle], talos-alert-title\"></ng-content>\n\n @if (showSeverityBadge() && severityLabel()) {\n <span class=\"talos-alert-severity-badge\" [attr.data-severity]=\"resolvedVariant()\">\n {{ severityLabel() }}\n </span>\n }\n </div>\n\n <!-- Message Description Content -->\n <div class=\"talos-alert-message\">\n @if (message()) {\n @if (isMessageTemplate()) {\n <ng-container *ngTemplateOutlet=\"messageTemplate()\"></ng-container>\n } @else {\n <span>{{ message() }}</span>\n }\n }\n <ng-content select=\"[talosAlertDescription], talos-alert-description\"></ng-content>\n <ng-content></ng-content>\n </div>\n </div>\n\n <!-- Actions & Close Button -->\n <div class=\"talos-alert-actions\">\n <ng-content select=\"[talosAlertActions], talos-alert-actions\"></ng-content>\n\n @if (actionLabel()) {\n <button type=\"button\" class=\"talos-alert-action-btn\" (click)=\"onActionClick()\">\n {{ actionLabel() }}\n </button>\n }\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"talos-alert-close-btn\"\n aria-label=\"Dismiss alert\"\n (click)=\"onCloseClick()\"\n >\n <svg lucideX [size]=\"size() === 'sm' ? 14 : 16\"></svg>\n </button>\n }\n </div>\n</div>\n}\n", styles: [":host{display:block;width:100%;transition:opacity .2s ease,transform .2s ease,max-height .2s ease,margin .2s ease}:host.is-dismissing{opacity:0;transform:translateY(-4px) scale(.98);pointer-events:none}:host.is-dismissed{display:none!important}.talos-alert{position:relative;display:flex;align-items:flex-start;gap:var(--talos-alert-gap, .75rem);width:100%;border-radius:var(--talos-alert-radius, .5rem);box-sizing:border-box;font-family:inherit;transition:all .2s ease-in-out}.talos-alert.size-sm{padding:var(--talos-alert-padding-sm, .5rem .75rem);font-size:.8125rem}.talos-alert.size-sm .talos-alert-title{font-size:.875rem}.talos-alert.size-md{padding:var(--talos-alert-padding-md, .75rem 1rem);font-size:.875rem}.talos-alert.size-md .talos-alert-title{font-size:.9375rem}.talos-alert.size-lg{padding:var(--talos-alert-padding-lg, 1rem 1.25rem);font-size:.9375rem}.talos-alert.size-lg .talos-alert-title{font-size:1.0625rem}.talos-alert.is-bordered{border-width:1px;border-style:solid}.talos-alert.appearance-subtle{border:1px solid transparent}.talos-alert.appearance-subtle.variant-default{background-color:var(--talos-alert-default-bg);border-color:var(--talos-alert-default-border);color:var(--talos-alert-default-text)}.talos-alert.appearance-subtle.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-subtle.variant-info{background-color:var(--talos-alert-info-bg);border-color:var(--talos-alert-info-border);color:var(--talos-alert-info-text)}.talos-alert.appearance-subtle.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-subtle.variant-success{background-color:var(--talos-alert-success-bg);border-color:var(--talos-alert-success-border);color:var(--talos-alert-success-text)}.talos-alert.appearance-subtle.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-subtle.variant-warning{background-color:var(--talos-alert-warning-bg);border-color:var(--talos-alert-warning-border);color:var(--talos-alert-warning-text)}.talos-alert.appearance-subtle.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-subtle.variant-error{background-color:var(--talos-alert-error-bg);border-color:var(--talos-alert-error-border);color:var(--talos-alert-error-text)}.talos-alert.appearance-subtle.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-subtle.variant-critical{background-color:var(--talos-alert-critical-bg);border-color:var(--talos-alert-critical-border);color:var(--talos-alert-critical-text)}.talos-alert.appearance-subtle.variant-critical .talos-alert-icon{color:var(--talos-alert-critical-icon)}.talos-alert.appearance-subtle.variant-primary{background-color:var(--talos-alert-primary-bg);border-color:var(--talos-alert-primary-border);color:var(--talos-alert-primary-text)}.talos-alert.appearance-subtle.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert.appearance-outline{background-color:transparent;border:1px solid currentColor}.talos-alert.appearance-outline.variant-default{border-color:var(--talos-alert-default-border);color:var(--talos-alert-default-text)}.talos-alert.appearance-outline.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-outline.variant-info{border-color:var(--talos-alert-info-icon);color:var(--talos-alert-info-icon)}.talos-alert.appearance-outline.variant-info .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-outline.variant-success{border-color:var(--talos-alert-success-icon);color:var(--talos-alert-success-icon)}.talos-alert.appearance-outline.variant-success .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-outline.variant-warning{border-color:var(--talos-alert-warning-icon);color:var(--talos-alert-warning-icon)}.talos-alert.appearance-outline.variant-warning .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-outline.variant-error{border-color:var(--talos-alert-error-icon);color:var(--talos-alert-error-icon)}.talos-alert.appearance-outline.variant-error .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-outline.variant-critical{border-color:var(--talos-alert-critical-border);color:var(--talos-alert-critical-icon)}.talos-alert.appearance-outline.variant-critical .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-critical .talos-alert-icon{color:var(--talos-alert-critical-icon)}.talos-alert.appearance-outline.variant-primary{border-color:var(--talos-alert-primary-icon);color:var(--talos-alert-primary-icon)}.talos-alert.appearance-outline.variant-primary .talos-alert-body{color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-outline.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert.appearance-filled{border:1px solid transparent;color:#fff}.talos-alert.appearance-filled .talos-alert-icon,.talos-alert.appearance-filled .talos-alert-title{color:#fff}.talos-alert.appearance-filled .talos-alert-message{color:#ffffffeb}.talos-alert.appearance-filled.variant-default{background-color:#475569}.talos-alert.appearance-filled.variant-info{background-color:#2563eb}.talos-alert.appearance-filled.variant-success{background-color:#16a34a}.talos-alert.appearance-filled.variant-warning{background-color:#d97706}.talos-alert.appearance-filled.variant-error{background-color:#dc2626}.talos-alert.appearance-filled.variant-critical{background-color:#991b1b;box-shadow:0 0 15px #dc262666}.talos-alert.appearance-filled.variant-primary{background-color:#2563eb}.talos-alert.appearance-filled .talos-alert-action-btn{background-color:#fff3;color:#fff;border-color:#ffffff59}.talos-alert.appearance-filled .talos-alert-action-btn:hover{background-color:#ffffff4d}.talos-alert.appearance-filled .talos-alert-close-btn{color:#fffc}.talos-alert.appearance-filled .talos-alert-close-btn:hover{background-color:#fff3;color:#fff}.talos-alert.appearance-accent,.talos-alert.appearance-left-border{background-color:var(--talos-card-bg, #ffffff);border:1px solid var(--talos-border-color, #e2e8f0);border-left-width:4px;box-shadow:var(--talos-alert-shadow);color:var(--talos-text-color, #0f172a)}.talos-alert.appearance-accent.variant-default,.talos-alert.appearance-left-border.variant-default{border-left-color:var(--talos-alert-default-icon)}.talos-alert.appearance-accent.variant-default .talos-alert-icon,.talos-alert.appearance-left-border.variant-default .talos-alert-icon{color:var(--talos-alert-default-icon)}.talos-alert.appearance-accent.variant-info,.talos-alert.appearance-left-border.variant-info{border-left-color:var(--talos-alert-info-icon)}.talos-alert.appearance-accent.variant-info .talos-alert-icon,.talos-alert.appearance-left-border.variant-info .talos-alert-icon{color:var(--talos-alert-info-icon)}.talos-alert.appearance-accent.variant-success,.talos-alert.appearance-left-border.variant-success{border-left-color:var(--talos-alert-success-icon)}.talos-alert.appearance-accent.variant-success .talos-alert-icon,.talos-alert.appearance-left-border.variant-success .talos-alert-icon{color:var(--talos-alert-success-icon)}.talos-alert.appearance-accent.variant-warning,.talos-alert.appearance-left-border.variant-warning{border-left-color:var(--talos-alert-warning-icon)}.talos-alert.appearance-accent.variant-warning .talos-alert-icon,.talos-alert.appearance-left-border.variant-warning .talos-alert-icon{color:var(--talos-alert-warning-icon)}.talos-alert.appearance-accent.variant-error,.talos-alert.appearance-left-border.variant-error{border-left-color:var(--talos-alert-error-icon)}.talos-alert.appearance-accent.variant-error .talos-alert-icon,.talos-alert.appearance-left-border.variant-error .talos-alert-icon{color:var(--talos-alert-error-icon)}.talos-alert.appearance-accent.variant-critical,.talos-alert.appearance-left-border.variant-critical{border-left-color:#ef4444}.talos-alert.appearance-accent.variant-critical .talos-alert-icon,.talos-alert.appearance-left-border.variant-critical .talos-alert-icon{color:#ef4444}.talos-alert.appearance-accent.variant-primary,.talos-alert.appearance-left-border.variant-primary{border-left-color:var(--talos-alert-primary-icon)}.talos-alert.appearance-accent.variant-primary .talos-alert-icon,.talos-alert.appearance-left-border.variant-primary .talos-alert-icon{color:var(--talos-alert-primary-icon)}.talos-alert-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:1px;line-height:1}.talos-alert-icon svg{display:block}.talos-alert-body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:.25rem}.talos-alert-header{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem}.talos-alert-title{margin:0;font-weight:600;line-height:1.35;color:inherit}.talos-alert-message{line-height:1.45;color:inherit;opacity:.95}.talos-alert-severity-badge{display:inline-flex;align-items:center;padding:.125rem .4375rem;border-radius:9999px;font-size:.6875rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;background-color:#00000014;color:inherit}.talos-alert-severity-badge[data-severity=critical]{background-color:#ef4444;color:#fff}.talos-alert-severity-badge[data-severity=error]{background-color:#ef444433;color:#dc2626}.talos-alert-severity-badge[data-severity=warning]{background-color:#f59e0b33;color:#b45309}.talos-alert-severity-badge[data-severity=info]{background-color:#3b82f633;color:#1d4ed8}.talos-alert-severity-badge[data-severity=success]{background-color:#22c55e33;color:#15803d}.talos-alert-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0;margin-left:auto}.talos-alert-action-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem .625rem;font-size:.75rem;font-weight:600;border-radius:var(--talos-border-radius, .375rem);border:1px solid currentColor;background-color:transparent;color:inherit;cursor:pointer;transition:all .15s ease}.talos-alert-action-btn:hover{background-color:#0000000f}.talos-alert-action-btn:active{transform:scale(.97)}.talos-alert-close-btn{display:inline-flex;align-items:center;justify-content:center;padding:.25rem;border:none;background:transparent;color:inherit;opacity:.7;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:all .15s ease}.talos-alert-close-btn:hover{opacity:1;background-color:#00000014}.talos-alert-close-btn:active{transform:scale(.92)}\n"] }]
|
|
404
|
+
}], propDecorators: { severity: [{ type: i0.Input, args: [{ isSignal: true, alias: "severity", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], showSeverityBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeverityBadge", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], bordered: [{ type: i0.Input, args: [{ isSignal: true, alias: "bordered", required: false }] }], customClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "customClass", required: false }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }], action: [{ type: i0.Output, args: ["action"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
405
|
+
|
|
406
|
+
class TalosAlertContainerComponent {
|
|
407
|
+
alertService = inject(TalosAlertService);
|
|
408
|
+
/** Mode of alerts to render from the service ('inline', 'banner', or 'all') */
|
|
409
|
+
type = input('inline', /* @ts-ignore */
|
|
410
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
411
|
+
targetAlerts = computed(() => {
|
|
412
|
+
const t = this.type();
|
|
413
|
+
if (t === 'banner') {
|
|
414
|
+
return this.alertService.bannerAlerts();
|
|
415
|
+
}
|
|
416
|
+
if (t === 'all') {
|
|
417
|
+
return [...this.alertService.bannerAlerts(), ...this.alertService.alerts()];
|
|
418
|
+
}
|
|
419
|
+
return this.alertService.alerts();
|
|
420
|
+
}, /* @ts-ignore */
|
|
421
|
+
...(ngDevMode ? [{ debugName: "targetAlerts" }] : /* istanbul ignore next */ []));
|
|
422
|
+
onDismiss(id) {
|
|
423
|
+
if (this.type() === 'banner') {
|
|
424
|
+
this.alertService.dismissBanner(id);
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
this.alertService.dismiss(id);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
onAction(item) {
|
|
431
|
+
if (item.onAction) {
|
|
432
|
+
item.onAction();
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
436
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosAlertContainerComponent, isStandalone: true, selector: "talos-alert-container", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-alert-container-host": "true" } }, ngImport: i0, template: `
|
|
437
|
+
@if (targetAlerts().length > 0) {
|
|
438
|
+
<div class="talos-alert-container-stack" [class.is-banner]="type() === 'banner'">
|
|
439
|
+
@for (item of targetAlerts(); track item.id) {
|
|
440
|
+
<talos-alert
|
|
441
|
+
[variant]="item.variant || 'default'"
|
|
442
|
+
[severity]="item.severity"
|
|
443
|
+
[appearance]="item.appearance || 'subtle'"
|
|
444
|
+
[size]="item.size || 'md'"
|
|
445
|
+
[title]="item.title"
|
|
446
|
+
[message]="item.message"
|
|
447
|
+
[showIcon]="item.showIcon ?? true"
|
|
448
|
+
[icon]="item.icon"
|
|
449
|
+
[showSeverityBadge]="item.showSeverityBadge ?? false"
|
|
450
|
+
[dismissible]="item.dismissible ?? true"
|
|
451
|
+
[actionLabel]="item.actionLabel"
|
|
452
|
+
[bordered]="item.bordered ?? false"
|
|
453
|
+
[customClass]="item.customClass || ''"
|
|
454
|
+
(dismiss)="onDismiss(item.id)"
|
|
455
|
+
(action)="onAction(item)"
|
|
456
|
+
/>
|
|
457
|
+
}
|
|
458
|
+
</div>
|
|
459
|
+
}
|
|
460
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.talos-alert-container-stack{display:flex;flex-direction:column;gap:.75rem;width:100%}.talos-alert-container-stack.is-banner{gap:.5rem}.talos-alert-container-stack.is-banner talos-alert{border-radius:0;box-shadow:0 2px 8px #0000001a}\n"], dependencies: [{ kind: "component", type: TalosAlertComponent, selector: "talos-alert", inputs: ["severity", "variant", "appearance", "size", "title", "message", "showIcon", "icon", "showSeverityBadge", "dismissible", "actionLabel", "bordered", "customClass"], outputs: ["dismiss", "action", "closed"] }] });
|
|
461
|
+
}
|
|
462
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertContainerComponent, decorators: [{
|
|
463
|
+
type: Component,
|
|
464
|
+
args: [{ selector: 'talos-alert-container', imports: [TalosAlertComponent], template: `
|
|
465
|
+
@if (targetAlerts().length > 0) {
|
|
466
|
+
<div class="talos-alert-container-stack" [class.is-banner]="type() === 'banner'">
|
|
467
|
+
@for (item of targetAlerts(); track item.id) {
|
|
468
|
+
<talos-alert
|
|
469
|
+
[variant]="item.variant || 'default'"
|
|
470
|
+
[severity]="item.severity"
|
|
471
|
+
[appearance]="item.appearance || 'subtle'"
|
|
472
|
+
[size]="item.size || 'md'"
|
|
473
|
+
[title]="item.title"
|
|
474
|
+
[message]="item.message"
|
|
475
|
+
[showIcon]="item.showIcon ?? true"
|
|
476
|
+
[icon]="item.icon"
|
|
477
|
+
[showSeverityBadge]="item.showSeverityBadge ?? false"
|
|
478
|
+
[dismissible]="item.dismissible ?? true"
|
|
479
|
+
[actionLabel]="item.actionLabel"
|
|
480
|
+
[bordered]="item.bordered ?? false"
|
|
481
|
+
[customClass]="item.customClass || ''"
|
|
482
|
+
(dismiss)="onDismiss(item.id)"
|
|
483
|
+
(action)="onAction(item)"
|
|
484
|
+
/>
|
|
485
|
+
}
|
|
486
|
+
</div>
|
|
487
|
+
}
|
|
488
|
+
`, host: {
|
|
489
|
+
'[class.talos-alert-container-host]': 'true'
|
|
490
|
+
}, styles: [":host{display:block;width:100%}.talos-alert-container-stack{display:flex;flex-direction:column;gap:.75rem;width:100%}.talos-alert-container-stack.is-banner{gap:.5rem}.talos-alert-container-stack.is-banner talos-alert{border-radius:0;box-shadow:0 2px 8px #0000001a}\n"] }]
|
|
491
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Convenience NgModule wrapping standalone alert components and directives.
|
|
495
|
+
*/
|
|
496
|
+
class TalosAlertModule {
|
|
497
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
498
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertModule, imports: [TalosAlertComponent,
|
|
499
|
+
TalosAlertContainerComponent,
|
|
500
|
+
TalosAlertTitleDirective,
|
|
501
|
+
TalosAlertDescriptionDirective,
|
|
502
|
+
TalosAlertActionsDirective,
|
|
503
|
+
TalosAlertIconDirective], exports: [TalosAlertComponent,
|
|
504
|
+
TalosAlertContainerComponent,
|
|
505
|
+
TalosAlertTitleDirective,
|
|
506
|
+
TalosAlertDescriptionDirective,
|
|
507
|
+
TalosAlertActionsDirective,
|
|
508
|
+
TalosAlertIconDirective] });
|
|
509
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertModule, imports: [TalosAlertComponent,
|
|
510
|
+
TalosAlertContainerComponent] });
|
|
511
|
+
}
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosAlertModule, decorators: [{
|
|
513
|
+
type: NgModule,
|
|
514
|
+
args: [{
|
|
515
|
+
imports: [
|
|
516
|
+
TalosAlertComponent,
|
|
517
|
+
TalosAlertContainerComponent,
|
|
518
|
+
TalosAlertTitleDirective,
|
|
519
|
+
TalosAlertDescriptionDirective,
|
|
520
|
+
TalosAlertActionsDirective,
|
|
521
|
+
TalosAlertIconDirective
|
|
522
|
+
],
|
|
523
|
+
exports: [
|
|
524
|
+
TalosAlertComponent,
|
|
525
|
+
TalosAlertContainerComponent,
|
|
526
|
+
TalosAlertTitleDirective,
|
|
527
|
+
TalosAlertDescriptionDirective,
|
|
528
|
+
TalosAlertActionsDirective,
|
|
529
|
+
TalosAlertIconDirective
|
|
530
|
+
]
|
|
531
|
+
}]
|
|
532
|
+
}] });
|
|
533
|
+
|
|
534
|
+
/** Injection token for data passed to a dialog component */
|
|
535
|
+
const TALOS_DIALOG_DATA = new InjectionToken('TALOS_DIALOG_DATA');
|
|
536
|
+
/** Injection token for dialog configuration */
|
|
537
|
+
const TALOS_DIALOG_CONFIG = new InjectionToken('TALOS_DIALOG_CONFIG');
|
|
538
|
+
/** Injection token for dialog reference */
|
|
539
|
+
const TALOS_DIALOG_REF = new InjectionToken('TALOS_DIALOG_REF');
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Reference to an actively open dialog instance.
|
|
543
|
+
*/
|
|
544
|
+
class TalosDialogRef {
|
|
545
|
+
cdkDialogRef;
|
|
546
|
+
config;
|
|
547
|
+
data;
|
|
548
|
+
constructor(cdkDialogRef, config, data) {
|
|
549
|
+
this.cdkDialogRef = cdkDialogRef;
|
|
550
|
+
this.config = config;
|
|
551
|
+
this.data = data;
|
|
552
|
+
}
|
|
553
|
+
/** Unique identifier for the dialog */
|
|
554
|
+
get id() {
|
|
555
|
+
return this.cdkDialogRef.id;
|
|
556
|
+
}
|
|
557
|
+
/** Observable that emits when the dialog is closed with the result value */
|
|
558
|
+
get closed() {
|
|
559
|
+
return this.cdkDialogRef.closed;
|
|
560
|
+
}
|
|
561
|
+
/** Observable that emits when the backdrop overlay is clicked */
|
|
562
|
+
get backdropClick() {
|
|
563
|
+
return this.cdkDialogRef.backdropClick;
|
|
564
|
+
}
|
|
565
|
+
/** Observable that emits keyboard events received by the dialog overlay */
|
|
566
|
+
get keydownEvents() {
|
|
567
|
+
return this.cdkDialogRef.keydownEvents;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Close the dialog, optionally returning a result value to the opener.
|
|
571
|
+
*/
|
|
572
|
+
close(result) {
|
|
573
|
+
this.cdkDialogRef.close(result);
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Dynamically update the size of the dialog panel.
|
|
577
|
+
*/
|
|
578
|
+
updateSize(width = '', height = '') {
|
|
579
|
+
this.cdkDialogRef.updateSize(width, height);
|
|
580
|
+
return this;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Add CSS class(es) to the dialog overlay panel.
|
|
584
|
+
*/
|
|
585
|
+
addPanelClass(classes) {
|
|
586
|
+
this.cdkDialogRef.addPanelClass(classes);
|
|
587
|
+
return this;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Remove CSS class(es) from the dialog overlay panel.
|
|
591
|
+
*/
|
|
592
|
+
removePanelClass(classes) {
|
|
593
|
+
this.cdkDialogRef.removePanelClass(classes);
|
|
594
|
+
return this;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
let uniqueTitleId = 0;
|
|
599
|
+
let uniqueDescId = 0;
|
|
600
|
+
/**
|
|
601
|
+
* Directive for the dialog title element.
|
|
602
|
+
* Automatically handles accessible ARIA labeling.
|
|
603
|
+
*/
|
|
604
|
+
class TalosDialogTitleDirective {
|
|
605
|
+
/** Optional custom ID for accessibility linking */
|
|
606
|
+
id = input(`talos-dialog-title-${++uniqueTitleId}`, /* @ts-ignore */
|
|
607
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
608
|
+
dialogRef = inject(DialogRef, { optional: true });
|
|
609
|
+
ngOnInit() {
|
|
610
|
+
if (this.dialogRef) {
|
|
611
|
+
// Allow CDK or parent container to associate the title ID
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
615
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosDialogTitleDirective, isStandalone: true, selector: "[talosDialogTitle]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()" }, classAttribute: "talos-dialog-title" }, ngImport: i0 });
|
|
616
|
+
}
|
|
617
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogTitleDirective, decorators: [{
|
|
618
|
+
type: Directive,
|
|
619
|
+
args: [{
|
|
620
|
+
selector: '[talosDialogTitle]',
|
|
621
|
+
host: {
|
|
622
|
+
'class': 'talos-dialog-title',
|
|
623
|
+
'[attr.id]': 'id()'
|
|
624
|
+
}
|
|
625
|
+
}]
|
|
626
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
627
|
+
/**
|
|
628
|
+
* Directive for the dialog description/subtitle element.
|
|
629
|
+
* Automatically handles accessible ARIA descriptions.
|
|
630
|
+
*/
|
|
631
|
+
class TalosDialogDescriptionDirective {
|
|
632
|
+
/** Optional custom ID for accessibility linking */
|
|
633
|
+
id = input(`talos-dialog-desc-${++uniqueDescId}`, /* @ts-ignore */
|
|
634
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
635
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogDescriptionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
636
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosDialogDescriptionDirective, isStandalone: true, selector: "[talosDialogDescription]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()" }, classAttribute: "talos-dialog-description" }, ngImport: i0 });
|
|
637
|
+
}
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogDescriptionDirective, decorators: [{
|
|
639
|
+
type: Directive,
|
|
640
|
+
args: [{
|
|
641
|
+
selector: '[talosDialogDescription]',
|
|
642
|
+
host: {
|
|
643
|
+
'class': 'talos-dialog-description',
|
|
644
|
+
'[attr.id]': 'id()'
|
|
645
|
+
}
|
|
646
|
+
}]
|
|
647
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }] } });
|
|
648
|
+
/**
|
|
649
|
+
* Directive placed on buttons inside a dialog to trigger dismissal.
|
|
650
|
+
* Passes the optional [talosDialogClose] value as the dialog result.
|
|
651
|
+
*/
|
|
652
|
+
class TalosDialogCloseDirective {
|
|
653
|
+
/** Value returned when closing the dialog */
|
|
654
|
+
dialogResult = input(undefined, { ...(ngDevMode ? { debugName: "dialogResult" } : /* istanbul ignore next */ {}), alias: 'talosDialogClose' });
|
|
655
|
+
dialogRef = inject(DialogRef, { optional: true });
|
|
656
|
+
onClick(event) {
|
|
657
|
+
if (this.dialogRef) {
|
|
658
|
+
this.dialogRef.close(this.dialogResult());
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
662
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosDialogCloseDirective, isStandalone: true, selector: "[talosDialogClose]", inputs: { dialogResult: { classPropertyName: "dialogResult", publicName: "talosDialogClose", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
663
|
+
}
|
|
664
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogCloseDirective, decorators: [{
|
|
665
|
+
type: Directive,
|
|
666
|
+
args: [{
|
|
667
|
+
selector: '[talosDialogClose]',
|
|
668
|
+
host: {
|
|
669
|
+
'(click)': 'onClick($event)'
|
|
670
|
+
}
|
|
671
|
+
}]
|
|
672
|
+
}], propDecorators: { dialogResult: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosDialogClose", required: false }] }] } });
|
|
673
|
+
|
|
674
|
+
class TalosDialogHeaderComponent {
|
|
675
|
+
/** Main dialog title */
|
|
676
|
+
title = input(/* @ts-ignore */
|
|
677
|
+
...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
|
|
678
|
+
/** Subtitle or helper description */
|
|
679
|
+
subtitle = input(/* @ts-ignore */
|
|
680
|
+
...(ngDevMode ? [undefined, { debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
681
|
+
/** Visual accent variant */
|
|
682
|
+
variant = input('default', /* @ts-ignore */
|
|
683
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
684
|
+
/** Whether to show a bottom divider line */
|
|
685
|
+
divider = input(true, /* @ts-ignore */
|
|
686
|
+
...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
687
|
+
/** Whether to show the top-right X close button */
|
|
688
|
+
showCloseButton = input(true, /* @ts-ignore */
|
|
689
|
+
...(ngDevMode ? [{ debugName: "showCloseButton" }] : /* istanbul ignore next */ []));
|
|
690
|
+
/** Accessible label for the close button */
|
|
691
|
+
closeButtonAriaLabel = input('Close dialog', /* @ts-ignore */
|
|
692
|
+
...(ngDevMode ? [{ debugName: "closeButtonAriaLabel" }] : /* istanbul ignore next */ []));
|
|
693
|
+
/** Emitted when the close button is clicked */
|
|
694
|
+
closeClick = output();
|
|
695
|
+
dialogRef = inject(DialogRef, { optional: true });
|
|
696
|
+
handleClose(event) {
|
|
697
|
+
this.closeClick.emit(event);
|
|
698
|
+
if (this.dialogRef) {
|
|
699
|
+
this.dialogRef.close();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
703
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosDialogHeaderComponent, isStandalone: true, selector: "talos-dialog-header, [talosDialogHeader]", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, showCloseButton: { classPropertyName: "showCloseButton", publicName: "showCloseButton", isSignal: true, isRequired: false, transformFunction: null }, closeButtonAriaLabel: { classPropertyName: "closeButtonAriaLabel", publicName: "closeButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closeClick: "closeClick" }, host: { properties: { "class.has-divider": "divider()", "class.variant-danger": "variant() === \"danger\"", "class.variant-warning": "variant() === \"warning\"", "class.variant-info": "variant() === \"info\"", "class.variant-success": "variant() === \"success\"" }, classAttribute: "talos-dialog-header-host" }, ngImport: i0, template: "<div class=\"talos-dialog-header-inner\">\n <div class=\"talos-dialog-header-left\">\n <div class=\"talos-dialog-header-icon-slot\">\n <ng-content select=\"[talos-dialog-icon], [dialog-icon], lucide-icon, svg\"></ng-content>\n </div>\n\n <div class=\"talos-dialog-header-text\">\n @if (title()) {\n <h2 talosDialogTitle class=\"talos-dialog-header-title\">{{ title() }}</h2>\n } @else {\n <ng-content select=\"[talosDialogTitle], h2, h3\"></ng-content>\n }\n\n @if (subtitle()) {\n <p talosDialogDescription class=\"talos-dialog-header-subtitle\">{{ subtitle() }}</p>\n } @else {\n <ng-content select=\"[talosDialogDescription], p\"></ng-content>\n }\n </div>\n </div>\n\n <div class=\"talos-dialog-header-actions\">\n <ng-content select=\"[talos-dialog-header-actions]\"></ng-content>\n\n @if (showCloseButton()) {\n <button\n type=\"button\"\n class=\"talos-dialog-header-close-btn\"\n [attr.aria-label]=\"closeButtonAriaLabel()\"\n (click)=\"handleClose($event)\"\n >\n <svg lucideX [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n }\n </div>\n</div>\n", styles: [":host{display:block;flex-shrink:0;position:relative;padding:1.25rem 1.5rem;box-sizing:border-box}:host.has-divider{border-bottom:1px solid var(--talos-dialog-border, var(--talos-border-color, #e2e8f0))}.talos-dialog-header-inner{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.talos-dialog-header-left{display:flex;align-items:flex-start;gap:.75rem;flex:1;min-width:0}.talos-dialog-header-icon-slot{display:flex;align-items:center;justify-content:center;flex-shrink:0}.talos-dialog-header-icon-slot:empty{display:none}.talos-dialog-header-text{display:flex;flex-direction:column;gap:.25rem;min-width:0;flex:1}.talos-dialog-header-title{margin:0;font-size:1.125rem;font-weight:600;line-height:1.4;color:var(--talos-dialog-title-color, var(--talos-text-color, #0f172a));letter-spacing:-.01em}.talos-dialog-header-subtitle{margin:0;font-size:.875rem;line-height:1.4;color:var(--talos-dialog-subtitle-color, var(--talos-text-muted, #64748b))}.talos-dialog-header-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.talos-dialog-header-close-btn{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:var(--talos-border-radius, .375rem);border:none;background:transparent;color:var(--talos-text-muted, #64748b);cursor:pointer;transition:background-color .15s ease,color .15s ease}.talos-dialog-header-close-btn:hover{background-color:var(--talos-bg-subtle, #f1f5f9);color:var(--talos-text-color, #0f172a)}.talos-dialog-header-close-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}:host(.variant-danger) .talos-dialog-header-title{color:var(--talos-error-color, #ef4444)}:host(.variant-warning) .talos-dialog-header-title{color:var(--talos-warning-color, #d97706)}:host(.variant-info) .talos-dialog-header-title{color:var(--talos-primary-color, #2563eb)}:host(.variant-success) .talos-dialog-header-title{color:var(--talos-success-color, #16a34a)}\n"], dependencies: [{ kind: "component", type: LucideX, selector: "svg[lucideX]" }, { kind: "directive", type: TalosDialogTitleDirective, selector: "[talosDialogTitle]", inputs: ["id"] }, { kind: "directive", type: TalosDialogDescriptionDirective, selector: "[talosDialogDescription]", inputs: ["id"] }] });
|
|
704
|
+
}
|
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogHeaderComponent, decorators: [{
|
|
706
|
+
type: Component,
|
|
707
|
+
args: [{ selector: 'talos-dialog-header, [talosDialogHeader]', imports: [LucideX, TalosDialogTitleDirective, TalosDialogDescriptionDirective], host: {
|
|
708
|
+
'class': 'talos-dialog-header-host',
|
|
709
|
+
'[class.has-divider]': 'divider()',
|
|
710
|
+
'[class.variant-danger]': 'variant() === "danger"',
|
|
711
|
+
'[class.variant-warning]': 'variant() === "warning"',
|
|
712
|
+
'[class.variant-info]': 'variant() === "info"',
|
|
713
|
+
'[class.variant-success]': 'variant() === "success"'
|
|
714
|
+
}, template: "<div class=\"talos-dialog-header-inner\">\n <div class=\"talos-dialog-header-left\">\n <div class=\"talos-dialog-header-icon-slot\">\n <ng-content select=\"[talos-dialog-icon], [dialog-icon], lucide-icon, svg\"></ng-content>\n </div>\n\n <div class=\"talos-dialog-header-text\">\n @if (title()) {\n <h2 talosDialogTitle class=\"talos-dialog-header-title\">{{ title() }}</h2>\n } @else {\n <ng-content select=\"[talosDialogTitle], h2, h3\"></ng-content>\n }\n\n @if (subtitle()) {\n <p talosDialogDescription class=\"talos-dialog-header-subtitle\">{{ subtitle() }}</p>\n } @else {\n <ng-content select=\"[talosDialogDescription], p\"></ng-content>\n }\n </div>\n </div>\n\n <div class=\"talos-dialog-header-actions\">\n <ng-content select=\"[talos-dialog-header-actions]\"></ng-content>\n\n @if (showCloseButton()) {\n <button\n type=\"button\"\n class=\"talos-dialog-header-close-btn\"\n [attr.aria-label]=\"closeButtonAriaLabel()\"\n (click)=\"handleClose($event)\"\n >\n <svg lucideX [size]=\"18\" aria-hidden=\"true\"></svg>\n </button>\n }\n </div>\n</div>\n", styles: [":host{display:block;flex-shrink:0;position:relative;padding:1.25rem 1.5rem;box-sizing:border-box}:host.has-divider{border-bottom:1px solid var(--talos-dialog-border, var(--talos-border-color, #e2e8f0))}.talos-dialog-header-inner{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.talos-dialog-header-left{display:flex;align-items:flex-start;gap:.75rem;flex:1;min-width:0}.talos-dialog-header-icon-slot{display:flex;align-items:center;justify-content:center;flex-shrink:0}.talos-dialog-header-icon-slot:empty{display:none}.talos-dialog-header-text{display:flex;flex-direction:column;gap:.25rem;min-width:0;flex:1}.talos-dialog-header-title{margin:0;font-size:1.125rem;font-weight:600;line-height:1.4;color:var(--talos-dialog-title-color, var(--talos-text-color, #0f172a));letter-spacing:-.01em}.talos-dialog-header-subtitle{margin:0;font-size:.875rem;line-height:1.4;color:var(--talos-dialog-subtitle-color, var(--talos-text-muted, #64748b))}.talos-dialog-header-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.talos-dialog-header-close-btn{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border-radius:var(--talos-border-radius, .375rem);border:none;background:transparent;color:var(--talos-text-muted, #64748b);cursor:pointer;transition:background-color .15s ease,color .15s ease}.talos-dialog-header-close-btn:hover{background-color:var(--talos-bg-subtle, #f1f5f9);color:var(--talos-text-color, #0f172a)}.talos-dialog-header-close-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}:host(.variant-danger) .talos-dialog-header-title{color:var(--talos-error-color, #ef4444)}:host(.variant-warning) .talos-dialog-header-title{color:var(--talos-warning-color, #d97706)}:host(.variant-info) .talos-dialog-header-title{color:var(--talos-primary-color, #2563eb)}:host(.variant-success) .talos-dialog-header-title{color:var(--talos-success-color, #16a34a)}\n"] }]
|
|
715
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], showCloseButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCloseButton", required: false }] }], closeButtonAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButtonAriaLabel", required: false }] }], closeClick: [{ type: i0.Output, args: ["closeClick"] }] } });
|
|
716
|
+
|
|
717
|
+
class TalosDialogContentComponent {
|
|
718
|
+
/** Internal padding size */
|
|
719
|
+
padding = input('md', /* @ts-ignore */
|
|
720
|
+
...(ngDevMode ? [{ debugName: "padding" }] : /* istanbul ignore next */ []));
|
|
721
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
722
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: TalosDialogContentComponent, isStandalone: true, selector: "talos-dialog-content, [talosDialogContent]", inputs: { padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.padding-none": "padding() === \"none\"", "class.padding-sm": "padding() === \"sm\"", "class.padding-md": "padding() === \"md\"", "class.padding-lg": "padding() === \"lg\"" }, classAttribute: "talos-dialog-content-host" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:block;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;color:var(--talos-text-color, #0f172a);font-size:.9375rem;line-height:1.5;scrollbar-width:thin;scrollbar-color:var(--talos-border-color, #cbd5e1) transparent}:host::-webkit-scrollbar{width:6px;height:6px}:host::-webkit-scrollbar-track{background:transparent}:host::-webkit-scrollbar-thumb{background-color:var(--talos-border-color, #cbd5e1);border-radius:9999px}:host::-webkit-scrollbar-thumb:hover{background-color:var(--talos-border-hover, #64748b)}:host.padding-none{padding:0}:host.padding-sm{padding:1rem 1.25rem}:host.padding-md{padding:1.5rem}:host.padding-lg{padding:2rem}\n"] });
|
|
723
|
+
}
|
|
724
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogContentComponent, decorators: [{
|
|
725
|
+
type: Component,
|
|
726
|
+
args: [{ selector: 'talos-dialog-content, [talosDialogContent]', host: {
|
|
727
|
+
'class': 'talos-dialog-content-host',
|
|
728
|
+
'[class.padding-none]': 'padding() === "none"',
|
|
729
|
+
'[class.padding-sm]': 'padding() === "sm"',
|
|
730
|
+
'[class.padding-md]': 'padding() === "md"',
|
|
731
|
+
'[class.padding-lg]': 'padding() === "lg"'
|
|
732
|
+
}, template: "<ng-content></ng-content>\n", styles: [":host{display:block;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;box-sizing:border-box;color:var(--talos-text-color, #0f172a);font-size:.9375rem;line-height:1.5;scrollbar-width:thin;scrollbar-color:var(--talos-border-color, #cbd5e1) transparent}:host::-webkit-scrollbar{width:6px;height:6px}:host::-webkit-scrollbar-track{background:transparent}:host::-webkit-scrollbar-thumb{background-color:var(--talos-border-color, #cbd5e1);border-radius:9999px}:host::-webkit-scrollbar-thumb:hover{background-color:var(--talos-border-hover, #64748b)}:host.padding-none{padding:0}:host.padding-sm{padding:1rem 1.25rem}:host.padding-md{padding:1.5rem}:host.padding-lg{padding:2rem}\n"] }]
|
|
733
|
+
}], propDecorators: { padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }] } });
|
|
734
|
+
|
|
735
|
+
class TalosDialogFooterComponent {
|
|
736
|
+
/** Button alignment in footer */
|
|
737
|
+
align = input('end', /* @ts-ignore */
|
|
738
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
739
|
+
/** Whether to show a top divider border */
|
|
740
|
+
divider = input(true, /* @ts-ignore */
|
|
741
|
+
...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
742
|
+
/** Whether the footer sticks to the bottom when content scrolls */
|
|
743
|
+
sticky = input(false, /* @ts-ignore */
|
|
744
|
+
...(ngDevMode ? [{ debugName: "sticky" }] : /* istanbul ignore next */ []));
|
|
745
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
746
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: TalosDialogFooterComponent, isStandalone: true, selector: "talos-dialog-footer, [talosDialogFooter]", inputs: { align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, sticky: { classPropertyName: "sticky", publicName: "sticky", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.has-divider": "divider()", "class.is-sticky": "sticky()", "class.align-start": "align() === \"start\"", "class.align-center": "align() === \"center\"", "class.align-end": "align() === \"end\"", "class.align-space-between": "align() === \"space-between\"" }, classAttribute: "talos-dialog-footer-host" }, ngImport: i0, template: "<div class=\"talos-dialog-footer-inner\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;flex-shrink:0;padding:1rem 1.5rem;box-sizing:border-box;background-color:var(--talos-dialog-footer-bg, transparent)}:host.has-divider{border-top:1px solid var(--talos-dialog-border, var(--talos-border-color, #e2e8f0))}:host.is-sticky{position:sticky;bottom:0;z-index:10;background-color:var(--talos-dialog-bg, var(--talos-card-bg, #ffffff))}.talos-dialog-footer-inner{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}:host(.align-start) .talos-dialog-footer-inner{justify-content:flex-start}:host(.align-center) .talos-dialog-footer-inner{justify-content:center}:host(.align-end) .talos-dialog-footer-inner{justify-content:flex-end}:host(.align-space-between) .talos-dialog-footer-inner{justify-content:space-between}\n"] });
|
|
747
|
+
}
|
|
748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogFooterComponent, decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{ selector: 'talos-dialog-footer, [talosDialogFooter]', host: {
|
|
751
|
+
'class': 'talos-dialog-footer-host',
|
|
752
|
+
'[class.has-divider]': 'divider()',
|
|
753
|
+
'[class.is-sticky]': 'sticky()',
|
|
754
|
+
'[class.align-start]': 'align() === "start"',
|
|
755
|
+
'[class.align-center]': 'align() === "center"',
|
|
756
|
+
'[class.align-end]': 'align() === "end"',
|
|
757
|
+
'[class.align-space-between]': 'align() === "space-between"'
|
|
758
|
+
}, template: "<div class=\"talos-dialog-footer-inner\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block;flex-shrink:0;padding:1rem 1.5rem;box-sizing:border-box;background-color:var(--talos-dialog-footer-bg, transparent)}:host.has-divider{border-top:1px solid var(--talos-dialog-border, var(--talos-border-color, #e2e8f0))}:host.is-sticky{position:sticky;bottom:0;z-index:10;background-color:var(--talos-dialog-bg, var(--talos-card-bg, #ffffff))}.talos-dialog-footer-inner{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}:host(.align-start) .talos-dialog-footer-inner{justify-content:flex-start}:host(.align-center) .talos-dialog-footer-inner{justify-content:center}:host(.align-end) .talos-dialog-footer-inner{justify-content:flex-end}:host(.align-space-between) .talos-dialog-footer-inner{justify-content:space-between}\n"] }]
|
|
759
|
+
}], propDecorators: { align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], sticky: [{ type: i0.Input, args: [{ isSignal: true, alias: "sticky", required: false }] }] } });
|
|
760
|
+
|
|
761
|
+
class TalosConfirmDialogComponent {
|
|
762
|
+
data = inject(TALOS_DIALOG_DATA, { optional: true }) || {
|
|
763
|
+
title: 'Confirmation',
|
|
764
|
+
message: 'Are you sure you want to proceed?'
|
|
765
|
+
};
|
|
766
|
+
dialogRef = inject(DialogRef);
|
|
767
|
+
title = this.data.title;
|
|
768
|
+
message = this.data.message;
|
|
769
|
+
isTemplateMessage = typeof this.data.message !== 'string';
|
|
770
|
+
confirmText = this.data.confirmText ?? 'Confirm';
|
|
771
|
+
cancelText = this.data.cancelText ?? 'Cancel';
|
|
772
|
+
variant = this.data.variant ?? 'primary';
|
|
773
|
+
showCancel = this.data.showCancel ?? true;
|
|
774
|
+
get confirmButtonVariant() {
|
|
775
|
+
if (this.variant === 'danger')
|
|
776
|
+
return 'danger';
|
|
777
|
+
return 'primary';
|
|
778
|
+
}
|
|
779
|
+
onConfirm() {
|
|
780
|
+
this.dialogRef.close(true);
|
|
781
|
+
}
|
|
782
|
+
onCancel() {
|
|
783
|
+
this.dialogRef.close(false);
|
|
784
|
+
}
|
|
785
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
786
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosConfirmDialogComponent, isStandalone: true, selector: "talos-confirm-dialog", host: { classAttribute: "talos-confirm-dialog-host" }, ngImport: i0, template: "<talos-dialog-header [title]=\"title\" [variant]=\"variant\" [divider]=\"false\">\n <div class=\"confirm-icon-wrapper\" [class]=\"'variant-' + variant\" talos-dialog-icon>\n @switch (variant) {\n @case ('danger') {\n <svg lucideAlertCircle [size]=\"22\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"22\"></svg>\n }\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"22\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"22\"></svg>\n }\n }\n </div>\n</talos-dialog-header>\n\n<talos-dialog-content padding=\"sm\">\n @if (isTemplateMessage) {\n <ng-container [ngTemplateOutlet]=\"$any(message)\"></ng-container>\n } @else {\n <p class=\"confirm-message-text\">{{ message }}</p>\n }\n</talos-dialog-content>\n\n<talos-dialog-footer [divider]=\"false\" align=\"end\">\n @if (showCancel) {\n <button talosButton variant=\"secondary\" size=\"md\" (click)=\"onCancel()\">\n {{ cancelText }}\n </button>\n }\n <button talosButton [variant]=\"confirmButtonVariant\" size=\"md\" (click)=\"onConfirm()\">\n {{ confirmText }}\n </button>\n</talos-dialog-footer>\n", styles: [":host{display:flex;flex-direction:column;box-sizing:border-box}.confirm-icon-wrapper{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;flex-shrink:0}.confirm-icon-wrapper.variant-default,.confirm-icon-wrapper.variant-primary,.confirm-icon-wrapper.variant-info{background-color:var(--talos-primary-light, #eff6ff);color:var(--talos-primary-color, #2563eb)}.confirm-icon-wrapper.variant-danger{background-color:#ef44441f;color:var(--talos-error-color, #ef4444)}.confirm-icon-wrapper.variant-warning{background-color:#d977061f;color:var(--talos-warning-color, #d97706)}.confirm-icon-wrapper.variant-success{background-color:#16a34a1f;color:var(--talos-success-color, #16a34a)}.confirm-message-text{margin:0;color:var(--talos-text-muted, #64748b);font-size:.9375rem;line-height:1.55}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TalosButtonDirective, selector: "button[talosButton], a[talosButton], button[talos-btn], a[talos-btn]", inputs: ["variant", "size", "iconOnly", "fullWidth", "pill", "loading", "disabled", "animation", "spinning", "popping", "feedback"] }, { kind: "component", type: TalosDialogHeaderComponent, selector: "talos-dialog-header, [talosDialogHeader]", inputs: ["title", "subtitle", "variant", "divider", "showCloseButton", "closeButtonAriaLabel"], outputs: ["closeClick"] }, { kind: "component", type: TalosDialogContentComponent, selector: "talos-dialog-content, [talosDialogContent]", inputs: ["padding"] }, { kind: "component", type: TalosDialogFooterComponent, selector: "talos-dialog-footer, [talosDialogFooter]", inputs: ["align", "divider", "sticky"] }, { kind: "component", type: LucideAlertTriangle, selector: "svg[lucideTriangleAlert], svg[lucideAlertTriangle]" }, { kind: "component", type: LucideInfo, selector: "svg[lucideInfo]" }, { kind: "component", type: LucideCheckCircle2, selector: "svg[lucideCircleCheck], svg[lucideCheckCircle2]" }, { kind: "component", type: LucideAlertCircle, selector: "svg[lucideCircleAlert], svg[lucideAlertCircle]" }] });
|
|
787
|
+
}
|
|
788
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosConfirmDialogComponent, decorators: [{
|
|
789
|
+
type: Component,
|
|
790
|
+
args: [{ selector: 'talos-confirm-dialog', imports: [
|
|
791
|
+
NgTemplateOutlet,
|
|
792
|
+
TalosButtonDirective,
|
|
793
|
+
TalosDialogHeaderComponent,
|
|
794
|
+
TalosDialogContentComponent,
|
|
795
|
+
TalosDialogFooterComponent,
|
|
796
|
+
LucideAlertTriangle,
|
|
797
|
+
LucideInfo,
|
|
798
|
+
LucideCheckCircle2,
|
|
799
|
+
LucideAlertCircle
|
|
800
|
+
], host: {
|
|
801
|
+
'class': 'talos-confirm-dialog-host'
|
|
802
|
+
}, template: "<talos-dialog-header [title]=\"title\" [variant]=\"variant\" [divider]=\"false\">\n <div class=\"confirm-icon-wrapper\" [class]=\"'variant-' + variant\" talos-dialog-icon>\n @switch (variant) {\n @case ('danger') {\n <svg lucideAlertCircle [size]=\"22\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"22\"></svg>\n }\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"22\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"22\"></svg>\n }\n }\n </div>\n</talos-dialog-header>\n\n<talos-dialog-content padding=\"sm\">\n @if (isTemplateMessage) {\n <ng-container [ngTemplateOutlet]=\"$any(message)\"></ng-container>\n } @else {\n <p class=\"confirm-message-text\">{{ message }}</p>\n }\n</talos-dialog-content>\n\n<talos-dialog-footer [divider]=\"false\" align=\"end\">\n @if (showCancel) {\n <button talosButton variant=\"secondary\" size=\"md\" (click)=\"onCancel()\">\n {{ cancelText }}\n </button>\n }\n <button talosButton [variant]=\"confirmButtonVariant\" size=\"md\" (click)=\"onConfirm()\">\n {{ confirmText }}\n </button>\n</talos-dialog-footer>\n", styles: [":host{display:flex;flex-direction:column;box-sizing:border-box}.confirm-icon-wrapper{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border-radius:9999px;flex-shrink:0}.confirm-icon-wrapper.variant-default,.confirm-icon-wrapper.variant-primary,.confirm-icon-wrapper.variant-info{background-color:var(--talos-primary-light, #eff6ff);color:var(--talos-primary-color, #2563eb)}.confirm-icon-wrapper.variant-danger{background-color:#ef44441f;color:var(--talos-error-color, #ef4444)}.confirm-icon-wrapper.variant-warning{background-color:#d977061f;color:var(--talos-warning-color, #d97706)}.confirm-icon-wrapper.variant-success{background-color:#16a34a1f;color:var(--talos-success-color, #16a34a)}.confirm-message-text{margin:0;color:var(--talos-text-muted, #64748b);font-size:.9375rem;line-height:1.55}\n"] }]
|
|
803
|
+
}] });
|
|
804
|
+
|
|
805
|
+
class TalosDialogService {
|
|
806
|
+
cdkDialog = inject(Dialog);
|
|
807
|
+
injector = inject(Injector);
|
|
808
|
+
/** Signal of currently open dialog references */
|
|
809
|
+
openDialogs = signal([], /* @ts-ignore */
|
|
810
|
+
...(ngDevMode ? [{ debugName: "openDialogs" }] : /* istanbul ignore next */ []));
|
|
811
|
+
/**
|
|
812
|
+
* Open a component or template inside a modal dialog.
|
|
813
|
+
*/
|
|
814
|
+
open(componentOrTemplate, config = {}) {
|
|
815
|
+
const size = config.size ?? 'md';
|
|
816
|
+
const backdropBlur = config.backdropBlur ?? false;
|
|
817
|
+
const panelClasses = ['talos-dialog-panel', `talos-dialog-size-${size}`];
|
|
818
|
+
if (config.panelClass) {
|
|
819
|
+
if (Array.isArray(config.panelClass)) {
|
|
820
|
+
panelClasses.push(...config.panelClass);
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
panelClasses.push(config.panelClass);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
const backdropClasses = ['talos-dialog-backdrop'];
|
|
827
|
+
if (backdropBlur === true || backdropBlur === 'md') {
|
|
828
|
+
backdropClasses.push('talos-dialog-backdrop-blur-md');
|
|
829
|
+
}
|
|
830
|
+
else if (backdropBlur === 'sm') {
|
|
831
|
+
backdropClasses.push('talos-dialog-backdrop-blur-sm');
|
|
832
|
+
}
|
|
833
|
+
else if (backdropBlur === 'lg') {
|
|
834
|
+
backdropClasses.push('talos-dialog-backdrop-blur-lg');
|
|
835
|
+
}
|
|
836
|
+
if (config.backdropClass) {
|
|
837
|
+
if (Array.isArray(config.backdropClass)) {
|
|
838
|
+
backdropClasses.push(...config.backdropClass);
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
backdropClasses.push(config.backdropClass);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
const disableClose = config.disableClose ?? false;
|
|
845
|
+
let talosRef = null;
|
|
846
|
+
const cdkConfig = {
|
|
847
|
+
panelClass: panelClasses,
|
|
848
|
+
backdropClass: backdropClasses,
|
|
849
|
+
hasBackdrop: config.hasBackdrop ?? true,
|
|
850
|
+
disableClose: disableClose,
|
|
851
|
+
closeOnNavigation: true,
|
|
852
|
+
autoFocus: config.autoFocus ?? 'first-tabbable',
|
|
853
|
+
restoreFocus: config.restoreFocus ?? true,
|
|
854
|
+
ariaLabel: config.ariaLabel,
|
|
855
|
+
ariaLabelledBy: config.ariaLabelledBy,
|
|
856
|
+
ariaDescribedBy: config.ariaDescribedBy,
|
|
857
|
+
role: config.role ?? 'dialog',
|
|
858
|
+
id: config.id,
|
|
859
|
+
width: config.width,
|
|
860
|
+
minWidth: config.minWidth,
|
|
861
|
+
maxWidth: config.maxWidth,
|
|
862
|
+
height: config.height,
|
|
863
|
+
minHeight: config.minHeight,
|
|
864
|
+
maxHeight: config.maxHeight,
|
|
865
|
+
data: config.data,
|
|
866
|
+
injector: this.injector,
|
|
867
|
+
providers: (cdkDialogRef) => {
|
|
868
|
+
talosRef = new TalosDialogRef(cdkDialogRef, config, config.data);
|
|
869
|
+
return [
|
|
870
|
+
{ provide: TalosDialogRef, useValue: talosRef },
|
|
871
|
+
{ provide: TALOS_DIALOG_REF, useValue: talosRef },
|
|
872
|
+
{ provide: TALOS_DIALOG_DATA, useValue: config.data },
|
|
873
|
+
{ provide: TALOS_DIALOG_CONFIG, useValue: config }
|
|
874
|
+
];
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
const cdkRef = this.cdkDialog.open(componentOrTemplate, cdkConfig);
|
|
878
|
+
if (!talosRef) {
|
|
879
|
+
talosRef = new TalosDialogRef(cdkRef, config, config.data);
|
|
880
|
+
}
|
|
881
|
+
const resolvedTalosRef = talosRef;
|
|
882
|
+
// Track active dialogs
|
|
883
|
+
this.openDialogs.update(current => [...current, resolvedTalosRef]);
|
|
884
|
+
cdkRef.closed.subscribe(() => {
|
|
885
|
+
this.openDialogs.update(current => current.filter(d => d.id !== resolvedTalosRef.id));
|
|
886
|
+
});
|
|
887
|
+
return resolvedTalosRef;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Convenience helper to display a confirmation dialog.
|
|
891
|
+
*/
|
|
892
|
+
confirm(options) {
|
|
893
|
+
return this.open(TalosConfirmDialogComponent, {
|
|
894
|
+
size: options.size ?? 'sm',
|
|
895
|
+
backdropBlur: options.backdropBlur ?? true,
|
|
896
|
+
disableClose: options.disableClose ?? false,
|
|
897
|
+
role: 'alertdialog',
|
|
898
|
+
data: options
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* Convenience helper to display an alert dialog.
|
|
903
|
+
*/
|
|
904
|
+
alert(options) {
|
|
905
|
+
return this.open(TalosConfirmDialogComponent, {
|
|
906
|
+
size: options.size ?? 'sm',
|
|
907
|
+
backdropBlur: options.backdropBlur ?? true,
|
|
908
|
+
role: 'alertdialog',
|
|
909
|
+
data: {
|
|
910
|
+
...options,
|
|
911
|
+
showCancel: false,
|
|
912
|
+
confirmText: options.okText ?? 'OK'
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* Close all currently open dialogs.
|
|
918
|
+
*/
|
|
919
|
+
closeAll() {
|
|
920
|
+
this.cdkDialog.closeAll();
|
|
921
|
+
}
|
|
922
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
923
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogService, providedIn: 'root' });
|
|
924
|
+
}
|
|
925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogService, decorators: [{
|
|
926
|
+
type: Injectable,
|
|
927
|
+
args: [{
|
|
928
|
+
providedIn: 'root'
|
|
929
|
+
}]
|
|
930
|
+
}] });
|
|
931
|
+
|
|
932
|
+
const DIALOG_COMPONENTS = [
|
|
933
|
+
TalosDialogHeaderComponent,
|
|
934
|
+
TalosDialogContentComponent,
|
|
935
|
+
TalosDialogFooterComponent,
|
|
936
|
+
TalosConfirmDialogComponent,
|
|
937
|
+
TalosDialogTitleDirective,
|
|
938
|
+
TalosDialogDescriptionDirective,
|
|
939
|
+
TalosDialogCloseDirective
|
|
940
|
+
];
|
|
941
|
+
class TalosDialogModule {
|
|
942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
943
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogModule, imports: [TalosDialogHeaderComponent,
|
|
944
|
+
TalosDialogContentComponent,
|
|
945
|
+
TalosDialogFooterComponent,
|
|
946
|
+
TalosConfirmDialogComponent,
|
|
947
|
+
TalosDialogTitleDirective,
|
|
948
|
+
TalosDialogDescriptionDirective,
|
|
949
|
+
TalosDialogCloseDirective], exports: [TalosDialogHeaderComponent,
|
|
950
|
+
TalosDialogContentComponent,
|
|
951
|
+
TalosDialogFooterComponent,
|
|
952
|
+
TalosConfirmDialogComponent,
|
|
953
|
+
TalosDialogTitleDirective,
|
|
954
|
+
TalosDialogDescriptionDirective,
|
|
955
|
+
TalosDialogCloseDirective] });
|
|
956
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogModule, imports: [TalosDialogHeaderComponent,
|
|
957
|
+
TalosConfirmDialogComponent] });
|
|
958
|
+
}
|
|
959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosDialogModule, decorators: [{
|
|
960
|
+
type: NgModule,
|
|
961
|
+
args: [{
|
|
962
|
+
imports: [...DIALOG_COMPONENTS],
|
|
963
|
+
exports: [...DIALOG_COMPONENTS]
|
|
964
|
+
}]
|
|
965
|
+
}] });
|
|
966
|
+
|
|
967
|
+
/**
|
|
968
|
+
* Clamps a numeric value between a minimum and maximum threshold.
|
|
969
|
+
*
|
|
970
|
+
* @param value The value to clamp
|
|
971
|
+
* @param min The lower bound (inclusive)
|
|
972
|
+
* @param max The upper bound (inclusive)
|
|
973
|
+
* @returns Clamped numerical value
|
|
974
|
+
*/
|
|
975
|
+
function clampProgress(value, min, max) {
|
|
976
|
+
if (isNaN(value)) {
|
|
977
|
+
return min;
|
|
978
|
+
}
|
|
979
|
+
if (min >= max) {
|
|
980
|
+
return min;
|
|
981
|
+
}
|
|
982
|
+
return Math.min(Math.max(value, min), max);
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Calculates percentage completion (0 to 100) based on value, min, and max.
|
|
986
|
+
*
|
|
987
|
+
* @param value Current progress value
|
|
988
|
+
* @param min Minimum possible value
|
|
989
|
+
* @param max Maximum possible value
|
|
990
|
+
* @returns Scaled percentage between 0 and 100
|
|
991
|
+
*/
|
|
992
|
+
function calculatePercentage(value, min, max) {
|
|
993
|
+
if (isNaN(value) || min >= max) {
|
|
994
|
+
return 0;
|
|
995
|
+
}
|
|
996
|
+
const clamped = clampProgress(value, min, max);
|
|
997
|
+
return ((clamped - min) / (max - min)) * 100;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* Normalizes CSS dimension input (number converted to px string, or raw string).
|
|
1001
|
+
*
|
|
1002
|
+
* @param value Dimension input as string or number
|
|
1003
|
+
* @returns CSS dimension string or undefined
|
|
1004
|
+
*/
|
|
1005
|
+
function resolveProgressDimension(value) {
|
|
1006
|
+
if (value === null || value === undefined || value === '') {
|
|
1007
|
+
return undefined;
|
|
1008
|
+
}
|
|
1009
|
+
if (typeof value === 'number') {
|
|
1010
|
+
return `${value}px`;
|
|
1011
|
+
}
|
|
1012
|
+
const trimmed = value.trim();
|
|
1013
|
+
if (/^\d+$/.test(trimmed)) {
|
|
1014
|
+
return `${trimmed}px`;
|
|
1015
|
+
}
|
|
1016
|
+
return trimmed;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
/**
|
|
1020
|
+
* Directive for projecting custom header label content into a `<talos-progress-bar>`.
|
|
1021
|
+
*
|
|
1022
|
+
* @example
|
|
1023
|
+
* ```html
|
|
1024
|
+
* <talos-progress-bar [value]="uploadProgress()">
|
|
1025
|
+
* <div talosProgressLabel class="flex items-center gap-2">
|
|
1026
|
+
* <span>Uploading assets</span>
|
|
1027
|
+
* <span class="talos-badge talos-badge--sm talos-badge--info">Active</span>
|
|
1028
|
+
* </div>
|
|
1029
|
+
* </talos-progress-bar>
|
|
1030
|
+
* ```
|
|
1031
|
+
*/
|
|
1032
|
+
class TalosProgressLabelDirective {
|
|
1033
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1034
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosProgressLabelDirective, isStandalone: true, selector: "[talosProgressLabel], talos-progress-label", host: { classAttribute: "talos-progress-label" }, ngImport: i0 });
|
|
1035
|
+
}
|
|
1036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressLabelDirective, decorators: [{
|
|
1037
|
+
type: Directive,
|
|
1038
|
+
args: [{
|
|
1039
|
+
selector: '[talosProgressLabel], talos-progress-label',
|
|
1040
|
+
host: {
|
|
1041
|
+
'class': 'talos-progress-label'
|
|
1042
|
+
}
|
|
1043
|
+
}]
|
|
1044
|
+
}] });
|
|
1045
|
+
/**
|
|
1046
|
+
* Directive for projecting custom formatted value or badge indicator into a `<talos-progress-bar>`.
|
|
1047
|
+
*
|
|
1048
|
+
* @example
|
|
1049
|
+
* ```html
|
|
1050
|
+
* <talos-progress-bar [value]="75">
|
|
1051
|
+
* <span talosProgressValue class="font-mono text-xs">750 / 1,000 MB</span>
|
|
1052
|
+
* </talos-progress-bar>
|
|
1053
|
+
* ```
|
|
1054
|
+
*/
|
|
1055
|
+
class TalosProgressValueDirective {
|
|
1056
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressValueDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1057
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosProgressValueDirective, isStandalone: true, selector: "[talosProgressValue], talos-progress-value", host: { classAttribute: "talos-progress-value" }, ngImport: i0 });
|
|
1058
|
+
}
|
|
1059
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressValueDirective, decorators: [{
|
|
1060
|
+
type: Directive,
|
|
1061
|
+
args: [{
|
|
1062
|
+
selector: '[talosProgressValue], talos-progress-value',
|
|
1063
|
+
host: {
|
|
1064
|
+
'class': 'talos-progress-value'
|
|
1065
|
+
}
|
|
1066
|
+
}]
|
|
1067
|
+
}] });
|
|
1068
|
+
/**
|
|
1069
|
+
* Directive for projecting auxiliary description, ETA, or subtext beneath a `<talos-progress-bar>`.
|
|
1070
|
+
*
|
|
1071
|
+
* @example
|
|
1072
|
+
* ```html
|
|
1073
|
+
* <talos-progress-bar [value]="42">
|
|
1074
|
+
* <span talosProgressHint>Estimated time remaining: 2 minutes 45 seconds</span>
|
|
1075
|
+
* </talos-progress-bar>
|
|
1076
|
+
* ```
|
|
1077
|
+
*/
|
|
1078
|
+
class TalosProgressHintDirective {
|
|
1079
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1080
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosProgressHintDirective, isStandalone: true, selector: "[talosProgressHint], talos-progress-hint", host: { classAttribute: "talos-progress-hint" }, ngImport: i0 });
|
|
1081
|
+
}
|
|
1082
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressHintDirective, decorators: [{
|
|
1083
|
+
type: Directive,
|
|
1084
|
+
args: [{
|
|
1085
|
+
selector: '[talosProgressHint], talos-progress-hint',
|
|
1086
|
+
host: {
|
|
1087
|
+
'class': 'talos-progress-hint'
|
|
1088
|
+
}
|
|
1089
|
+
}]
|
|
1090
|
+
}] });
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Modern, accessible linear progress bar component for asynchronous task completion,
|
|
1094
|
+
* asset uploads, streaming buffer states, and metric progress visualization.
|
|
1095
|
+
*
|
|
1096
|
+
* Fully reactive via Angular signals, with support for indeterminate/buffer modes,
|
|
1097
|
+
* striped animated fills, semantic color variants, custom sizes, inside/inline labels,
|
|
1098
|
+
* and comprehensive WCAG AA accessibility attributes.
|
|
1099
|
+
*
|
|
1100
|
+
* @example
|
|
1101
|
+
* ```html
|
|
1102
|
+
* <!-- Determinate task progress -->
|
|
1103
|
+
* <talos-progress-bar [value]="65" label="Uploading telemetry" showValue />
|
|
1104
|
+
*
|
|
1105
|
+
* <!-- Indeterminate background worker -->
|
|
1106
|
+
* <talos-progress-bar mode="indeterminate" variant="info" size="sm" />
|
|
1107
|
+
*
|
|
1108
|
+
* <!-- Streaming buffer mode -->
|
|
1109
|
+
* <talos-progress-bar mode="buffer" [value]="35" [bufferValue]="75" variant="primary" />
|
|
1110
|
+
*
|
|
1111
|
+
* <!-- Animated striped bar with inside label -->
|
|
1112
|
+
* <talos-progress-bar [value]="82" size="xl" striped animated variant="success" [showValue]="true" valuePosition="inside" />
|
|
1113
|
+
* ```
|
|
1114
|
+
*/
|
|
1115
|
+
class TalosProgressBarComponent {
|
|
1116
|
+
/**
|
|
1117
|
+
* Current progress value, evaluated between `min` and `max`.
|
|
1118
|
+
* @default 0
|
|
1119
|
+
*/
|
|
1120
|
+
value = input(0, /* @ts-ignore */
|
|
1121
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1122
|
+
/**
|
|
1123
|
+
* Secondary buffer progress value for streaming or staged downloads.
|
|
1124
|
+
* Only active when `mode` is 'buffer'.
|
|
1125
|
+
*/
|
|
1126
|
+
bufferValue = input(undefined, /* @ts-ignore */
|
|
1127
|
+
...(ngDevMode ? [{ debugName: "bufferValue" }] : /* istanbul ignore next */ []));
|
|
1128
|
+
/**
|
|
1129
|
+
* Minimum possible numerical value.
|
|
1130
|
+
* @default 0
|
|
1131
|
+
*/
|
|
1132
|
+
min = input(0, /* @ts-ignore */
|
|
1133
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
1134
|
+
/**
|
|
1135
|
+
* Maximum possible numerical value.
|
|
1136
|
+
* @default 100
|
|
1137
|
+
*/
|
|
1138
|
+
max = input(100, /* @ts-ignore */
|
|
1139
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
1140
|
+
/**
|
|
1141
|
+
* Operational mode of the progress bar.
|
|
1142
|
+
* @default 'determinate'
|
|
1143
|
+
*/
|
|
1144
|
+
mode = input('determinate', /* @ts-ignore */
|
|
1145
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
1146
|
+
/**
|
|
1147
|
+
* Semantic color theme variant.
|
|
1148
|
+
* @default 'primary'
|
|
1149
|
+
*/
|
|
1150
|
+
variant = input('primary', /* @ts-ignore */
|
|
1151
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1152
|
+
/**
|
|
1153
|
+
* Track height size preset.
|
|
1154
|
+
* @default 'md'
|
|
1155
|
+
*/
|
|
1156
|
+
size = input('md', /* @ts-ignore */
|
|
1157
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1158
|
+
/**
|
|
1159
|
+
* Corner rounding shape of the progress track.
|
|
1160
|
+
* @default 'rounded'
|
|
1161
|
+
*/
|
|
1162
|
+
shape = input('rounded', /* @ts-ignore */
|
|
1163
|
+
...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
1164
|
+
/**
|
|
1165
|
+
* Whether to display diagonal textured stripes across the fill.
|
|
1166
|
+
* @default false
|
|
1167
|
+
*/
|
|
1168
|
+
striped = input(false, { ...(ngDevMode ? { debugName: "striped" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1169
|
+
/**
|
|
1170
|
+
* Whether to continuously animate the striped texture pattern.
|
|
1171
|
+
* @default false
|
|
1172
|
+
*/
|
|
1173
|
+
animated = input(false, { ...(ngDevMode ? { debugName: "animated" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1174
|
+
/**
|
|
1175
|
+
* Whether to display the calculated or formatted progress value label.
|
|
1176
|
+
* @default false
|
|
1177
|
+
*/
|
|
1178
|
+
showValue = input(false, { ...(ngDevMode ? { debugName: "showValue" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1179
|
+
/**
|
|
1180
|
+
* Positioning of the value indicator relative to the progress bar.
|
|
1181
|
+
* @default 'end'
|
|
1182
|
+
*/
|
|
1183
|
+
valuePosition = input('end', /* @ts-ignore */
|
|
1184
|
+
...(ngDevMode ? [{ debugName: "valuePosition" }] : /* istanbul ignore next */ []));
|
|
1185
|
+
/**
|
|
1186
|
+
* Optional custom formatting function for the displayed value.
|
|
1187
|
+
* Receives current numerical value and calculated percentage.
|
|
1188
|
+
*/
|
|
1189
|
+
valueFormatter = input(undefined, /* @ts-ignore */
|
|
1190
|
+
...(ngDevMode ? [{ debugName: "valueFormatter" }] : /* istanbul ignore next */ []));
|
|
1191
|
+
/**
|
|
1192
|
+
* Optional primary text label describing the progress context.
|
|
1193
|
+
*/
|
|
1194
|
+
label = input(undefined, /* @ts-ignore */
|
|
1195
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1196
|
+
/**
|
|
1197
|
+
* Placement of the text label relative to the track.
|
|
1198
|
+
* @default 'top'
|
|
1199
|
+
*/
|
|
1200
|
+
labelPosition = input('top', /* @ts-ignore */
|
|
1201
|
+
...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
1202
|
+
/**
|
|
1203
|
+
* Custom CSS color override for the fill bar (e.g. hex, rgb, or css variable).
|
|
1204
|
+
*/
|
|
1205
|
+
color = input(undefined, /* @ts-ignore */
|
|
1206
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1207
|
+
/**
|
|
1208
|
+
* Custom CSS background color override for the track.
|
|
1209
|
+
*/
|
|
1210
|
+
trackColor = input(undefined, /* @ts-ignore */
|
|
1211
|
+
...(ngDevMode ? [{ debugName: "trackColor" }] : /* istanbul ignore next */ []));
|
|
1212
|
+
/**
|
|
1213
|
+
* Custom CSS background color override for the buffer bar.
|
|
1214
|
+
*/
|
|
1215
|
+
bufferColor = input(undefined, /* @ts-ignore */
|
|
1216
|
+
...(ngDevMode ? [{ debugName: "bufferColor" }] : /* istanbul ignore next */ []));
|
|
1217
|
+
/**
|
|
1218
|
+
* Custom explicit track height override (e.g., '14px', '1.25rem', or number in pixels).
|
|
1219
|
+
*/
|
|
1220
|
+
height = input(undefined, /* @ts-ignore */
|
|
1221
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
1222
|
+
/**
|
|
1223
|
+
* Accessible description announced by screen readers.
|
|
1224
|
+
* Falls back to `label` or 'Progress'.
|
|
1225
|
+
*/
|
|
1226
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
1227
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1228
|
+
/**
|
|
1229
|
+
* ID of an external DOM element that labels this progress bar.
|
|
1230
|
+
*/
|
|
1231
|
+
ariaLabelledby = input(undefined, /* @ts-ignore */
|
|
1232
|
+
...(ngDevMode ? [{ debugName: "ariaLabelledby" }] : /* istanbul ignore next */ []));
|
|
1233
|
+
/** Numerical value safely clamped within [min, max] */
|
|
1234
|
+
clampedValue = computed(() => {
|
|
1235
|
+
return clampProgress(this.value(), this.min(), this.max());
|
|
1236
|
+
}, /* @ts-ignore */
|
|
1237
|
+
...(ngDevMode ? [{ debugName: "clampedValue" }] : /* istanbul ignore next */ []));
|
|
1238
|
+
/** Scaled percentage (0 - 100) of primary progress */
|
|
1239
|
+
percentage = computed(() => {
|
|
1240
|
+
return calculatePercentage(this.value(), this.min(), this.max());
|
|
1241
|
+
}, /* @ts-ignore */
|
|
1242
|
+
...(ngDevMode ? [{ debugName: "percentage" }] : /* istanbul ignore next */ []));
|
|
1243
|
+
/** Scaled percentage (0 - 100) of buffer progress */
|
|
1244
|
+
bufferPercentage = computed(() => {
|
|
1245
|
+
const buf = this.bufferValue();
|
|
1246
|
+
if (buf === undefined || buf === null) {
|
|
1247
|
+
return 0;
|
|
1248
|
+
}
|
|
1249
|
+
return calculatePercentage(buf, this.min(), this.max());
|
|
1250
|
+
}, /* @ts-ignore */
|
|
1251
|
+
...(ngDevMode ? [{ debugName: "bufferPercentage" }] : /* istanbul ignore next */ []));
|
|
1252
|
+
/** Whether the progress bar operates in buffer mode */
|
|
1253
|
+
isBuffer = computed(() => {
|
|
1254
|
+
return this.mode() === 'buffer' || (this.bufferValue() !== undefined && this.bufferValue() !== null && this.mode() === 'determinate');
|
|
1255
|
+
}, /* @ts-ignore */
|
|
1256
|
+
...(ngDevMode ? [{ debugName: "isBuffer" }] : /* istanbul ignore next */ []));
|
|
1257
|
+
/** Whether the progress bar operates in an indeterminate state */
|
|
1258
|
+
isIndeterminate = computed(() => {
|
|
1259
|
+
const m = this.mode();
|
|
1260
|
+
return m === 'indeterminate' || m === 'query';
|
|
1261
|
+
}, /* @ts-ignore */
|
|
1262
|
+
...(ngDevMode ? [{ debugName: "isIndeterminate" }] : /* istanbul ignore next */ []));
|
|
1263
|
+
/** Formatted display string for the progress value */
|
|
1264
|
+
formattedValue = computed(() => {
|
|
1265
|
+
const custom = this.valueFormatter();
|
|
1266
|
+
const val = this.clampedValue();
|
|
1267
|
+
const pct = this.percentage();
|
|
1268
|
+
if (custom) {
|
|
1269
|
+
return custom(val, pct);
|
|
1270
|
+
}
|
|
1271
|
+
return `${Math.round(pct)}%`;
|
|
1272
|
+
}, /* @ts-ignore */
|
|
1273
|
+
...(ngDevMode ? [{ debugName: "formattedValue" }] : /* istanbul ignore next */ []));
|
|
1274
|
+
/** Resolved accessible label */
|
|
1275
|
+
resolvedAriaLabel = computed(() => {
|
|
1276
|
+
const custom = this.ariaLabel();
|
|
1277
|
+
if (custom && custom.trim().length > 0) {
|
|
1278
|
+
return custom.trim();
|
|
1279
|
+
}
|
|
1280
|
+
const lbl = this.label();
|
|
1281
|
+
if (lbl && lbl.trim().length > 0) {
|
|
1282
|
+
return lbl.trim();
|
|
1283
|
+
}
|
|
1284
|
+
return 'Progress';
|
|
1285
|
+
}, /* @ts-ignore */
|
|
1286
|
+
...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1287
|
+
/** Resolved track height override */
|
|
1288
|
+
computedHeight = computed(() => {
|
|
1289
|
+
return resolveProgressDimension(this.height()) ?? null;
|
|
1290
|
+
}, /* @ts-ignore */
|
|
1291
|
+
...(ngDevMode ? [{ debugName: "computedHeight" }] : /* istanbul ignore next */ []));
|
|
1292
|
+
/** Whether the value is aligned inline (start or end) alongside the bar */
|
|
1293
|
+
isInlineValueLayout = computed(() => {
|
|
1294
|
+
if (!this.showValue()) {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
const pos = this.valuePosition();
|
|
1298
|
+
return pos === 'start' || pos === 'end';
|
|
1299
|
+
}, /* @ts-ignore */
|
|
1300
|
+
...(ngDevMode ? [{ debugName: "isInlineValueLayout" }] : /* istanbul ignore next */ []));
|
|
1301
|
+
/** Optional projected custom label directive */
|
|
1302
|
+
customLabel = contentChild(TalosProgressLabelDirective, /* @ts-ignore */
|
|
1303
|
+
...(ngDevMode ? [{ debugName: "customLabel" }] : /* istanbul ignore next */ []));
|
|
1304
|
+
/** Optional projected custom value directive */
|
|
1305
|
+
customValue = contentChild(TalosProgressValueDirective, /* @ts-ignore */
|
|
1306
|
+
...(ngDevMode ? [{ debugName: "customValue" }] : /* istanbul ignore next */ []));
|
|
1307
|
+
/** Optional projected custom hint directive */
|
|
1308
|
+
customHint = contentChild(TalosProgressHintDirective, /* @ts-ignore */
|
|
1309
|
+
...(ngDevMode ? [{ debugName: "customHint" }] : /* istanbul ignore next */ []));
|
|
1310
|
+
/** Whether top header container should render */
|
|
1311
|
+
shouldRenderHeader = computed(() => {
|
|
1312
|
+
const hasLabel = !!this.label() && this.labelPosition() === 'top';
|
|
1313
|
+
const hasTopEndValue = this.showValue() && this.valuePosition() === 'top-end';
|
|
1314
|
+
const hasProjected = !!this.customLabel() || !!this.customValue();
|
|
1315
|
+
return hasLabel || hasTopEndValue || hasProjected;
|
|
1316
|
+
}, /* @ts-ignore */
|
|
1317
|
+
...(ngDevMode ? [{ debugName: "shouldRenderHeader" }] : /* istanbul ignore next */ []));
|
|
1318
|
+
/** Whether bottom footer container should render */
|
|
1319
|
+
shouldRenderFooter = computed(() => {
|
|
1320
|
+
const hasBottomLabel = !!this.label() && this.labelPosition() === 'bottom';
|
|
1321
|
+
const hasBottomEndValue = this.showValue() && this.valuePosition() === 'bottom-end';
|
|
1322
|
+
const hasProjectedHint = !!this.customHint();
|
|
1323
|
+
return hasBottomLabel || hasBottomEndValue || hasProjectedHint;
|
|
1324
|
+
}, /* @ts-ignore */
|
|
1325
|
+
...(ngDevMode ? [{ debugName: "shouldRenderFooter" }] : /* istanbul ignore next */ []));
|
|
1326
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1327
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosProgressBarComponent, isStandalone: true, selector: "talos-progress-bar, [talosProgressBar]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, bufferValue: { classPropertyName: "bufferValue", publicName: "bufferValue", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null }, valuePosition: { classPropertyName: "valuePosition", publicName: "valuePosition", isSignal: true, isRequired: false, transformFunction: null }, valueFormatter: { classPropertyName: "valueFormatter", publicName: "valueFormatter", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, trackColor: { classPropertyName: "trackColor", publicName: "trackColor", isSignal: true, isRequired: false, transformFunction: null }, bufferColor: { classPropertyName: "bufferColor", publicName: "bufferColor", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-progress-bar--determinate": "mode() === \"determinate\"", "class.talos-progress-bar--indeterminate": "mode() === \"indeterminate\"", "class.talos-progress-bar--buffer": "mode() === \"buffer\"", "class.talos-progress-bar--query": "mode() === \"query\"", "class.talos-progress-bar--primary": "variant() === \"primary\"", "class.talos-progress-bar--secondary": "variant() === \"secondary\"", "class.talos-progress-bar--success": "variant() === \"success\"", "class.talos-progress-bar--warning": "variant() === \"warning\"", "class.talos-progress-bar--danger": "variant() === \"danger\" || variant() === \"error\"", "class.talos-progress-bar--error": "variant() === \"danger\" || variant() === \"error\"", "class.talos-progress-bar--info": "variant() === \"info\"", "class.talos-progress-bar--neutral": "variant() === \"neutral\"", "class.talos-progress-bar--gradient": "variant() === \"gradient\"", "class.talos-progress-bar--xs": "size() === \"xs\"", "class.talos-progress-bar--sm": "size() === \"sm\"", "class.talos-progress-bar--md": "size() === \"md\"", "class.talos-progress-bar--lg": "size() === \"lg\"", "class.talos-progress-bar--xl": "size() === \"xl\"", "class.talos-progress-bar--rounded": "shape() === \"rounded\"", "class.talos-progress-bar--square": "shape() === \"square\"", "class.talos-progress-bar--subtle": "shape() === \"subtle\"", "class.talos-progress-bar--striped": "striped()", "class.talos-progress-bar--animated": "animated()", "class.talos-progress-bar--inline-layout": "labelPosition() === \"inline\" || isInlineValueLayout()", "attr.role": "\"progressbar\"", "attr.aria-valuenow": "isIndeterminate() ? null : clampedValue()", "attr.aria-valuemin": "isIndeterminate() ? null : min()", "attr.aria-valuemax": "isIndeterminate() ? null : max()", "attr.aria-valuetext": "isIndeterminate() ? null : formattedValue()", "attr.aria-label": "resolvedAriaLabel()", "attr.aria-labelledby": "ariaLabelledby() ?? null", "style.--talos-progress-custom-color": "color() ?? null", "style.--talos-progress-custom-track": "trackColor() ?? null", "style.--talos-progress-custom-buffer": "bufferColor() ?? null", "style.--talos-progress-custom-height": "computedHeight()" }, classAttribute: "talos-progress-bar-host" }, queries: [{ propertyName: "customLabel", first: true, predicate: TalosProgressLabelDirective, descendants: true, isSignal: true }, { propertyName: "customValue", first: true, predicate: TalosProgressValueDirective, descendants: true, isSignal: true }, { propertyName: "customHint", first: true, predicate: TalosProgressHintDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@if (shouldRenderHeader()) {\n <div class=\"talos-progress-bar__header\">\n <div class=\"talos-progress-bar__header-left\">\n <ng-content select=\"[talosProgressLabel], talos-progress-label\"></ng-content>\n @if (label() && labelPosition() === 'top') {\n <span class=\"talos-progress-bar__label\">{{ label() }}</span>\n }\n </div>\n <div class=\"talos-progress-bar__header-right\">\n <ng-content select=\"[talosProgressValue], talos-progress-value\"></ng-content>\n @if (showValue() && valuePosition() === 'top-end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--top-end\">{{ formattedValue() }}</span>\n }\n </div>\n </div>\n}\n\n<div class=\"talos-progress-bar__row\">\n @if (label() && labelPosition() === 'inline') {\n <span class=\"talos-progress-bar__label talos-progress-bar__label--inline\">{{ label() }}</span>\n }\n\n @if (showValue() && valuePosition() === 'start') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--start\">{{ formattedValue() }}</span>\n }\n\n <div class=\"talos-progress-bar__track\" aria-hidden=\"true\">\n @if (isBuffer()) {\n <div\n class=\"talos-progress-bar__buffer-bar\"\n [style.width.%]=\"bufferPercentage()\">\n </div>\n }\n\n <div\n class=\"talos-progress-bar__fill\"\n [style.width.%]=\"isIndeterminate() ? null : percentage()\">\n @if (showValue() && valuePosition() === 'inside' && !isIndeterminate()) {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--inside\">\n {{ formattedValue() }}\n </span>\n }\n </div>\n </div>\n\n @if (showValue() && valuePosition() === 'end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--end\">{{ formattedValue() }}</span>\n }\n</div>\n\n@if (shouldRenderFooter()) {\n <div class=\"talos-progress-bar__footer\">\n <div class=\"talos-progress-bar__footer-left\">\n @if (label() && labelPosition() === 'bottom') {\n <span class=\"talos-progress-bar__label talos-progress-bar__label--bottom\">{{ label() }}</span>\n }\n <ng-content select=\"[talosProgressHint], talos-progress-hint\"></ng-content>\n </div>\n <div class=\"talos-progress-bar__footer-right\">\n @if (showValue() && valuePosition() === 'bottom-end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--bottom-end\">{{ formattedValue() }}</span>\n }\n </div>\n </div>\n} @else {\n <ng-content select=\"[talosProgressHint], talos-progress-hint\"></ng-content>\n}\n", styles: ["@keyframes talos-progress-indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes talos-progress-indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes talos-progress-query{0%{right:-35%;left:100%}60%{right:100%;left:-90%}to{right:100%;left:-90%}}@keyframes talos-progress-stripes{0%{background-position:40px 0}to{background-position:0 0}}:host{display:flex;flex-direction:column;box-sizing:border-box;width:100%;font-family:var(--talos-font-sans, system-ui, sans-serif);--talos-progress-track-bg: #e2e8f0;--talos-progress-fill-bg: var(--talos-primary, #2563eb);--talos-progress-buffer-bg: #93c5fd;--talos-progress-text-color: var(--talos-text-primary, #0f172a);--talos-progress-muted-color: var(--talos-text-muted, #64748b);--talos-progress-height: 8px;--talos-progress-radius: var(--talos-radius-full, 9999px);--talos-progress-transition: width .3s cubic-bezier(.4, 0, .2, 1)}:host .talos-progress-bar__header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.375rem;font-size:var(--talos-font-size-xs, .75rem);line-height:var(--talos-line-height-tight, 1.25)}:host .talos-progress-bar__header-left{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-text-color);font-weight:var(--talos-font-weight-medium, 500)}:host .talos-progress-bar__header-right{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color);font-weight:var(--talos-font-weight-medium, 500);font-variant-numeric:tabular-nums}:host .talos-progress-bar__row{display:flex;align-items:center;width:100%;gap:.625rem}:host .talos-progress-bar__track{position:relative;display:block;width:100%;height:var(--talos-progress-custom-height, var(--talos-progress-height));background-color:var(--talos-progress-custom-track, var(--talos-progress-track-bg));border-radius:var(--talos-progress-radius);overflow:hidden;box-sizing:border-box;transform:translateZ(0)}:host .talos-progress-bar__buffer-bar{position:absolute;top:0;bottom:0;left:0;height:100%;background-color:var(--talos-progress-custom-buffer, var(--talos-progress-buffer-bg));border-radius:inherit;transition:var(--talos-progress-transition)}:host .talos-progress-bar__fill{position:absolute;top:0;bottom:0;left:0;height:100%;background-color:var(--talos-progress-custom-color, var(--talos-progress-fill-bg));border-radius:inherit;transition:var(--talos-progress-transition);display:flex;align-items:center;justify-content:center;overflow:hidden}:host .talos-progress-bar__value{font-size:var(--talos-font-size-xs, .75rem);font-weight:var(--talos-font-weight-semibold, 600);color:var(--talos-progress-text-color);font-variant-numeric:tabular-nums;white-space:nowrap}:host .talos-progress-bar__value--start,:host .talos-progress-bar__value--end{flex-shrink:0;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__value--inside{color:#fff;font-size:.6875rem;padding:0 .5rem;text-shadow:0 1px 2px rgba(0,0,0,.2)}:host .talos-progress-bar__label{font-size:var(--talos-font-size-xs, .75rem);font-weight:var(--talos-font-weight-medium, 500);color:var(--talos-progress-text-color);white-space:nowrap}:host .talos-progress-bar__label--inline{flex-shrink:0;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__label--bottom{color:var(--talos-progress-muted-color)}:host .talos-progress-bar__footer{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:.375rem;font-size:var(--talos-font-size-xs, .75rem);line-height:var(--talos-line-height-tight, 1.25)}:host .talos-progress-bar__footer-left{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__footer-right{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color);font-variant-numeric:tabular-nums}:host.talos-progress-bar--xs{--talos-progress-height: 2px}:host.talos-progress-bar--sm{--talos-progress-height: 4px}:host.talos-progress-bar--md{--talos-progress-height: 8px}:host.talos-progress-bar--lg{--talos-progress-height: 12px}:host.talos-progress-bar--xl{--talos-progress-height: 18px}:host.talos-progress-bar--rounded{--talos-progress-radius: var(--talos-radius-full, 9999px)}:host.talos-progress-bar--square{--talos-progress-radius: var(--talos-radius-none, 0px)}:host.talos-progress-bar--subtle{--talos-progress-radius: var(--talos-radius-sm, .25rem)}:host.talos-progress-bar--primary{--talos-progress-fill-bg: var(--talos-primary, #2563eb);--talos-progress-buffer-bg: var(--talos-progress-buffer-primary, #93c5fd)}:host.talos-progress-bar--secondary,:host.talos-progress-bar--neutral{--talos-progress-fill-bg: var(--talos-neutral, #475569);--talos-progress-buffer-bg: var(--talos-progress-buffer-neutral, #94a3b8)}:host.talos-progress-bar--success{--talos-progress-fill-bg: var(--talos-success, #16a34a);--talos-progress-buffer-bg: var(--talos-progress-buffer-success, #86efac)}:host.talos-progress-bar--warning{--talos-progress-fill-bg: var(--talos-warning, #d97706);--talos-progress-buffer-bg: var(--talos-progress-buffer-warning, #fcd34d)}:host.talos-progress-bar--danger,:host.talos-progress-bar--error{--talos-progress-fill-bg: var(--talos-danger, #ef4444);--talos-progress-buffer-bg: var(--talos-progress-buffer-danger, #fca5a5)}:host.talos-progress-bar--info{--talos-progress-fill-bg: var(--talos-info, #0284c7);--talos-progress-buffer-bg: var(--talos-progress-buffer-info, #7dd3fc)}:host.talos-progress-bar--gradient{--talos-progress-fill-bg: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #ec4899 100%);--talos-progress-buffer-bg: var(--talos-progress-buffer-gradient, #c4b5fd)}:host :host-context([data-theme=dark]),:host :host-context([data-mode=dark]),:host :host-context(.dark),:host :host-context(.dark-theme){--talos-progress-track-bg: rgba(255, 255, 255, .1);--talos-progress-fill-bg: var(--talos-primary, #3b82f6);--talos-progress-buffer-bg: rgba(59, 130, 246, .35);--talos-progress-text-color: var(--talos-text-primary, #f8fafc);--talos-progress-muted-color: var(--talos-text-muted, #94a3b8)}:host :host-context([data-theme=dark]).talos-progress-bar--primary,:host :host-context([data-mode=dark]).talos-progress-bar--primary,:host :host-context(.dark).talos-progress-bar--primary,:host :host-context(.dark-theme).talos-progress-bar--primary{--talos-progress-fill-bg: var(--talos-primary, #3b82f6);--talos-progress-buffer-bg: rgba(59, 130, 246, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--secondary,:host :host-context([data-theme=dark]).talos-progress-bar--neutral,:host :host-context([data-mode=dark]).talos-progress-bar--secondary,:host :host-context([data-mode=dark]).talos-progress-bar--neutral,:host :host-context(.dark).talos-progress-bar--secondary,:host :host-context(.dark).talos-progress-bar--neutral,:host :host-context(.dark-theme).talos-progress-bar--secondary,:host :host-context(.dark-theme).talos-progress-bar--neutral{--talos-progress-fill-bg: #94a3b8;--talos-progress-buffer-bg: rgba(148, 163, 184, .25)}:host :host-context([data-theme=dark]).talos-progress-bar--success,:host :host-context([data-mode=dark]).talos-progress-bar--success,:host :host-context(.dark).talos-progress-bar--success,:host :host-context(.dark-theme).talos-progress-bar--success{--talos-progress-fill-bg: #22c55e;--talos-progress-buffer-bg: rgba(34, 197, 94, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--warning,:host :host-context([data-mode=dark]).talos-progress-bar--warning,:host :host-context(.dark).talos-progress-bar--warning,:host :host-context(.dark-theme).talos-progress-bar--warning{--talos-progress-fill-bg: #f59e0b;--talos-progress-buffer-bg: rgba(245, 158, 11, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--danger,:host :host-context([data-theme=dark]).talos-progress-bar--error,:host :host-context([data-mode=dark]).talos-progress-bar--danger,:host :host-context([data-mode=dark]).talos-progress-bar--error,:host :host-context(.dark).talos-progress-bar--danger,:host :host-context(.dark).talos-progress-bar--error,:host :host-context(.dark-theme).talos-progress-bar--danger,:host :host-context(.dark-theme).talos-progress-bar--error{--talos-progress-fill-bg: #ef4444;--talos-progress-buffer-bg: rgba(239, 68, 68, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--info,:host :host-context([data-mode=dark]).talos-progress-bar--info,:host :host-context(.dark).talos-progress-bar--info,:host :host-context(.dark-theme).talos-progress-bar--info{--talos-progress-fill-bg: #0ea5e9;--talos-progress-buffer-bg: rgba(14, 165, 233, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--gradient,:host :host-context([data-mode=dark]).talos-progress-bar--gradient,:host :host-context(.dark).talos-progress-bar--gradient,:host :host-context(.dark-theme).talos-progress-bar--gradient{--talos-progress-fill-bg: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);--talos-progress-buffer-bg: rgba(99, 102, 241, .35)}:host.talos-progress-bar--striped .talos-progress-bar__fill{background-image:linear-gradient(45deg,rgba(255,255,255,.18) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.18) 50%,rgba(255,255,255,.18) 75%,transparent 75%,transparent);background-size:24px 24px}:host.talos-progress-bar--animated.talos-progress-bar--striped .talos-progress-bar__fill{animation:talos-progress-stripes 1s linear infinite}:host.talos-progress-bar--indeterminate .talos-progress-bar__fill{width:auto!important;animation:talos-progress-indeterminate 2s cubic-bezier(.65,.815,.735,.395) infinite}:host.talos-progress-bar--query .talos-progress-bar__fill{width:auto!important;animation:talos-progress-query 2s cubic-bezier(.65,.815,.735,.395) infinite}@media(prefers-reduced-motion:reduce){:host .talos-progress-bar__fill,:host .talos-progress-bar__buffer-bar{transition:none!important;animation:none!important}}\n"] });
|
|
1328
|
+
}
|
|
1329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarComponent, decorators: [{
|
|
1330
|
+
type: Component,
|
|
1331
|
+
args: [{ selector: 'talos-progress-bar, [talosProgressBar]', host: {
|
|
1332
|
+
'class': 'talos-progress-bar-host',
|
|
1333
|
+
'[class.talos-progress-bar--determinate]': 'mode() === "determinate"',
|
|
1334
|
+
'[class.talos-progress-bar--indeterminate]': 'mode() === "indeterminate"',
|
|
1335
|
+
'[class.talos-progress-bar--buffer]': 'mode() === "buffer"',
|
|
1336
|
+
'[class.talos-progress-bar--query]': 'mode() === "query"',
|
|
1337
|
+
'[class.talos-progress-bar--primary]': 'variant() === "primary"',
|
|
1338
|
+
'[class.talos-progress-bar--secondary]': 'variant() === "secondary"',
|
|
1339
|
+
'[class.talos-progress-bar--success]': 'variant() === "success"',
|
|
1340
|
+
'[class.talos-progress-bar--warning]': 'variant() === "warning"',
|
|
1341
|
+
'[class.talos-progress-bar--danger]': 'variant() === "danger" || variant() === "error"',
|
|
1342
|
+
'[class.talos-progress-bar--error]': 'variant() === "danger" || variant() === "error"',
|
|
1343
|
+
'[class.talos-progress-bar--info]': 'variant() === "info"',
|
|
1344
|
+
'[class.talos-progress-bar--neutral]': 'variant() === "neutral"',
|
|
1345
|
+
'[class.talos-progress-bar--gradient]': 'variant() === "gradient"',
|
|
1346
|
+
'[class.talos-progress-bar--xs]': 'size() === "xs"',
|
|
1347
|
+
'[class.talos-progress-bar--sm]': 'size() === "sm"',
|
|
1348
|
+
'[class.talos-progress-bar--md]': 'size() === "md"',
|
|
1349
|
+
'[class.talos-progress-bar--lg]': 'size() === "lg"',
|
|
1350
|
+
'[class.talos-progress-bar--xl]': 'size() === "xl"',
|
|
1351
|
+
'[class.talos-progress-bar--rounded]': 'shape() === "rounded"',
|
|
1352
|
+
'[class.talos-progress-bar--square]': 'shape() === "square"',
|
|
1353
|
+
'[class.talos-progress-bar--subtle]': 'shape() === "subtle"',
|
|
1354
|
+
'[class.talos-progress-bar--striped]': 'striped()',
|
|
1355
|
+
'[class.talos-progress-bar--animated]': 'animated()',
|
|
1356
|
+
'[class.talos-progress-bar--inline-layout]': 'labelPosition() === "inline" || isInlineValueLayout()',
|
|
1357
|
+
'[attr.role]': '"progressbar"',
|
|
1358
|
+
'[attr.aria-valuenow]': 'isIndeterminate() ? null : clampedValue()',
|
|
1359
|
+
'[attr.aria-valuemin]': 'isIndeterminate() ? null : min()',
|
|
1360
|
+
'[attr.aria-valuemax]': 'isIndeterminate() ? null : max()',
|
|
1361
|
+
'[attr.aria-valuetext]': 'isIndeterminate() ? null : formattedValue()',
|
|
1362
|
+
'[attr.aria-label]': 'resolvedAriaLabel()',
|
|
1363
|
+
'[attr.aria-labelledby]': 'ariaLabelledby() ?? null',
|
|
1364
|
+
'[style.--talos-progress-custom-color]': 'color() ?? null',
|
|
1365
|
+
'[style.--talos-progress-custom-track]': 'trackColor() ?? null',
|
|
1366
|
+
'[style.--talos-progress-custom-buffer]': 'bufferColor() ?? null',
|
|
1367
|
+
'[style.--talos-progress-custom-height]': 'computedHeight()'
|
|
1368
|
+
}, template: "@if (shouldRenderHeader()) {\n <div class=\"talos-progress-bar__header\">\n <div class=\"talos-progress-bar__header-left\">\n <ng-content select=\"[talosProgressLabel], talos-progress-label\"></ng-content>\n @if (label() && labelPosition() === 'top') {\n <span class=\"talos-progress-bar__label\">{{ label() }}</span>\n }\n </div>\n <div class=\"talos-progress-bar__header-right\">\n <ng-content select=\"[talosProgressValue], talos-progress-value\"></ng-content>\n @if (showValue() && valuePosition() === 'top-end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--top-end\">{{ formattedValue() }}</span>\n }\n </div>\n </div>\n}\n\n<div class=\"talos-progress-bar__row\">\n @if (label() && labelPosition() === 'inline') {\n <span class=\"talos-progress-bar__label talos-progress-bar__label--inline\">{{ label() }}</span>\n }\n\n @if (showValue() && valuePosition() === 'start') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--start\">{{ formattedValue() }}</span>\n }\n\n <div class=\"talos-progress-bar__track\" aria-hidden=\"true\">\n @if (isBuffer()) {\n <div\n class=\"talos-progress-bar__buffer-bar\"\n [style.width.%]=\"bufferPercentage()\">\n </div>\n }\n\n <div\n class=\"talos-progress-bar__fill\"\n [style.width.%]=\"isIndeterminate() ? null : percentage()\">\n @if (showValue() && valuePosition() === 'inside' && !isIndeterminate()) {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--inside\">\n {{ formattedValue() }}\n </span>\n }\n </div>\n </div>\n\n @if (showValue() && valuePosition() === 'end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--end\">{{ formattedValue() }}</span>\n }\n</div>\n\n@if (shouldRenderFooter()) {\n <div class=\"talos-progress-bar__footer\">\n <div class=\"talos-progress-bar__footer-left\">\n @if (label() && labelPosition() === 'bottom') {\n <span class=\"talos-progress-bar__label talos-progress-bar__label--bottom\">{{ label() }}</span>\n }\n <ng-content select=\"[talosProgressHint], talos-progress-hint\"></ng-content>\n </div>\n <div class=\"talos-progress-bar__footer-right\">\n @if (showValue() && valuePosition() === 'bottom-end') {\n <span class=\"talos-progress-bar__value talos-progress-bar__value--bottom-end\">{{ formattedValue() }}</span>\n }\n </div>\n </div>\n} @else {\n <ng-content select=\"[talosProgressHint], talos-progress-hint\"></ng-content>\n}\n", styles: ["@keyframes talos-progress-indeterminate{0%{left:-35%;right:100%}60%{left:100%;right:-90%}to{left:100%;right:-90%}}@keyframes talos-progress-indeterminate-short{0%{left:-200%;right:100%}60%{left:107%;right:-8%}to{left:107%;right:-8%}}@keyframes talos-progress-query{0%{right:-35%;left:100%}60%{right:100%;left:-90%}to{right:100%;left:-90%}}@keyframes talos-progress-stripes{0%{background-position:40px 0}to{background-position:0 0}}:host{display:flex;flex-direction:column;box-sizing:border-box;width:100%;font-family:var(--talos-font-sans, system-ui, sans-serif);--talos-progress-track-bg: #e2e8f0;--talos-progress-fill-bg: var(--talos-primary, #2563eb);--talos-progress-buffer-bg: #93c5fd;--talos-progress-text-color: var(--talos-text-primary, #0f172a);--talos-progress-muted-color: var(--talos-text-muted, #64748b);--talos-progress-height: 8px;--talos-progress-radius: var(--talos-radius-full, 9999px);--talos-progress-transition: width .3s cubic-bezier(.4, 0, .2, 1)}:host .talos-progress-bar__header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.375rem;font-size:var(--talos-font-size-xs, .75rem);line-height:var(--talos-line-height-tight, 1.25)}:host .talos-progress-bar__header-left{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-text-color);font-weight:var(--talos-font-weight-medium, 500)}:host .talos-progress-bar__header-right{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color);font-weight:var(--talos-font-weight-medium, 500);font-variant-numeric:tabular-nums}:host .talos-progress-bar__row{display:flex;align-items:center;width:100%;gap:.625rem}:host .talos-progress-bar__track{position:relative;display:block;width:100%;height:var(--talos-progress-custom-height, var(--talos-progress-height));background-color:var(--talos-progress-custom-track, var(--talos-progress-track-bg));border-radius:var(--talos-progress-radius);overflow:hidden;box-sizing:border-box;transform:translateZ(0)}:host .talos-progress-bar__buffer-bar{position:absolute;top:0;bottom:0;left:0;height:100%;background-color:var(--talos-progress-custom-buffer, var(--talos-progress-buffer-bg));border-radius:inherit;transition:var(--talos-progress-transition)}:host .talos-progress-bar__fill{position:absolute;top:0;bottom:0;left:0;height:100%;background-color:var(--talos-progress-custom-color, var(--talos-progress-fill-bg));border-radius:inherit;transition:var(--talos-progress-transition);display:flex;align-items:center;justify-content:center;overflow:hidden}:host .talos-progress-bar__value{font-size:var(--talos-font-size-xs, .75rem);font-weight:var(--talos-font-weight-semibold, 600);color:var(--talos-progress-text-color);font-variant-numeric:tabular-nums;white-space:nowrap}:host .talos-progress-bar__value--start,:host .talos-progress-bar__value--end{flex-shrink:0;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__value--inside{color:#fff;font-size:.6875rem;padding:0 .5rem;text-shadow:0 1px 2px rgba(0,0,0,.2)}:host .talos-progress-bar__label{font-size:var(--talos-font-size-xs, .75rem);font-weight:var(--talos-font-weight-medium, 500);color:var(--talos-progress-text-color);white-space:nowrap}:host .talos-progress-bar__label--inline{flex-shrink:0;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__label--bottom{color:var(--talos-progress-muted-color)}:host .talos-progress-bar__footer{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-top:.375rem;font-size:var(--talos-font-size-xs, .75rem);line-height:var(--talos-line-height-tight, 1.25)}:host .talos-progress-bar__footer-left{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color)}:host .talos-progress-bar__footer-right{display:inline-flex;align-items:center;gap:.5rem;color:var(--talos-progress-muted-color);font-variant-numeric:tabular-nums}:host.talos-progress-bar--xs{--talos-progress-height: 2px}:host.talos-progress-bar--sm{--talos-progress-height: 4px}:host.talos-progress-bar--md{--talos-progress-height: 8px}:host.talos-progress-bar--lg{--talos-progress-height: 12px}:host.talos-progress-bar--xl{--talos-progress-height: 18px}:host.talos-progress-bar--rounded{--talos-progress-radius: var(--talos-radius-full, 9999px)}:host.talos-progress-bar--square{--talos-progress-radius: var(--talos-radius-none, 0px)}:host.talos-progress-bar--subtle{--talos-progress-radius: var(--talos-radius-sm, .25rem)}:host.talos-progress-bar--primary{--talos-progress-fill-bg: var(--talos-primary, #2563eb);--talos-progress-buffer-bg: var(--talos-progress-buffer-primary, #93c5fd)}:host.talos-progress-bar--secondary,:host.talos-progress-bar--neutral{--talos-progress-fill-bg: var(--talos-neutral, #475569);--talos-progress-buffer-bg: var(--talos-progress-buffer-neutral, #94a3b8)}:host.talos-progress-bar--success{--talos-progress-fill-bg: var(--talos-success, #16a34a);--talos-progress-buffer-bg: var(--talos-progress-buffer-success, #86efac)}:host.talos-progress-bar--warning{--talos-progress-fill-bg: var(--talos-warning, #d97706);--talos-progress-buffer-bg: var(--talos-progress-buffer-warning, #fcd34d)}:host.talos-progress-bar--danger,:host.talos-progress-bar--error{--talos-progress-fill-bg: var(--talos-danger, #ef4444);--talos-progress-buffer-bg: var(--talos-progress-buffer-danger, #fca5a5)}:host.talos-progress-bar--info{--talos-progress-fill-bg: var(--talos-info, #0284c7);--talos-progress-buffer-bg: var(--talos-progress-buffer-info, #7dd3fc)}:host.talos-progress-bar--gradient{--talos-progress-fill-bg: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #ec4899 100%);--talos-progress-buffer-bg: var(--talos-progress-buffer-gradient, #c4b5fd)}:host :host-context([data-theme=dark]),:host :host-context([data-mode=dark]),:host :host-context(.dark),:host :host-context(.dark-theme){--talos-progress-track-bg: rgba(255, 255, 255, .1);--talos-progress-fill-bg: var(--talos-primary, #3b82f6);--talos-progress-buffer-bg: rgba(59, 130, 246, .35);--talos-progress-text-color: var(--talos-text-primary, #f8fafc);--talos-progress-muted-color: var(--talos-text-muted, #94a3b8)}:host :host-context([data-theme=dark]).talos-progress-bar--primary,:host :host-context([data-mode=dark]).talos-progress-bar--primary,:host :host-context(.dark).talos-progress-bar--primary,:host :host-context(.dark-theme).talos-progress-bar--primary{--talos-progress-fill-bg: var(--talos-primary, #3b82f6);--talos-progress-buffer-bg: rgba(59, 130, 246, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--secondary,:host :host-context([data-theme=dark]).talos-progress-bar--neutral,:host :host-context([data-mode=dark]).talos-progress-bar--secondary,:host :host-context([data-mode=dark]).talos-progress-bar--neutral,:host :host-context(.dark).talos-progress-bar--secondary,:host :host-context(.dark).talos-progress-bar--neutral,:host :host-context(.dark-theme).talos-progress-bar--secondary,:host :host-context(.dark-theme).talos-progress-bar--neutral{--talos-progress-fill-bg: #94a3b8;--talos-progress-buffer-bg: rgba(148, 163, 184, .25)}:host :host-context([data-theme=dark]).talos-progress-bar--success,:host :host-context([data-mode=dark]).talos-progress-bar--success,:host :host-context(.dark).talos-progress-bar--success,:host :host-context(.dark-theme).talos-progress-bar--success{--talos-progress-fill-bg: #22c55e;--talos-progress-buffer-bg: rgba(34, 197, 94, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--warning,:host :host-context([data-mode=dark]).talos-progress-bar--warning,:host :host-context(.dark).talos-progress-bar--warning,:host :host-context(.dark-theme).talos-progress-bar--warning{--talos-progress-fill-bg: #f59e0b;--talos-progress-buffer-bg: rgba(245, 158, 11, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--danger,:host :host-context([data-theme=dark]).talos-progress-bar--error,:host :host-context([data-mode=dark]).talos-progress-bar--danger,:host :host-context([data-mode=dark]).talos-progress-bar--error,:host :host-context(.dark).talos-progress-bar--danger,:host :host-context(.dark).talos-progress-bar--error,:host :host-context(.dark-theme).talos-progress-bar--danger,:host :host-context(.dark-theme).talos-progress-bar--error{--talos-progress-fill-bg: #ef4444;--talos-progress-buffer-bg: rgba(239, 68, 68, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--info,:host :host-context([data-mode=dark]).talos-progress-bar--info,:host :host-context(.dark).talos-progress-bar--info,:host :host-context(.dark-theme).talos-progress-bar--info{--talos-progress-fill-bg: #0ea5e9;--talos-progress-buffer-bg: rgba(14, 165, 233, .35)}:host :host-context([data-theme=dark]).talos-progress-bar--gradient,:host :host-context([data-mode=dark]).talos-progress-bar--gradient,:host :host-context(.dark).talos-progress-bar--gradient,:host :host-context(.dark-theme).talos-progress-bar--gradient{--talos-progress-fill-bg: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);--talos-progress-buffer-bg: rgba(99, 102, 241, .35)}:host.talos-progress-bar--striped .talos-progress-bar__fill{background-image:linear-gradient(45deg,rgba(255,255,255,.18) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.18) 50%,rgba(255,255,255,.18) 75%,transparent 75%,transparent);background-size:24px 24px}:host.talos-progress-bar--animated.talos-progress-bar--striped .talos-progress-bar__fill{animation:talos-progress-stripes 1s linear infinite}:host.talos-progress-bar--indeterminate .talos-progress-bar__fill{width:auto!important;animation:talos-progress-indeterminate 2s cubic-bezier(.65,.815,.735,.395) infinite}:host.talos-progress-bar--query .talos-progress-bar__fill{width:auto!important;animation:talos-progress-query 2s cubic-bezier(.65,.815,.735,.395) infinite}@media(prefers-reduced-motion:reduce){:host .talos-progress-bar__fill,:host .talos-progress-bar__buffer-bar{transition:none!important;animation:none!important}}\n"] }]
|
|
1369
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], bufferValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferValue", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }], valuePosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "valuePosition", required: false }] }], valueFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormatter", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], trackColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackColor", required: false }] }], bufferColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bufferColor", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledby", required: false }] }], customLabel: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TalosProgressLabelDirective), { isSignal: true }] }], customValue: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TalosProgressValueDirective), { isSignal: true }] }], customHint: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TalosProgressHintDirective), { isSignal: true }] }] } });
|
|
1370
|
+
|
|
1371
|
+
const PROGRESS_BAR_DECLARATIONS = [
|
|
1372
|
+
TalosProgressBarComponent,
|
|
1373
|
+
TalosProgressLabelDirective,
|
|
1374
|
+
TalosProgressValueDirective,
|
|
1375
|
+
TalosProgressHintDirective
|
|
1376
|
+
];
|
|
1377
|
+
class TalosProgressBarModule {
|
|
1378
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1379
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarModule, imports: [TalosProgressBarComponent,
|
|
1380
|
+
TalosProgressLabelDirective,
|
|
1381
|
+
TalosProgressValueDirective,
|
|
1382
|
+
TalosProgressHintDirective], exports: [TalosProgressBarComponent,
|
|
1383
|
+
TalosProgressLabelDirective,
|
|
1384
|
+
TalosProgressValueDirective,
|
|
1385
|
+
TalosProgressHintDirective] });
|
|
1386
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarModule });
|
|
1387
|
+
}
|
|
1388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosProgressBarModule, decorators: [{
|
|
1389
|
+
type: NgModule,
|
|
1390
|
+
args: [{
|
|
1391
|
+
imports: [...PROGRESS_BAR_DECLARATIONS],
|
|
1392
|
+
exports: [...PROGRESS_BAR_DECLARATIONS]
|
|
1393
|
+
}]
|
|
1394
|
+
}] });
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Normalizes CSS dimension input (number converted to px string, or raw string).
|
|
1398
|
+
* @param value Dimension input as string or number
|
|
1399
|
+
* @returns CSS dimension string or undefined
|
|
1400
|
+
*/
|
|
1401
|
+
function resolveCssDimension(value) {
|
|
1402
|
+
if (value === null || value === undefined || value === '') {
|
|
1403
|
+
return undefined;
|
|
1404
|
+
}
|
|
1405
|
+
if (typeof value === 'number') {
|
|
1406
|
+
return `${value}px`;
|
|
1407
|
+
}
|
|
1408
|
+
const trimmed = value.trim();
|
|
1409
|
+
if (/^\d+$/.test(trimmed)) {
|
|
1410
|
+
return `${trimmed}px`;
|
|
1411
|
+
}
|
|
1412
|
+
return trimmed;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
/**
|
|
1416
|
+
* Directive that attaches skeleton loading state directly to any HTML tag or component.
|
|
1417
|
+
*
|
|
1418
|
+
* Conceals element content and text while preserving exact layout geometry and dimensions
|
|
1419
|
+
* (0 Cumulative Layout Shift), while applying an animated shimmer or pulse placeholder mask.
|
|
1420
|
+
*
|
|
1421
|
+
* @example
|
|
1422
|
+
* ```html
|
|
1423
|
+
* <h3 [talosSkeleton]="isLoading()">{{ profile().name }}</h3>
|
|
1424
|
+
* <button [talosSkeleton]="isSaving()" talosButton>Submit</button>
|
|
1425
|
+
* <div [talosSkeleton]="loading()" talosSkeletonShape="circular" style="width: 48px; height: 48px;"></div>
|
|
1426
|
+
* ```
|
|
1427
|
+
*/
|
|
1428
|
+
class TalosSkeletonDirective {
|
|
1429
|
+
/**
|
|
1430
|
+
* Whether the skeleton loading state is active.
|
|
1431
|
+
* Accepts a boolean, string ('true'/'false'/empty attribute), or signal value.
|
|
1432
|
+
*/
|
|
1433
|
+
talosSkeleton = input(true, /* @ts-ignore */
|
|
1434
|
+
...(ngDevMode ? [{ debugName: "talosSkeleton" }] : /* istanbul ignore next */ []));
|
|
1435
|
+
/**
|
|
1436
|
+
* Animation style when skeleton state is active.
|
|
1437
|
+
* @default 'shimmer'
|
|
1438
|
+
*/
|
|
1439
|
+
animation = input('shimmer', { ...(ngDevMode ? { debugName: "animation" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonAnimation' });
|
|
1440
|
+
/**
|
|
1441
|
+
* Visual shape variant of the attached skeleton mask.
|
|
1442
|
+
* @default 'rounded'
|
|
1443
|
+
*/
|
|
1444
|
+
shape = input('rounded', { ...(ngDevMode ? { debugName: "shape" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonShape' });
|
|
1445
|
+
/**
|
|
1446
|
+
* Visual shape alias for consistency with variant.
|
|
1447
|
+
*/
|
|
1448
|
+
variant = input(undefined, { ...(ngDevMode ? { debugName: "variant" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonVariant' });
|
|
1449
|
+
/**
|
|
1450
|
+
* Explicit width override while loading.
|
|
1451
|
+
*/
|
|
1452
|
+
width = input(undefined, { ...(ngDevMode ? { debugName: "width" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonWidth' });
|
|
1453
|
+
/**
|
|
1454
|
+
* Explicit height override while loading.
|
|
1455
|
+
*/
|
|
1456
|
+
height = input(undefined, { ...(ngDevMode ? { debugName: "height" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonHeight' });
|
|
1457
|
+
/**
|
|
1458
|
+
* Explicit border-radius override while loading.
|
|
1459
|
+
*/
|
|
1460
|
+
borderRadius = input(undefined, { ...(ngDevMode ? { debugName: "borderRadius" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonRadius' });
|
|
1461
|
+
/**
|
|
1462
|
+
* Accessible description announced to assistive technology when busy.
|
|
1463
|
+
* @default 'Loading content...'
|
|
1464
|
+
*/
|
|
1465
|
+
ariaLabel = input('Loading content...', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'talosSkeletonAriaLabel' });
|
|
1466
|
+
/** Resolved active state boolean */
|
|
1467
|
+
isActive = computed(() => {
|
|
1468
|
+
const val = this.talosSkeleton();
|
|
1469
|
+
if (val === '' || val === 'true') {
|
|
1470
|
+
return true;
|
|
1471
|
+
}
|
|
1472
|
+
if (val === 'false' || val === false || val === null || val === undefined) {
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1475
|
+
return Boolean(val);
|
|
1476
|
+
}, /* @ts-ignore */
|
|
1477
|
+
...(ngDevMode ? [{ debugName: "isActive" }] : /* istanbul ignore next */ []));
|
|
1478
|
+
/** Resolved active shape variant */
|
|
1479
|
+
activeShape = computed(() => {
|
|
1480
|
+
return this.variant() ?? this.shape();
|
|
1481
|
+
}, /* @ts-ignore */
|
|
1482
|
+
...(ngDevMode ? [{ debugName: "activeShape" }] : /* istanbul ignore next */ []));
|
|
1483
|
+
isCircular = computed(() => {
|
|
1484
|
+
const s = this.activeShape();
|
|
1485
|
+
return s === 'circular' || s === 'avatar';
|
|
1486
|
+
}, /* @ts-ignore */
|
|
1487
|
+
...(ngDevMode ? [{ debugName: "isCircular" }] : /* istanbul ignore next */ []));
|
|
1488
|
+
isRounded = computed(() => {
|
|
1489
|
+
const s = this.activeShape();
|
|
1490
|
+
return s === 'rounded' || s === 'button' || s === 'text';
|
|
1491
|
+
}, /* @ts-ignore */
|
|
1492
|
+
...(ngDevMode ? [{ debugName: "isRounded" }] : /* istanbul ignore next */ []));
|
|
1493
|
+
isRectangular = computed(() => {
|
|
1494
|
+
return this.activeShape() === 'rectangular';
|
|
1495
|
+
}, /* @ts-ignore */
|
|
1496
|
+
...(ngDevMode ? [{ debugName: "isRectangular" }] : /* istanbul ignore next */ []));
|
|
1497
|
+
computedWidth = computed(() => {
|
|
1498
|
+
if (!this.isActive()) {
|
|
1499
|
+
return null;
|
|
1500
|
+
}
|
|
1501
|
+
return resolveCssDimension(this.width()) ?? null;
|
|
1502
|
+
}, /* @ts-ignore */
|
|
1503
|
+
...(ngDevMode ? [{ debugName: "computedWidth" }] : /* istanbul ignore next */ []));
|
|
1504
|
+
computedHeight = computed(() => {
|
|
1505
|
+
if (!this.isActive()) {
|
|
1506
|
+
return null;
|
|
1507
|
+
}
|
|
1508
|
+
return resolveCssDimension(this.height()) ?? null;
|
|
1509
|
+
}, /* @ts-ignore */
|
|
1510
|
+
...(ngDevMode ? [{ debugName: "computedHeight" }] : /* istanbul ignore next */ []));
|
|
1511
|
+
computedRadius = computed(() => {
|
|
1512
|
+
if (!this.isActive()) {
|
|
1513
|
+
return null;
|
|
1514
|
+
}
|
|
1515
|
+
const custom = resolveCssDimension(this.borderRadius());
|
|
1516
|
+
if (custom) {
|
|
1517
|
+
return custom;
|
|
1518
|
+
}
|
|
1519
|
+
if (this.isCircular()) {
|
|
1520
|
+
return '50%';
|
|
1521
|
+
}
|
|
1522
|
+
return null;
|
|
1523
|
+
}, /* @ts-ignore */
|
|
1524
|
+
...(ngDevMode ? [{ debugName: "computedRadius" }] : /* istanbul ignore next */ []));
|
|
1525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1526
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosSkeletonDirective, isStandalone: true, selector: "[talosSkeleton]", inputs: { talosSkeleton: { classPropertyName: "talosSkeleton", publicName: "talosSkeleton", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "talosSkeletonAnimation", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "talosSkeletonShape", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "talosSkeletonVariant", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "talosSkeletonWidth", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "talosSkeletonHeight", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "talosSkeletonRadius", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "talosSkeletonAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-skeleton-active": "isActive()", "class.talos-skeleton--shimmer": "isActive() && animation() === \"shimmer\"", "class.talos-skeleton--pulse": "isActive() && animation() === \"pulse\"", "class.talos-skeleton--no-animation": "isActive() && animation() === \"none\"", "class.talos-skeleton--circular": "isActive() && isCircular()", "class.talos-skeleton--rounded": "isActive() && isRounded()", "class.talos-skeleton--rectangular": "isActive() && isRectangular()", "style.width": "computedWidth()", "style.height": "computedHeight()", "style.border-radius": "computedRadius()", "attr.aria-busy": "isActive() ? \"true\" : null", "attr.aria-live": "isActive() ? \"polite\" : null", "attr.aria-label": "isActive() ? ariaLabel() : null" }, classAttribute: "talos-skeleton-attached" }, ngImport: i0 });
|
|
1527
|
+
}
|
|
1528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonDirective, decorators: [{
|
|
1529
|
+
type: Directive,
|
|
1530
|
+
args: [{
|
|
1531
|
+
selector: '[talosSkeleton]',
|
|
1532
|
+
host: {
|
|
1533
|
+
'class': 'talos-skeleton-attached',
|
|
1534
|
+
'[class.talos-skeleton-active]': 'isActive()',
|
|
1535
|
+
'[class.talos-skeleton--shimmer]': 'isActive() && animation() === "shimmer"',
|
|
1536
|
+
'[class.talos-skeleton--pulse]': 'isActive() && animation() === "pulse"',
|
|
1537
|
+
'[class.talos-skeleton--no-animation]': 'isActive() && animation() === "none"',
|
|
1538
|
+
'[class.talos-skeleton--circular]': 'isActive() && isCircular()',
|
|
1539
|
+
'[class.talos-skeleton--rounded]': 'isActive() && isRounded()',
|
|
1540
|
+
'[class.talos-skeleton--rectangular]': 'isActive() && isRectangular()',
|
|
1541
|
+
'[style.width]': 'computedWidth()',
|
|
1542
|
+
'[style.height]': 'computedHeight()',
|
|
1543
|
+
'[style.border-radius]': 'computedRadius()',
|
|
1544
|
+
'[attr.aria-busy]': 'isActive() ? "true" : null',
|
|
1545
|
+
'[attr.aria-live]': 'isActive() ? "polite" : null',
|
|
1546
|
+
'[attr.aria-label]': 'isActive() ? ariaLabel() : null'
|
|
1547
|
+
}
|
|
1548
|
+
}]
|
|
1549
|
+
}], propDecorators: { talosSkeleton: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeleton", required: false }] }], animation: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonAnimation", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonShape", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonVariant", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonWidth", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonHeight", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonRadius", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSkeletonAriaLabel", required: false }] }] } });
|
|
1550
|
+
|
|
1551
|
+
/**
|
|
1552
|
+
* Modern, accessible skeleton loader placeholder component for asynchronous data loading states.
|
|
1553
|
+
*
|
|
1554
|
+
* Supports various geometric shapes, fluid shimmer/pulse animations, multi-line typography
|
|
1555
|
+
* simulation with customizable last line tapering, and automatic content projection toggle.
|
|
1556
|
+
*
|
|
1557
|
+
* @example
|
|
1558
|
+
* ```html
|
|
1559
|
+
* <!-- Single line or custom shape -->
|
|
1560
|
+
* <talos-skeleton variant="text" width="180px" />
|
|
1561
|
+
* <talos-skeleton variant="circular" width="48px" height="48px" />
|
|
1562
|
+
*
|
|
1563
|
+
* <!-- Multi-line paragraph -->
|
|
1564
|
+
* <talos-skeleton variant="text" [count]="3" lastLineWidth="65%" />
|
|
1565
|
+
*
|
|
1566
|
+
* <!-- Conditional content wrapper -->
|
|
1567
|
+
* <talos-skeleton [loading]="isLoading()">
|
|
1568
|
+
* <div class="user-content">Loaded User Profile</div>
|
|
1569
|
+
* </talos-skeleton>
|
|
1570
|
+
* ```
|
|
1571
|
+
*/
|
|
1572
|
+
class TalosSkeletonComponent {
|
|
1573
|
+
/**
|
|
1574
|
+
* Visual shape variant of the skeleton.
|
|
1575
|
+
* @default 'text'
|
|
1576
|
+
*/
|
|
1577
|
+
variant = input('text', /* @ts-ignore */
|
|
1578
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1579
|
+
/**
|
|
1580
|
+
* Animation style applied while loading.
|
|
1581
|
+
* @default 'shimmer'
|
|
1582
|
+
*/
|
|
1583
|
+
animation = input('shimmer', /* @ts-ignore */
|
|
1584
|
+
...(ngDevMode ? [{ debugName: "animation" }] : /* istanbul ignore next */ []));
|
|
1585
|
+
/**
|
|
1586
|
+
* Sizing scale preset for text and circular variants.
|
|
1587
|
+
* @default 'md'
|
|
1588
|
+
*/
|
|
1589
|
+
size = input('md', /* @ts-ignore */
|
|
1590
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1591
|
+
/**
|
|
1592
|
+
* Explicit width override (e.g., '100%', '240px', or number in pixels).
|
|
1593
|
+
*/
|
|
1594
|
+
width = input(undefined, /* @ts-ignore */
|
|
1595
|
+
...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
1596
|
+
/**
|
|
1597
|
+
* Explicit height override (e.g., '2rem', '48px', or number in pixels).
|
|
1598
|
+
*/
|
|
1599
|
+
height = input(undefined, /* @ts-ignore */
|
|
1600
|
+
...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
1601
|
+
/**
|
|
1602
|
+
* Custom border radius override (e.g., '6px', '50%').
|
|
1603
|
+
*/
|
|
1604
|
+
borderRadius = input(undefined, /* @ts-ignore */
|
|
1605
|
+
...(ngDevMode ? [{ debugName: "borderRadius" }] : /* istanbul ignore next */ []));
|
|
1606
|
+
/**
|
|
1607
|
+
* Number of lines to render for multi-line text placeholders.
|
|
1608
|
+
* @default 1
|
|
1609
|
+
*/
|
|
1610
|
+
count = input(1, /* @ts-ignore */
|
|
1611
|
+
...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
1612
|
+
/**
|
|
1613
|
+
* Width of the last line when `count` > 1 (e.g. '60%' for realistic paragraph tapering).
|
|
1614
|
+
* @default '60%'
|
|
1615
|
+
*/
|
|
1616
|
+
lastLineWidth = input('60%', /* @ts-ignore */
|
|
1617
|
+
...(ngDevMode ? [{ debugName: "lastLineWidth" }] : /* istanbul ignore next */ []));
|
|
1618
|
+
/**
|
|
1619
|
+
* Spacing gap between lines when `count` > 1.
|
|
1620
|
+
* @default '0.5rem'
|
|
1621
|
+
*/
|
|
1622
|
+
gap = input('0.5rem', /* @ts-ignore */
|
|
1623
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
1624
|
+
/**
|
|
1625
|
+
* Whether the skeleton is actively in a loading state.
|
|
1626
|
+
* When false, the skeleton hides and projects inner `<ng-content>`.
|
|
1627
|
+
* @default true
|
|
1628
|
+
*/
|
|
1629
|
+
loading = input(true, /* @ts-ignore */
|
|
1630
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
1631
|
+
/**
|
|
1632
|
+
* Accessible description for screen readers during loading.
|
|
1633
|
+
* @default 'Loading content...'
|
|
1634
|
+
*/
|
|
1635
|
+
ariaLabel = input('Loading content...', /* @ts-ignore */
|
|
1636
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1637
|
+
/** Whether the component represents a circular shape (circle or avatar) */
|
|
1638
|
+
isCircular = computed(() => {
|
|
1639
|
+
const v = this.variant();
|
|
1640
|
+
return v === 'circular' || v === 'avatar';
|
|
1641
|
+
}, /* @ts-ignore */
|
|
1642
|
+
...(ngDevMode ? [{ debugName: "isCircular" }] : /* istanbul ignore next */ []));
|
|
1643
|
+
/** Whether the component represents a rounded shape (rounded or button) */
|
|
1644
|
+
isRounded = computed(() => {
|
|
1645
|
+
const v = this.variant();
|
|
1646
|
+
return v === 'rounded' || v === 'button';
|
|
1647
|
+
}, /* @ts-ignore */
|
|
1648
|
+
...(ngDevMode ? [{ debugName: "isRounded" }] : /* istanbul ignore next */ []));
|
|
1649
|
+
/** Whether this is a multi-line text skeleton */
|
|
1650
|
+
isMultiLine = computed(() => {
|
|
1651
|
+
return this.variant() === 'text' && this.count() > 1;
|
|
1652
|
+
}, /* @ts-ignore */
|
|
1653
|
+
...(ngDevMode ? [{ debugName: "isMultiLine" }] : /* istanbul ignore next */ []));
|
|
1654
|
+
/** Normalized line array for multi-line rendering */
|
|
1655
|
+
lineIndices = computed(() => {
|
|
1656
|
+
const c = Math.max(1, Math.floor(this.count()));
|
|
1657
|
+
return Array.from({ length: c }, (_, i) => i);
|
|
1658
|
+
}, /* @ts-ignore */
|
|
1659
|
+
...(ngDevMode ? [{ debugName: "lineIndices" }] : /* istanbul ignore next */ []));
|
|
1660
|
+
/** Resolved CSS width string */
|
|
1661
|
+
computedWidth = computed(() => resolveCssDimension(this.width()) ?? null, /* @ts-ignore */
|
|
1662
|
+
...(ngDevMode ? [{ debugName: "computedWidth" }] : /* istanbul ignore next */ []));
|
|
1663
|
+
/** Resolved CSS height string */
|
|
1664
|
+
computedHeight = computed(() => resolveCssDimension(this.height()) ?? null, /* @ts-ignore */
|
|
1665
|
+
...(ngDevMode ? [{ debugName: "computedHeight" }] : /* istanbul ignore next */ []));
|
|
1666
|
+
/** Resolved CSS border radius string */
|
|
1667
|
+
computedRadius = computed(() => {
|
|
1668
|
+
const custom = resolveCssDimension(this.borderRadius());
|
|
1669
|
+
if (custom) {
|
|
1670
|
+
return custom;
|
|
1671
|
+
}
|
|
1672
|
+
if (this.isCircular()) {
|
|
1673
|
+
return '50%';
|
|
1674
|
+
}
|
|
1675
|
+
return null;
|
|
1676
|
+
}, /* @ts-ignore */
|
|
1677
|
+
...(ngDevMode ? [{ debugName: "computedRadius" }] : /* istanbul ignore next */ []));
|
|
1678
|
+
/** Resolved CSS gap string */
|
|
1679
|
+
computedGap = computed(() => resolveCssDimension(this.gap()) ?? '0.5rem', /* @ts-ignore */
|
|
1680
|
+
...(ngDevMode ? [{ debugName: "computedGap" }] : /* istanbul ignore next */ []));
|
|
1681
|
+
/**
|
|
1682
|
+
* Computes the width for an individual line in multi-line text mode.
|
|
1683
|
+
* @param index Line index (0-based)
|
|
1684
|
+
*/
|
|
1685
|
+
getLineWidth(index) {
|
|
1686
|
+
const total = this.count();
|
|
1687
|
+
if (index === total - 1 && total > 1) {
|
|
1688
|
+
return resolveCssDimension(this.lastLineWidth()) || '60%';
|
|
1689
|
+
}
|
|
1690
|
+
return resolveCssDimension(this.width()) || '100%';
|
|
1691
|
+
}
|
|
1692
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1693
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosSkeletonComponent, isStandalone: true, selector: "talos-skeleton", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, animation: { classPropertyName: "animation", publicName: "animation", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, borderRadius: { classPropertyName: "borderRadius", publicName: "borderRadius", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, lastLineWidth: { classPropertyName: "lastLineWidth", publicName: "lastLineWidth", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-skeleton--hidden": "!loading()", "class.talos-skeleton--text": "variant() === \"text\"", "class.talos-skeleton--circular": "isCircular()", "class.talos-skeleton--rectangular": "variant() === \"rectangular\"", "class.talos-skeleton--rounded": "isRounded()", "class.talos-skeleton--card": "variant() === \"card\"", "class.talos-skeleton--shimmer": "loading() && animation() === \"shimmer\"", "class.talos-skeleton--pulse": "loading() && animation() === \"pulse\"", "class.talos-skeleton--no-animation": "animation() === \"none\"", "class.talos-skeleton--xs": "size() === \"xs\"", "class.talos-skeleton--sm": "size() === \"sm\"", "class.talos-skeleton--md": "size() === \"md\"", "class.talos-skeleton--lg": "size() === \"lg\"", "class.talos-skeleton--multi": "isMultiLine()", "style.width": "!isMultiLine() ? computedWidth() : \"100%\"", "style.height": "!isMultiLine() ? computedHeight() : null", "style.border-radius": "!isMultiLine() ? computedRadius() : null", "style.gap": "isMultiLine() ? computedGap() : null", "attr.role": "loading() ? \"status\" : null", "attr.aria-busy": "loading() ? \"true\" : null", "attr.aria-live": "loading() ? \"polite\" : null", "attr.aria-label": "loading() ? ariaLabel() : null" }, classAttribute: "talos-skeleton-host" }, ngImport: i0, template: "@if (!loading()) {\n <ng-content></ng-content>\n} @else {\n @if (isMultiLine()) {\n @for (index of lineIndices(); track index) {\n <span\n class=\"talos-skeleton__line\"\n [style.width]=\"getLineWidth(index)\"\n [style.height]=\"computedHeight()\"\n aria-hidden=\"true\">\n </span>\n }\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n } @else if (variant() === 'card') {\n <div class=\"talos-skeleton__card-wrapper\" aria-hidden=\"true\">\n <div class=\"talos-skeleton__card-media\"></div>\n <div class=\"talos-skeleton__card-body\">\n <div class=\"talos-skeleton__card-row\">\n <span class=\"talos-skeleton__avatar-circle\"></span>\n <div class=\"talos-skeleton__card-lines\">\n <span class=\"talos-skeleton__line\" style=\"width: 65%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 40%\"></span>\n </div>\n </div>\n <div class=\"talos-skeleton__card-paragraphs\">\n <span class=\"talos-skeleton__line\" style=\"width: 100%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 88%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 55%\"></span>\n </div>\n </div>\n </div>\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n } @else {\n <span class=\"talos-skeleton__inner\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n }\n}\n", styles: [":host{display:block;box-sizing:border-box;position:relative;overflow:hidden;--talos-skeleton-bg: var(--talos-border-subtle, #e2e8f0);--talos-skeleton-shine: rgba(255, 255, 255, .85);--talos-skeleton-speed: 1.5s}:host.talos-skeleton--hidden{display:contents}:host:not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--circular):not(.talos-skeleton--hidden){background-color:var(--talos-skeleton-bg);border-radius:var(--talos-radius-sm, .25rem);min-height:1rem;width:100%}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--xs{height:.75rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--sm{height:.875rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--md{height:1.125rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--lg{height:1.5rem}:host.talos-skeleton--circular{display:inline-block;background-color:var(--talos-skeleton-bg);border-radius:50%!important;aspect-ratio:1/1!important;flex-shrink:0;min-height:unset}:host.talos-skeleton--circular.talos-skeleton--xs{width:1.5rem;height:1.5rem}:host.talos-skeleton--circular.talos-skeleton--sm{width:2.25rem;height:2.25rem}:host.talos-skeleton--circular.talos-skeleton--md{width:3.5rem;height:3.5rem}:host.talos-skeleton--circular.talos-skeleton--lg{width:5rem;height:5rem}:host.talos-skeleton--text{border-radius:var(--talos-radius-sm, .25rem)}:host.talos-skeleton--rectangular{border-radius:var(--talos-radius-xs, .125rem);min-height:4rem}:host.talos-skeleton--rounded{border-radius:var(--talos-radius-md, .375rem);min-height:2.25rem}:host.talos-skeleton--multi{display:flex;flex-direction:column;align-items:flex-start;width:100%}:host.talos-skeleton--multi .talos-skeleton__line{display:block;background-color:var(--talos-skeleton-bg);border-radius:var(--talos-radius-sm, .25rem);height:1rem;position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--multi.talos-skeleton--xs .talos-skeleton__line{height:.75rem}:host.talos-skeleton--multi.talos-skeleton--sm .talos-skeleton__line{height:.875rem}:host.talos-skeleton--multi.talos-skeleton--md .talos-skeleton__line{height:1rem}:host.talos-skeleton--multi.talos-skeleton--lg .talos-skeleton__line{height:1.25rem}:host.talos-skeleton--card{display:block;width:100%;max-width:380px;background:var(--talos-card-bg, #ffffff);border:1px solid var(--talos-border-subtle, #e2e8f0);border-radius:var(--talos-radius-lg, .5rem);padding:1.25rem;box-shadow:var(--talos-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .05));box-sizing:border-box}:host.talos-skeleton--card .talos-skeleton__card-wrapper{display:flex;flex-direction:column;gap:1rem;width:100%;box-sizing:border-box}:host.talos-skeleton--card .talos-skeleton__card-media{width:100%;height:9.5rem;border-radius:var(--talos-radius-md, .375rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden}:host.talos-skeleton--card .talos-skeleton__card-body{display:flex;flex-direction:column;gap:.875rem}:host.talos-skeleton--card .talos-skeleton__card-row{display:flex;align-items:center;gap:.75rem}:host.talos-skeleton--card .talos-skeleton__avatar-circle{width:2.5rem;height:2.5rem;border-radius:50%;background-color:var(--talos-skeleton-bg);flex-shrink:0;position:relative;overflow:hidden}:host.talos-skeleton--card .talos-skeleton__card-lines{display:flex;flex-direction:column;align-items:flex-start;gap:.375rem;flex:1}:host.talos-skeleton--card .talos-skeleton__card-lines .talos-skeleton__line{height:.875rem;border-radius:var(--talos-radius-xs, .125rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--card .talos-skeleton__card-paragraphs{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}:host.talos-skeleton--card .talos-skeleton__card-paragraphs .talos-skeleton__line{height:.8125rem;border-radius:var(--talos-radius-xs, .125rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--shimmer:not(.talos-skeleton--multi):not(.talos-skeleton--card){background:linear-gradient(90deg,var(--talos-skeleton-bg) 0%,var(--talos-skeleton-shine) 50%,var(--talos-skeleton-bg) 100%);background-size:200% 100%;animation:talos-skeleton-shimmer var(--talos-skeleton-speed) infinite linear}:host.talos-skeleton--shimmer .talos-skeleton__line,:host.talos-skeleton--shimmer .talos-skeleton__card-media,:host.talos-skeleton--shimmer .talos-skeleton__avatar-circle{background:linear-gradient(90deg,var(--talos-skeleton-bg) 0%,var(--talos-skeleton-shine) 50%,var(--talos-skeleton-bg) 100%);background-size:200% 100%;animation:talos-skeleton-shimmer var(--talos-skeleton-speed) infinite linear}:host.talos-skeleton--pulse:not(.talos-skeleton--multi):not(.talos-skeleton--card){animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite}:host.talos-skeleton--pulse .talos-skeleton__line,:host.talos-skeleton--pulse .talos-skeleton__card-media,:host.talos-skeleton--pulse .talos-skeleton__avatar-circle{animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite}:host.talos-skeleton--no-animation{animation:none!important}:host.talos-skeleton--no-animation *{animation:none!important}:host-context(.talos-skeleton-attached).talos-skeleton-active,.talos-skeleton-attached.talos-skeleton-active{position:relative!important;pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important;cursor:default!important;color:transparent!important;background-color:var(--talos-bg-subtle, #f1f5f9)!important;border-color:transparent!important;box-shadow:none!important;overflow:hidden!important}:host-context(.talos-skeleton-attached).talos-skeleton-active>*,.talos-skeleton-attached.talos-skeleton-active>*{visibility:hidden!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--circular,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--circular{border-radius:50%!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--rounded,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--rounded{border-radius:var(--talos-radius-md, .375rem)!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--rectangular,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--rectangular{border-radius:var(--talos-radius-xs, .125rem)!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--shimmer,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--shimmer{background:linear-gradient(90deg,var(--talos-bg-subtle, #f1f5f9) 0%,rgba(255,255,255,.6) 50%,var(--talos-bg-subtle, #f1f5f9) 100%)!important;background-size:200% 100%!important;animation:talos-skeleton-shimmer 1.5s infinite linear!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--pulse,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--pulse{animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--no-animation,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--no-animation{animation:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes talos-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes talos-skeleton-pulse{0%{opacity:1}50%{opacity:.45}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host,.talos-skeleton__line,.talos-skeleton__card-media,.talos-skeleton__avatar-circle,.talos-skeleton-attached.talos-skeleton-active{animation:none!important;opacity:.85!important}}\n"] });
|
|
1694
|
+
}
|
|
1695
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonComponent, decorators: [{
|
|
1696
|
+
type: Component,
|
|
1697
|
+
args: [{ selector: 'talos-skeleton', host: {
|
|
1698
|
+
'class': 'talos-skeleton-host',
|
|
1699
|
+
'[class.talos-skeleton--hidden]': '!loading()',
|
|
1700
|
+
'[class.talos-skeleton--text]': 'variant() === "text"',
|
|
1701
|
+
'[class.talos-skeleton--circular]': 'isCircular()',
|
|
1702
|
+
'[class.talos-skeleton--rectangular]': 'variant() === "rectangular"',
|
|
1703
|
+
'[class.talos-skeleton--rounded]': 'isRounded()',
|
|
1704
|
+
'[class.talos-skeleton--card]': 'variant() === "card"',
|
|
1705
|
+
'[class.talos-skeleton--shimmer]': 'loading() && animation() === "shimmer"',
|
|
1706
|
+
'[class.talos-skeleton--pulse]': 'loading() && animation() === "pulse"',
|
|
1707
|
+
'[class.talos-skeleton--no-animation]': 'animation() === "none"',
|
|
1708
|
+
'[class.talos-skeleton--xs]': 'size() === "xs"',
|
|
1709
|
+
'[class.talos-skeleton--sm]': 'size() === "sm"',
|
|
1710
|
+
'[class.talos-skeleton--md]': 'size() === "md"',
|
|
1711
|
+
'[class.talos-skeleton--lg]': 'size() === "lg"',
|
|
1712
|
+
'[class.talos-skeleton--multi]': 'isMultiLine()',
|
|
1713
|
+
'[style.width]': '!isMultiLine() ? computedWidth() : "100%"',
|
|
1714
|
+
'[style.height]': '!isMultiLine() ? computedHeight() : null',
|
|
1715
|
+
'[style.border-radius]': '!isMultiLine() ? computedRadius() : null',
|
|
1716
|
+
'[style.gap]': 'isMultiLine() ? computedGap() : null',
|
|
1717
|
+
'[attr.role]': 'loading() ? "status" : null',
|
|
1718
|
+
'[attr.aria-busy]': 'loading() ? "true" : null',
|
|
1719
|
+
'[attr.aria-live]': 'loading() ? "polite" : null',
|
|
1720
|
+
'[attr.aria-label]': 'loading() ? ariaLabel() : null'
|
|
1721
|
+
}, template: "@if (!loading()) {\n <ng-content></ng-content>\n} @else {\n @if (isMultiLine()) {\n @for (index of lineIndices(); track index) {\n <span\n class=\"talos-skeleton__line\"\n [style.width]=\"getLineWidth(index)\"\n [style.height]=\"computedHeight()\"\n aria-hidden=\"true\">\n </span>\n }\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n } @else if (variant() === 'card') {\n <div class=\"talos-skeleton__card-wrapper\" aria-hidden=\"true\">\n <div class=\"talos-skeleton__card-media\"></div>\n <div class=\"talos-skeleton__card-body\">\n <div class=\"talos-skeleton__card-row\">\n <span class=\"talos-skeleton__avatar-circle\"></span>\n <div class=\"talos-skeleton__card-lines\">\n <span class=\"talos-skeleton__line\" style=\"width: 65%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 40%\"></span>\n </div>\n </div>\n <div class=\"talos-skeleton__card-paragraphs\">\n <span class=\"talos-skeleton__line\" style=\"width: 100%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 88%\"></span>\n <span class=\"talos-skeleton__line\" style=\"width: 55%\"></span>\n </div>\n </div>\n </div>\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n } @else {\n <span class=\"talos-skeleton__inner\" aria-hidden=\"true\"></span>\n <span class=\"sr-only\">{{ ariaLabel() }}</span>\n }\n}\n", styles: [":host{display:block;box-sizing:border-box;position:relative;overflow:hidden;--talos-skeleton-bg: var(--talos-border-subtle, #e2e8f0);--talos-skeleton-shine: rgba(255, 255, 255, .85);--talos-skeleton-speed: 1.5s}:host.talos-skeleton--hidden{display:contents}:host:not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--circular):not(.talos-skeleton--hidden){background-color:var(--talos-skeleton-bg);border-radius:var(--talos-radius-sm, .25rem);min-height:1rem;width:100%}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--xs{height:.75rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--sm{height:.875rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--md{height:1.125rem}:host:not(.talos-skeleton--circular):not(.talos-skeleton--multi):not(.talos-skeleton--card):not(.talos-skeleton--hidden).talos-skeleton--lg{height:1.5rem}:host.talos-skeleton--circular{display:inline-block;background-color:var(--talos-skeleton-bg);border-radius:50%!important;aspect-ratio:1/1!important;flex-shrink:0;min-height:unset}:host.talos-skeleton--circular.talos-skeleton--xs{width:1.5rem;height:1.5rem}:host.talos-skeleton--circular.talos-skeleton--sm{width:2.25rem;height:2.25rem}:host.talos-skeleton--circular.talos-skeleton--md{width:3.5rem;height:3.5rem}:host.talos-skeleton--circular.talos-skeleton--lg{width:5rem;height:5rem}:host.talos-skeleton--text{border-radius:var(--talos-radius-sm, .25rem)}:host.talos-skeleton--rectangular{border-radius:var(--talos-radius-xs, .125rem);min-height:4rem}:host.talos-skeleton--rounded{border-radius:var(--talos-radius-md, .375rem);min-height:2.25rem}:host.talos-skeleton--multi{display:flex;flex-direction:column;align-items:flex-start;width:100%}:host.talos-skeleton--multi .talos-skeleton__line{display:block;background-color:var(--talos-skeleton-bg);border-radius:var(--talos-radius-sm, .25rem);height:1rem;position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--multi.talos-skeleton--xs .talos-skeleton__line{height:.75rem}:host.talos-skeleton--multi.talos-skeleton--sm .talos-skeleton__line{height:.875rem}:host.talos-skeleton--multi.talos-skeleton--md .talos-skeleton__line{height:1rem}:host.talos-skeleton--multi.talos-skeleton--lg .talos-skeleton__line{height:1.25rem}:host.talos-skeleton--card{display:block;width:100%;max-width:380px;background:var(--talos-card-bg, #ffffff);border:1px solid var(--talos-border-subtle, #e2e8f0);border-radius:var(--talos-radius-lg, .5rem);padding:1.25rem;box-shadow:var(--talos-shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, .05));box-sizing:border-box}:host.talos-skeleton--card .talos-skeleton__card-wrapper{display:flex;flex-direction:column;gap:1rem;width:100%;box-sizing:border-box}:host.talos-skeleton--card .talos-skeleton__card-media{width:100%;height:9.5rem;border-radius:var(--talos-radius-md, .375rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden}:host.talos-skeleton--card .talos-skeleton__card-body{display:flex;flex-direction:column;gap:.875rem}:host.talos-skeleton--card .talos-skeleton__card-row{display:flex;align-items:center;gap:.75rem}:host.talos-skeleton--card .talos-skeleton__avatar-circle{width:2.5rem;height:2.5rem;border-radius:50%;background-color:var(--talos-skeleton-bg);flex-shrink:0;position:relative;overflow:hidden}:host.talos-skeleton--card .talos-skeleton__card-lines{display:flex;flex-direction:column;align-items:flex-start;gap:.375rem;flex:1}:host.talos-skeleton--card .talos-skeleton__card-lines .talos-skeleton__line{height:.875rem;border-radius:var(--talos-radius-xs, .125rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--card .talos-skeleton__card-paragraphs{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem}:host.talos-skeleton--card .talos-skeleton__card-paragraphs .talos-skeleton__line{height:.8125rem;border-radius:var(--talos-radius-xs, .125rem);background-color:var(--talos-skeleton-bg);position:relative;overflow:hidden;align-self:flex-start}:host.talos-skeleton--shimmer:not(.talos-skeleton--multi):not(.talos-skeleton--card){background:linear-gradient(90deg,var(--talos-skeleton-bg) 0%,var(--talos-skeleton-shine) 50%,var(--talos-skeleton-bg) 100%);background-size:200% 100%;animation:talos-skeleton-shimmer var(--talos-skeleton-speed) infinite linear}:host.talos-skeleton--shimmer .talos-skeleton__line,:host.talos-skeleton--shimmer .talos-skeleton__card-media,:host.talos-skeleton--shimmer .talos-skeleton__avatar-circle{background:linear-gradient(90deg,var(--talos-skeleton-bg) 0%,var(--talos-skeleton-shine) 50%,var(--talos-skeleton-bg) 100%);background-size:200% 100%;animation:talos-skeleton-shimmer var(--talos-skeleton-speed) infinite linear}:host.talos-skeleton--pulse:not(.talos-skeleton--multi):not(.talos-skeleton--card){animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite}:host.talos-skeleton--pulse .talos-skeleton__line,:host.talos-skeleton--pulse .talos-skeleton__card-media,:host.talos-skeleton--pulse .talos-skeleton__avatar-circle{animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite}:host.talos-skeleton--no-animation{animation:none!important}:host.talos-skeleton--no-animation *{animation:none!important}:host-context(.talos-skeleton-attached).talos-skeleton-active,.talos-skeleton-attached.talos-skeleton-active{position:relative!important;pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important;cursor:default!important;color:transparent!important;background-color:var(--talos-bg-subtle, #f1f5f9)!important;border-color:transparent!important;box-shadow:none!important;overflow:hidden!important}:host-context(.talos-skeleton-attached).talos-skeleton-active>*,.talos-skeleton-attached.talos-skeleton-active>*{visibility:hidden!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--circular,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--circular{border-radius:50%!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--rounded,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--rounded{border-radius:var(--talos-radius-md, .375rem)!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--rectangular,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--rectangular{border-radius:var(--talos-radius-xs, .125rem)!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--shimmer,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--shimmer{background:linear-gradient(90deg,var(--talos-bg-subtle, #f1f5f9) 0%,rgba(255,255,255,.6) 50%,var(--talos-bg-subtle, #f1f5f9) 100%)!important;background-size:200% 100%!important;animation:talos-skeleton-shimmer 1.5s infinite linear!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--pulse,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--pulse{animation:talos-skeleton-pulse 1.8s ease-in-out .5s infinite!important}:host-context(.talos-skeleton-attached).talos-skeleton-active.talos-skeleton--no-animation,.talos-skeleton-attached.talos-skeleton-active.talos-skeleton--no-animation{animation:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes talos-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes talos-skeleton-pulse{0%{opacity:1}50%{opacity:.45}to{opacity:1}}@media(prefers-reduced-motion:reduce){:host,.talos-skeleton__line,.talos-skeleton__card-media,.talos-skeleton__avatar-circle,.talos-skeleton-attached.talos-skeleton-active{animation:none!important;opacity:.85!important}}\n"] }]
|
|
1722
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], animation: [{ type: i0.Input, args: [{ isSignal: true, alias: "animation", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], borderRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderRadius", required: false }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], lastLineWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "lastLineWidth", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
1723
|
+
|
|
1724
|
+
const SKELETON_DECLARATIONS = [
|
|
1725
|
+
TalosSkeletonComponent,
|
|
1726
|
+
TalosSkeletonDirective
|
|
1727
|
+
];
|
|
1728
|
+
class TalosSkeletonModule {
|
|
1729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1730
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonModule, imports: [TalosSkeletonComponent,
|
|
1731
|
+
TalosSkeletonDirective], exports: [TalosSkeletonComponent,
|
|
1732
|
+
TalosSkeletonDirective] });
|
|
1733
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonModule });
|
|
1734
|
+
}
|
|
1735
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSkeletonModule, decorators: [{
|
|
1736
|
+
type: NgModule,
|
|
1737
|
+
args: [{
|
|
1738
|
+
imports: [...SKELETON_DECLARATIONS],
|
|
1739
|
+
exports: [...SKELETON_DECLARATIONS]
|
|
1740
|
+
}]
|
|
1741
|
+
}] });
|
|
1742
|
+
|
|
1743
|
+
class TalosSnackbarComponent {
|
|
1744
|
+
/** Snackbar instance data */
|
|
1745
|
+
instance = input.required(/* @ts-ignore */
|
|
1746
|
+
...(ngDevMode ? [{ debugName: "instance" }] : /* istanbul ignore next */ []));
|
|
1747
|
+
/** Event emitted when snackbar requests dismissal */
|
|
1748
|
+
dismiss = output();
|
|
1749
|
+
/** Event emitted when snackbar action button is clicked */
|
|
1750
|
+
action = output();
|
|
1751
|
+
isDismissing = signal(false, /* @ts-ignore */
|
|
1752
|
+
...(ngDevMode ? [{ debugName: "isDismissing" }] : /* istanbul ignore next */ []));
|
|
1753
|
+
progressPercent = signal(100, /* @ts-ignore */
|
|
1754
|
+
...(ngDevMode ? [{ debugName: "progressPercent" }] : /* istanbul ignore next */ []));
|
|
1755
|
+
Infinity = Infinity;
|
|
1756
|
+
timerId = null;
|
|
1757
|
+
remainingMs = 0;
|
|
1758
|
+
lastTickMs = 0;
|
|
1759
|
+
isTopPosition = computed(() => {
|
|
1760
|
+
const pos = this.instance().position;
|
|
1761
|
+
return pos ? pos.startsWith('top') : false;
|
|
1762
|
+
}, /* @ts-ignore */
|
|
1763
|
+
...(ngDevMode ? [{ debugName: "isTopPosition" }] : /* istanbul ignore next */ []));
|
|
1764
|
+
isTemplateMessage = computed(() => {
|
|
1765
|
+
return this.instance().message instanceof TemplateRef;
|
|
1766
|
+
}, /* @ts-ignore */
|
|
1767
|
+
...(ngDevMode ? [{ debugName: "isTemplateMessage" }] : /* istanbul ignore next */ []));
|
|
1768
|
+
templateMessage = computed(() => {
|
|
1769
|
+
return this.instance().message;
|
|
1770
|
+
}, /* @ts-ignore */
|
|
1771
|
+
...(ngDevMode ? [{ debugName: "templateMessage" }] : /* istanbul ignore next */ []));
|
|
1772
|
+
customIconComponent = computed(() => {
|
|
1773
|
+
const icon = this.instance().icon;
|
|
1774
|
+
return typeof icon === 'function' ? icon : null;
|
|
1775
|
+
}, /* @ts-ignore */
|
|
1776
|
+
...(ngDevMode ? [{ debugName: "customIconComponent" }] : /* istanbul ignore next */ []));
|
|
1777
|
+
ariaRole = computed(() => {
|
|
1778
|
+
const variant = this.instance().variant;
|
|
1779
|
+
return variant === 'error' || variant === 'warning' ? 'alert' : 'status';
|
|
1780
|
+
}, /* @ts-ignore */
|
|
1781
|
+
...(ngDevMode ? [{ debugName: "ariaRole" }] : /* istanbul ignore next */ []));
|
|
1782
|
+
ariaLive = computed(() => {
|
|
1783
|
+
const variant = this.instance().variant;
|
|
1784
|
+
return variant === 'error' || variant === 'warning' ? 'assertive' : 'polite';
|
|
1785
|
+
}, /* @ts-ignore */
|
|
1786
|
+
...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
1787
|
+
ngOnInit() {
|
|
1788
|
+
const duration = this.instance().duration;
|
|
1789
|
+
if (duration > 0 && duration !== Infinity) {
|
|
1790
|
+
this.remainingMs = duration;
|
|
1791
|
+
this.startTimer();
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
ngOnDestroy() {
|
|
1795
|
+
this.stopTimer();
|
|
1796
|
+
}
|
|
1797
|
+
startTimer() {
|
|
1798
|
+
this.stopTimer();
|
|
1799
|
+
const totalDuration = this.instance().duration;
|
|
1800
|
+
this.lastTickMs = Date.now();
|
|
1801
|
+
this.timerId = setInterval(() => {
|
|
1802
|
+
if (this.instance().isPaused)
|
|
1803
|
+
return;
|
|
1804
|
+
const now = Date.now();
|
|
1805
|
+
const delta = now - this.lastTickMs;
|
|
1806
|
+
this.lastTickMs = now;
|
|
1807
|
+
this.remainingMs -= delta;
|
|
1808
|
+
if (this.remainingMs <= 0) {
|
|
1809
|
+
this.progressPercent.set(0);
|
|
1810
|
+
this.stopTimer();
|
|
1811
|
+
this.onCloseClick();
|
|
1812
|
+
}
|
|
1813
|
+
else {
|
|
1814
|
+
const pct = Math.max(0, (this.remainingMs / totalDuration) * 100);
|
|
1815
|
+
this.progressPercent.set(pct);
|
|
1816
|
+
}
|
|
1817
|
+
}, 50);
|
|
1818
|
+
}
|
|
1819
|
+
stopTimer() {
|
|
1820
|
+
if (this.timerId) {
|
|
1821
|
+
clearInterval(this.timerId);
|
|
1822
|
+
this.timerId = null;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
onMouseEnter() {
|
|
1826
|
+
if (this.instance().pauseOnHover) {
|
|
1827
|
+
this.instance().isPaused = true;
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
onMouseLeave() {
|
|
1831
|
+
if (this.instance().pauseOnHover) {
|
|
1832
|
+
this.instance().isPaused = false;
|
|
1833
|
+
this.lastTickMs = Date.now();
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
onActionClick() {
|
|
1837
|
+
if (this.instance().onAction) {
|
|
1838
|
+
this.instance().onAction();
|
|
1839
|
+
}
|
|
1840
|
+
this.action.emit(this.instance().id);
|
|
1841
|
+
this.onCloseClick();
|
|
1842
|
+
}
|
|
1843
|
+
onCloseClick() {
|
|
1844
|
+
if (this.isDismissing())
|
|
1845
|
+
return;
|
|
1846
|
+
this.isDismissing.set(true);
|
|
1847
|
+
if (this.instance().onDismiss) {
|
|
1848
|
+
this.instance().onDismiss();
|
|
1849
|
+
}
|
|
1850
|
+
setTimeout(() => {
|
|
1851
|
+
this.dismiss.emit(this.instance().id);
|
|
1852
|
+
}, 200);
|
|
1853
|
+
}
|
|
1854
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1855
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosSnackbarComponent, isStandalone: true, selector: "talos-snackbar", inputs: { instance: { classPropertyName: "instance", publicName: "instance", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { dismiss: "dismiss", action: "action" }, ngImport: i0, template: "<div class=\"talos-snackbar\" [class.variant-default]=\"instance().variant === 'default'\"\n [class.variant-info]=\"instance().variant === 'info'\" [class.variant-success]=\"instance().variant === 'success'\"\n [class.variant-warning]=\"instance().variant === 'warning'\" [class.variant-error]=\"instance().variant === 'error'\"\n [class.pos-top]=\"isTopPosition()\" [class.pos-bottom]=\"!isTopPosition()\" [class.is-dismissing]=\"isDismissing()\"\n [class]=\"instance().customClass || ''\" [attr.role]=\"ariaRole()\" [attr.aria-live]=\"ariaLive()\"\n (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\n @if (instance().icon !== false) {\n <div class=\"talos-snackbar-icon\">\n @if (instance().icon && instance().icon !== true) {\n <ng-container *ngComponentOutlet=\"customIconComponent()\"></ng-container>\n } @else {\n @switch (instance().variant) {\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"20\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"20\"></svg>\n }\n @case ('error') {\n <svg lucideCircleAlert [size]=\"20\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"20\"></svg>\n }\n }\n }\n </div>\n }\n\n <div class=\"talos-snackbar-content\">\n @if (instance().title) {\n <div class=\"talos-snackbar-title\">{{ instance().title }}</div>\n }\n\n <div class=\"talos-snackbar-message\">\n @if (isTemplateMessage()) {\n <ng-container\n *ngTemplateOutlet=\"templateMessage(); context: { $implicit: instance().data, instance: instance() }\"></ng-container>\n } @else {\n {{ instance().message }}\n }\n </div>\n </div>\n\n <div class=\"talos-snackbar-actions\">\n @if (instance().actionLabel) {\n <button type=\"button\" class=\"talos-snackbar-action-btn\" (click)=\"onActionClick()\">\n {{ instance().actionLabel }}\n </button>\n }\n\n @if (instance().dismissible) {\n <button type=\"button\" class=\"talos-snackbar-close-btn\" aria-label=\"Close notification\" (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </div>\n\n @if (instance().showProgressBar && instance().duration > 0 && instance().duration !== Infinity) {\n <div class=\"talos-snackbar-progress\" [class.variant-success]=\"instance().variant === 'success'\"\n [class.variant-warning]=\"instance().variant === 'warning'\" [class.variant-error]=\"instance().variant === 'error'\"\n [style.width.%]=\"progressPercent()\"></div>\n }\n</div>", styles: [":host{display:block;width:100%;max-width:440px;pointer-events:auto}.talos-snackbar{position:relative;display:flex;align-items:center;gap:.875rem;padding:.875rem 1rem;background-color:var(--talos-snackbar-bg, var(--talos-card-bg, #ffffff));color:var(--talos-snackbar-text, var(--talos-text-color, #0f172a));border:1px solid var(--talos-snackbar-border, var(--talos-border-color, #e2e8f0));border-radius:var(--talos-snackbar-border-radius, var(--talos-border-radius, .5rem));box-shadow:var(--talos-shadow-dropdown, 0 10px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -6px rgba(0, 0, 0, .04));overflow:hidden;box-sizing:border-box}.talos-snackbar.pos-top{animation:talos-snackbar-in-top .25s cubic-bezier(.16,1,.3,1) forwards}.talos-snackbar.pos-top.is-dismissing{animation:talos-snackbar-out-top .2s cubic-bezier(.4,0,1,1) forwards}.talos-snackbar.pos-bottom{animation:talos-snackbar-in-bottom .25s cubic-bezier(.16,1,.3,1) forwards}.talos-snackbar.pos-bottom.is-dismissing{animation:talos-snackbar-out-bottom .2s cubic-bezier(.4,0,1,1) forwards}.talos-snackbar .talos-snackbar-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:2.25rem;height:2.25rem;border-radius:var(--talos-border-radius, .5rem);transition:background-color .15s ease,color .15s ease}.talos-snackbar.variant-default .talos-snackbar-icon,.talos-snackbar.variant-info .talos-snackbar-icon{background-color:var(--talos-info-subtle-bg, var(--talos-primary-light, #eff6ff));color:var(--talos-info-text, var(--talos-primary-color, #2563eb))}.talos-snackbar.variant-success .talos-snackbar-icon{background-color:var(--talos-success-subtle-bg, rgba(22, 163, 74, .12));color:var(--talos-success-text, var(--talos-btn-success-bg, #16a34a))}.talos-snackbar.variant-warning .talos-snackbar-icon{background-color:var(--talos-warning-subtle-bg, rgba(217, 119, 6, .12));color:var(--talos-warning-text, var(--talos-warning-color, #d97706))}.talos-snackbar.variant-error .talos-snackbar-icon{background-color:var(--talos-danger-subtle-bg, rgba(239, 68, 68, .12));color:var(--talos-danger-text, var(--talos-error-color, #ef4444))}.talos-snackbar .talos-snackbar-content{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:.125rem}.talos-snackbar .talos-snackbar-content .talos-snackbar-title{font-size:var(--talos-control-font-size, .8125rem);font-weight:600;line-height:1.25rem;color:var(--talos-text-primary, var(--talos-text-color, #0f172a))}.talos-snackbar .talos-snackbar-content .talos-snackbar-message{font-size:.8125rem;line-height:1.25rem;color:var(--talos-text-muted, #64748b);word-break:break-word}.talos-snackbar .talos-snackbar-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0;margin-left:auto}.talos-snackbar .talos-snackbar-action-btn{border:none;background:transparent;color:var(--talos-primary-text, var(--talos-primary-color, #2563eb));font-size:.8125rem;font-weight:600;padding:.375rem .625rem;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:background-color .15s ease,color .15s ease}.talos-snackbar .talos-snackbar-action-btn:hover{background-color:var(--talos-primary-subtle-bg, #eff6ff);color:var(--talos-primary-hover, #1d4ed8)}.talos-snackbar .talos-snackbar-action-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}.talos-snackbar .talos-snackbar-close-btn{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--talos-text-muted, #94a3b8);padding:.375rem;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:color .15s ease,background-color .15s ease}.talos-snackbar .talos-snackbar-close-btn:hover{color:var(--talos-text-primary, #0f172a);background-color:var(--talos-bg-subtle, #f8fafc)}.talos-snackbar .talos-snackbar-close-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}.talos-snackbar .talos-snackbar-progress{position:absolute;bottom:0;left:0;height:3px;background-color:var(--talos-primary-solid-bg, var(--talos-primary-color, #2563eb));transition:width .1s linear;border-bottom-left-radius:var(--talos-border-radius, .5rem)}.talos-snackbar .talos-snackbar-progress.variant-success{background-color:var(--talos-success-solid-bg, #16a34a)}.talos-snackbar .talos-snackbar-progress.variant-warning{background-color:var(--talos-warning-solid-bg, #d97706)}.talos-snackbar .talos-snackbar-progress.variant-error{background-color:var(--talos-danger-solid-bg, #ef4444)}@keyframes talos-snackbar-in-top{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes talos-snackbar-out-top{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-16px) scale(.95)}}@keyframes talos-snackbar-in-bottom{0%{opacity:0;transform:translateY(16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes talos-snackbar-out-bottom{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(16px) scale(.95)}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: LucideInfo, selector: "svg[lucideInfo]" }, { kind: "component", type: LucideCheckCircle2, selector: "svg[lucideCircleCheck], svg[lucideCheckCircle2]" }, { kind: "component", type: LucideAlertTriangle, selector: "svg[lucideTriangleAlert], svg[lucideAlertTriangle]" }, { kind: "component", type: LucideCircleAlert, selector: "svg[lucideCircleAlert], svg[lucideAlertCircle]" }, { kind: "component", type: LucideX, selector: "svg[lucideX]" }] });
|
|
1856
|
+
}
|
|
1857
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarComponent, decorators: [{
|
|
1858
|
+
type: Component,
|
|
1859
|
+
args: [{ selector: 'talos-snackbar', imports: [
|
|
1860
|
+
NgComponentOutlet,
|
|
1861
|
+
NgTemplateOutlet,
|
|
1862
|
+
LucideInfo,
|
|
1863
|
+
LucideCheckCircle2,
|
|
1864
|
+
LucideAlertTriangle,
|
|
1865
|
+
LucideCircleAlert,
|
|
1866
|
+
LucideX
|
|
1867
|
+
], template: "<div class=\"talos-snackbar\" [class.variant-default]=\"instance().variant === 'default'\"\n [class.variant-info]=\"instance().variant === 'info'\" [class.variant-success]=\"instance().variant === 'success'\"\n [class.variant-warning]=\"instance().variant === 'warning'\" [class.variant-error]=\"instance().variant === 'error'\"\n [class.pos-top]=\"isTopPosition()\" [class.pos-bottom]=\"!isTopPosition()\" [class.is-dismissing]=\"isDismissing()\"\n [class]=\"instance().customClass || ''\" [attr.role]=\"ariaRole()\" [attr.aria-live]=\"ariaLive()\"\n (mouseenter)=\"onMouseEnter()\" (mouseleave)=\"onMouseLeave()\">\n @if (instance().icon !== false) {\n <div class=\"talos-snackbar-icon\">\n @if (instance().icon && instance().icon !== true) {\n <ng-container *ngComponentOutlet=\"customIconComponent()\"></ng-container>\n } @else {\n @switch (instance().variant) {\n @case ('success') {\n <svg lucideCheckCircle2 [size]=\"20\"></svg>\n }\n @case ('warning') {\n <svg lucideAlertTriangle [size]=\"20\"></svg>\n }\n @case ('error') {\n <svg lucideCircleAlert [size]=\"20\"></svg>\n }\n @default {\n <svg lucideInfo [size]=\"20\"></svg>\n }\n }\n }\n </div>\n }\n\n <div class=\"talos-snackbar-content\">\n @if (instance().title) {\n <div class=\"talos-snackbar-title\">{{ instance().title }}</div>\n }\n\n <div class=\"talos-snackbar-message\">\n @if (isTemplateMessage()) {\n <ng-container\n *ngTemplateOutlet=\"templateMessage(); context: { $implicit: instance().data, instance: instance() }\"></ng-container>\n } @else {\n {{ instance().message }}\n }\n </div>\n </div>\n\n <div class=\"talos-snackbar-actions\">\n @if (instance().actionLabel) {\n <button type=\"button\" class=\"talos-snackbar-action-btn\" (click)=\"onActionClick()\">\n {{ instance().actionLabel }}\n </button>\n }\n\n @if (instance().dismissible) {\n <button type=\"button\" class=\"talos-snackbar-close-btn\" aria-label=\"Close notification\" (click)=\"onCloseClick()\">\n <svg lucideX [size]=\"16\"></svg>\n </button>\n }\n </div>\n\n @if (instance().showProgressBar && instance().duration > 0 && instance().duration !== Infinity) {\n <div class=\"talos-snackbar-progress\" [class.variant-success]=\"instance().variant === 'success'\"\n [class.variant-warning]=\"instance().variant === 'warning'\" [class.variant-error]=\"instance().variant === 'error'\"\n [style.width.%]=\"progressPercent()\"></div>\n }\n</div>", styles: [":host{display:block;width:100%;max-width:440px;pointer-events:auto}.talos-snackbar{position:relative;display:flex;align-items:center;gap:.875rem;padding:.875rem 1rem;background-color:var(--talos-snackbar-bg, var(--talos-card-bg, #ffffff));color:var(--talos-snackbar-text, var(--talos-text-color, #0f172a));border:1px solid var(--talos-snackbar-border, var(--talos-border-color, #e2e8f0));border-radius:var(--talos-snackbar-border-radius, var(--talos-border-radius, .5rem));box-shadow:var(--talos-shadow-dropdown, 0 10px 25px -5px rgba(0, 0, 0, .08), 0 8px 10px -6px rgba(0, 0, 0, .04));overflow:hidden;box-sizing:border-box}.talos-snackbar.pos-top{animation:talos-snackbar-in-top .25s cubic-bezier(.16,1,.3,1) forwards}.talos-snackbar.pos-top.is-dismissing{animation:talos-snackbar-out-top .2s cubic-bezier(.4,0,1,1) forwards}.talos-snackbar.pos-bottom{animation:talos-snackbar-in-bottom .25s cubic-bezier(.16,1,.3,1) forwards}.talos-snackbar.pos-bottom.is-dismissing{animation:talos-snackbar-out-bottom .2s cubic-bezier(.4,0,1,1) forwards}.talos-snackbar .talos-snackbar-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:2.25rem;height:2.25rem;border-radius:var(--talos-border-radius, .5rem);transition:background-color .15s ease,color .15s ease}.talos-snackbar.variant-default .talos-snackbar-icon,.talos-snackbar.variant-info .talos-snackbar-icon{background-color:var(--talos-info-subtle-bg, var(--talos-primary-light, #eff6ff));color:var(--talos-info-text, var(--talos-primary-color, #2563eb))}.talos-snackbar.variant-success .talos-snackbar-icon{background-color:var(--talos-success-subtle-bg, rgba(22, 163, 74, .12));color:var(--talos-success-text, var(--talos-btn-success-bg, #16a34a))}.talos-snackbar.variant-warning .talos-snackbar-icon{background-color:var(--talos-warning-subtle-bg, rgba(217, 119, 6, .12));color:var(--talos-warning-text, var(--talos-warning-color, #d97706))}.talos-snackbar.variant-error .talos-snackbar-icon{background-color:var(--talos-danger-subtle-bg, rgba(239, 68, 68, .12));color:var(--talos-danger-text, var(--talos-error-color, #ef4444))}.talos-snackbar .talos-snackbar-content{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:.125rem}.talos-snackbar .talos-snackbar-content .talos-snackbar-title{font-size:var(--talos-control-font-size, .8125rem);font-weight:600;line-height:1.25rem;color:var(--talos-text-primary, var(--talos-text-color, #0f172a))}.talos-snackbar .talos-snackbar-content .talos-snackbar-message{font-size:.8125rem;line-height:1.25rem;color:var(--talos-text-muted, #64748b);word-break:break-word}.talos-snackbar .talos-snackbar-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0;margin-left:auto}.talos-snackbar .talos-snackbar-action-btn{border:none;background:transparent;color:var(--talos-primary-text, var(--talos-primary-color, #2563eb));font-size:.8125rem;font-weight:600;padding:.375rem .625rem;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:background-color .15s ease,color .15s ease}.talos-snackbar .talos-snackbar-action-btn:hover{background-color:var(--talos-primary-subtle-bg, #eff6ff);color:var(--talos-primary-hover, #1d4ed8)}.talos-snackbar .talos-snackbar-action-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}.talos-snackbar .talos-snackbar-close-btn{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--talos-text-muted, #94a3b8);padding:.375rem;border-radius:var(--talos-border-radius, .375rem);cursor:pointer;transition:color .15s ease,background-color .15s ease}.talos-snackbar .talos-snackbar-close-btn:hover{color:var(--talos-text-primary, #0f172a);background-color:var(--talos-bg-subtle, #f8fafc)}.talos-snackbar .talos-snackbar-close-btn:focus-visible{outline:none;box-shadow:var(--talos-focus-ring, 0 0 0 3px rgba(37, 99, 235, .15))}.talos-snackbar .talos-snackbar-progress{position:absolute;bottom:0;left:0;height:3px;background-color:var(--talos-primary-solid-bg, var(--talos-primary-color, #2563eb));transition:width .1s linear;border-bottom-left-radius:var(--talos-border-radius, .5rem)}.talos-snackbar .talos-snackbar-progress.variant-success{background-color:var(--talos-success-solid-bg, #16a34a)}.talos-snackbar .talos-snackbar-progress.variant-warning{background-color:var(--talos-warning-solid-bg, #d97706)}.talos-snackbar .talos-snackbar-progress.variant-error{background-color:var(--talos-danger-solid-bg, #ef4444)}@keyframes talos-snackbar-in-top{0%{opacity:0;transform:translateY(-16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes talos-snackbar-out-top{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-16px) scale(.95)}}@keyframes talos-snackbar-in-bottom{0%{opacity:0;transform:translateY(16px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes talos-snackbar-out-bottom{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(16px) scale(.95)}}\n"] }]
|
|
1868
|
+
}], propDecorators: { instance: [{ type: i0.Input, args: [{ isSignal: true, alias: "instance", required: true }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }], action: [{ type: i0.Output, args: ["action"] }] } });
|
|
1869
|
+
|
|
1870
|
+
class TalosSnackbarContainerComponent {
|
|
1871
|
+
snackbarService = inject(TalosSnackbarService);
|
|
1872
|
+
positions = [
|
|
1873
|
+
'top-left',
|
|
1874
|
+
'top-center',
|
|
1875
|
+
'top-right',
|
|
1876
|
+
'bottom-left',
|
|
1877
|
+
'bottom-center',
|
|
1878
|
+
'bottom-right'
|
|
1879
|
+
];
|
|
1880
|
+
groupedSnackbars = computed(() => {
|
|
1881
|
+
const all = this.snackbarService.snackbars();
|
|
1882
|
+
const map = {
|
|
1883
|
+
'top-left': [],
|
|
1884
|
+
'top-center': [],
|
|
1885
|
+
'top-right': [],
|
|
1886
|
+
'bottom-left': [],
|
|
1887
|
+
'bottom-center': [],
|
|
1888
|
+
'bottom-right': []
|
|
1889
|
+
};
|
|
1890
|
+
for (const item of all) {
|
|
1891
|
+
const pos = item.position || 'bottom-right';
|
|
1892
|
+
if (map[pos]) {
|
|
1893
|
+
map[pos].push(item);
|
|
1894
|
+
}
|
|
1895
|
+
else {
|
|
1896
|
+
map['bottom-right'].push(item);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
return map;
|
|
1900
|
+
}, /* @ts-ignore */
|
|
1901
|
+
...(ngDevMode ? [{ debugName: "groupedSnackbars" }] : /* istanbul ignore next */ []));
|
|
1902
|
+
onDismiss(id) {
|
|
1903
|
+
this.snackbarService.dismiss(id);
|
|
1904
|
+
}
|
|
1905
|
+
onAction(id) {
|
|
1906
|
+
// Action handled inside component and service
|
|
1907
|
+
}
|
|
1908
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1909
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosSnackbarContainerComponent, isStandalone: true, selector: "talos-snackbar-container", host: { classAttribute: "talos-snackbar-overlay-host" }, ngImport: i0, template: `
|
|
1910
|
+
@for (pos of positions; track pos) {
|
|
1911
|
+
@if (groupedSnackbars()[pos].length > 0) {
|
|
1912
|
+
<div class="talos-snackbar-position-group" [class]="pos">
|
|
1913
|
+
@for (item of groupedSnackbars()[pos]; track item.id) {
|
|
1914
|
+
<talos-snackbar
|
|
1915
|
+
[instance]="item"
|
|
1916
|
+
(dismiss)="onDismiss($event)"
|
|
1917
|
+
(action)="onAction($event)"
|
|
1918
|
+
/>
|
|
1919
|
+
}
|
|
1920
|
+
</div>
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
`, isInline: true, styles: [".cdk-overlay-container{z-index:10000!important;pointer-events:none!important}.cdk-global-overlay-wrapper{pointer-events:none!important}.cdk-overlay-pane.talos-snackbar-overlay-panel{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;pointer-events:none!important;margin:0!important;padding:0!important;border:none!important;background:transparent!important;z-index:10000!important}.talos-snackbar-overlay-host{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:10000;display:grid;grid-template-areas:\"top-left top-center top-right\" \". . .\" \"bottom-left bottom-center bottom-right\";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto 1fr;padding:1.5rem;box-sizing:border-box}@media(max-width:640px){.talos-snackbar-overlay-host{padding:.75rem}}.talos-snackbar-position-group{display:flex;flex-direction:column;gap:.75rem;max-width:440px;width:100%;pointer-events:none}.talos-snackbar-position-group.top-left{grid-area:top-left;align-items:flex-start;justify-self:flex-start}.talos-snackbar-position-group.top-center{grid-area:top-center;align-items:center;justify-self:center}.talos-snackbar-position-group.top-right{grid-area:top-right;align-items:flex-end;justify-self:flex-end}.talos-snackbar-position-group.bottom-left{grid-area:bottom-left;align-items:flex-start;justify-self:flex-start;flex-direction:column-reverse}.talos-snackbar-position-group.bottom-center{grid-area:bottom-center;align-items:center;justify-self:center;flex-direction:column-reverse}.talos-snackbar-position-group.bottom-right{grid-area:bottom-right;align-items:flex-end;justify-self:flex-end;flex-direction:column-reverse}\n"], dependencies: [{ kind: "component", type: TalosSnackbarComponent, selector: "talos-snackbar", inputs: ["instance"], outputs: ["dismiss", "action"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1924
|
+
}
|
|
1925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarContainerComponent, decorators: [{
|
|
1926
|
+
type: Component,
|
|
1927
|
+
args: [{ selector: 'talos-snackbar-container', imports: [TalosSnackbarComponent], template: `
|
|
1928
|
+
@for (pos of positions; track pos) {
|
|
1929
|
+
@if (groupedSnackbars()[pos].length > 0) {
|
|
1930
|
+
<div class="talos-snackbar-position-group" [class]="pos">
|
|
1931
|
+
@for (item of groupedSnackbars()[pos]; track item.id) {
|
|
1932
|
+
<talos-snackbar
|
|
1933
|
+
[instance]="item"
|
|
1934
|
+
(dismiss)="onDismiss($event)"
|
|
1935
|
+
(action)="onAction($event)"
|
|
1936
|
+
/>
|
|
1937
|
+
}
|
|
1938
|
+
</div>
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
`, encapsulation: ViewEncapsulation.None, host: {
|
|
1942
|
+
'class': 'talos-snackbar-overlay-host'
|
|
1943
|
+
}, styles: [".cdk-overlay-container{z-index:10000!important;pointer-events:none!important}.cdk-global-overlay-wrapper{pointer-events:none!important}.cdk-overlay-pane.talos-snackbar-overlay-panel{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;max-width:100vw!important;max-height:100vh!important;pointer-events:none!important;margin:0!important;padding:0!important;border:none!important;background:transparent!important;z-index:10000!important}.talos-snackbar-overlay-host{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:10000;display:grid;grid-template-areas:\"top-left top-center top-right\" \". . .\" \"bottom-left bottom-center bottom-right\";grid-template-rows:auto 1fr auto;grid-template-columns:1fr auto 1fr;padding:1.5rem;box-sizing:border-box}@media(max-width:640px){.talos-snackbar-overlay-host{padding:.75rem}}.talos-snackbar-position-group{display:flex;flex-direction:column;gap:.75rem;max-width:440px;width:100%;pointer-events:none}.talos-snackbar-position-group.top-left{grid-area:top-left;align-items:flex-start;justify-self:flex-start}.talos-snackbar-position-group.top-center{grid-area:top-center;align-items:center;justify-self:center}.talos-snackbar-position-group.top-right{grid-area:top-right;align-items:flex-end;justify-self:flex-end}.talos-snackbar-position-group.bottom-left{grid-area:bottom-left;align-items:flex-start;justify-self:flex-start;flex-direction:column-reverse}.talos-snackbar-position-group.bottom-center{grid-area:bottom-center;align-items:center;justify-self:center;flex-direction:column-reverse}.talos-snackbar-position-group.bottom-right{grid-area:bottom-right;align-items:flex-end;justify-self:flex-end;flex-direction:column-reverse}\n"] }]
|
|
1944
|
+
}] });
|
|
1945
|
+
|
|
1946
|
+
class TalosSnackbarService {
|
|
1947
|
+
overlay = inject(Overlay);
|
|
1948
|
+
overlayRef = null;
|
|
1949
|
+
/** Reactive list of currently active snackbar instances */
|
|
1950
|
+
snackbars = signal([], /* @ts-ignore */
|
|
1951
|
+
...(ngDevMode ? [{ debugName: "snackbars" }] : /* istanbul ignore next */ []));
|
|
1952
|
+
idCounter = 0;
|
|
1953
|
+
/** Global default configuration values */
|
|
1954
|
+
defaultConfig = {
|
|
1955
|
+
variant: 'default',
|
|
1956
|
+
position: 'bottom-right',
|
|
1957
|
+
duration: 4000,
|
|
1958
|
+
dismissible: true,
|
|
1959
|
+
showProgressBar: true,
|
|
1960
|
+
pauseOnHover: true,
|
|
1961
|
+
icon: true
|
|
1962
|
+
};
|
|
1963
|
+
/**
|
|
1964
|
+
* Override default global configurations for all subsequent snackbars.
|
|
1965
|
+
*/
|
|
1966
|
+
setDefaultConfig(config) {
|
|
1967
|
+
this.defaultConfig = { ...this.defaultConfig, ...config };
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Main entry point to open a configured snackbar.
|
|
1971
|
+
*/
|
|
1972
|
+
show(messageOrConfig, configOverrides = {}) {
|
|
1973
|
+
let fullConfig;
|
|
1974
|
+
if (typeof messageOrConfig === 'string' ||
|
|
1975
|
+
messageOrConfig instanceof TemplateRef) {
|
|
1976
|
+
fullConfig = {
|
|
1977
|
+
message: messageOrConfig,
|
|
1978
|
+
...configOverrides
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
else {
|
|
1982
|
+
fullConfig = {
|
|
1983
|
+
...messageOrConfig,
|
|
1984
|
+
...configOverrides
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
const merged = {
|
|
1988
|
+
id: `talos-sb-${++this.idCounter}-${Date.now()}`,
|
|
1989
|
+
variant: fullConfig.variant ?? this.defaultConfig.variant ?? 'default',
|
|
1990
|
+
position: fullConfig.position ?? this.defaultConfig.position ?? 'bottom-right',
|
|
1991
|
+
duration: fullConfig.duration ?? this.defaultConfig.duration ?? 4000,
|
|
1992
|
+
dismissible: fullConfig.dismissible ?? this.defaultConfig.dismissible ?? true,
|
|
1993
|
+
showProgressBar: fullConfig.showProgressBar ?? this.defaultConfig.showProgressBar ?? true,
|
|
1994
|
+
pauseOnHover: fullConfig.pauseOnHover ?? this.defaultConfig.pauseOnHover ?? true,
|
|
1995
|
+
icon: fullConfig.icon ?? this.defaultConfig.icon ?? true,
|
|
1996
|
+
message: fullConfig.message,
|
|
1997
|
+
title: fullConfig.title,
|
|
1998
|
+
actionLabel: fullConfig.actionLabel,
|
|
1999
|
+
onAction: fullConfig.onAction,
|
|
2000
|
+
onDismiss: fullConfig.onDismiss,
|
|
2001
|
+
customClass: fullConfig.customClass,
|
|
2002
|
+
data: fullConfig.data,
|
|
2003
|
+
createdAt: Date.now(),
|
|
2004
|
+
isPaused: false
|
|
2005
|
+
};
|
|
2006
|
+
this.ensureOverlayCreated();
|
|
2007
|
+
this.snackbars.update((current) => [...current, merged]);
|
|
2008
|
+
return {
|
|
2009
|
+
id: merged.id,
|
|
2010
|
+
dismiss: () => this.dismiss(merged.id)
|
|
2011
|
+
};
|
|
2012
|
+
}
|
|
2013
|
+
/** Convenience method for Success variant snackbars */
|
|
2014
|
+
success(message, config) {
|
|
2015
|
+
return this.show(message, { ...config, variant: 'success' });
|
|
2016
|
+
}
|
|
2017
|
+
/** Convenience method for Error variant snackbars */
|
|
2018
|
+
error(message, config) {
|
|
2019
|
+
return this.show(message, { ...config, variant: 'error' });
|
|
2020
|
+
}
|
|
2021
|
+
/** Convenience method for Warning variant snackbars */
|
|
2022
|
+
warning(message, config) {
|
|
2023
|
+
return this.show(message, { ...config, variant: 'warning' });
|
|
2024
|
+
}
|
|
2025
|
+
/** Convenience method for Info variant snackbars */
|
|
2026
|
+
info(message, config) {
|
|
2027
|
+
return this.show(message, { ...config, variant: 'info' });
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* Dismiss a specific snackbar by ID, or the oldest active snackbar if no ID is specified.
|
|
2031
|
+
*/
|
|
2032
|
+
dismiss(id) {
|
|
2033
|
+
if (!id) {
|
|
2034
|
+
const current = this.snackbars();
|
|
2035
|
+
if (current.length === 0)
|
|
2036
|
+
return;
|
|
2037
|
+
id = current[0].id;
|
|
2038
|
+
}
|
|
2039
|
+
this.snackbars.update((current) => current.filter((item) => item.id !== id));
|
|
2040
|
+
if (this.snackbars().length === 0) {
|
|
2041
|
+
this.destroyOverlay();
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* Dismiss all currently active snackbars.
|
|
2046
|
+
*/
|
|
2047
|
+
dismissAll() {
|
|
2048
|
+
this.snackbars.set([]);
|
|
2049
|
+
this.destroyOverlay();
|
|
2050
|
+
}
|
|
2051
|
+
ensureOverlayCreated() {
|
|
2052
|
+
if (!this.overlayRef) {
|
|
2053
|
+
const positionStrategy = this.overlay.position().global();
|
|
2054
|
+
this.overlayRef = this.overlay.create({
|
|
2055
|
+
positionStrategy,
|
|
2056
|
+
hasBackdrop: false,
|
|
2057
|
+
panelClass: 'talos-snackbar-overlay-panel'
|
|
2058
|
+
});
|
|
2059
|
+
const portal = new ComponentPortal(TalosSnackbarContainerComponent);
|
|
2060
|
+
this.overlayRef.attach(portal);
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
destroyOverlay() {
|
|
2064
|
+
if (this.overlayRef) {
|
|
2065
|
+
this.overlayRef.dispose();
|
|
2066
|
+
this.overlayRef = null;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2070
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarService, providedIn: 'root' });
|
|
2071
|
+
}
|
|
2072
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarService, decorators: [{
|
|
2073
|
+
type: Injectable,
|
|
2074
|
+
args: [{
|
|
2075
|
+
providedIn: 'root'
|
|
2076
|
+
}]
|
|
2077
|
+
}] });
|
|
2078
|
+
|
|
2079
|
+
/**
|
|
2080
|
+
* Convenience NgModule wrapping standalone snackbar components.
|
|
2081
|
+
*
|
|
2082
|
+
* Allows developers who prefer `TalosSnackbarModule` to import all snackbar elements in one go.
|
|
2083
|
+
*/
|
|
2084
|
+
class TalosSnackbarModule {
|
|
2085
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2086
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarModule, imports: [TalosSnackbarComponent,
|
|
2087
|
+
TalosSnackbarContainerComponent], exports: [TalosSnackbarComponent,
|
|
2088
|
+
TalosSnackbarContainerComponent] });
|
|
2089
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarModule, imports: [TalosSnackbarComponent,
|
|
2090
|
+
TalosSnackbarContainerComponent] });
|
|
2091
|
+
}
|
|
2092
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSnackbarModule, decorators: [{
|
|
2093
|
+
type: NgModule,
|
|
2094
|
+
args: [{
|
|
2095
|
+
imports: [
|
|
2096
|
+
TalosSnackbarComponent,
|
|
2097
|
+
TalosSnackbarContainerComponent
|
|
2098
|
+
],
|
|
2099
|
+
exports: [
|
|
2100
|
+
TalosSnackbarComponent,
|
|
2101
|
+
TalosSnackbarContainerComponent
|
|
2102
|
+
]
|
|
2103
|
+
}]
|
|
2104
|
+
}] });
|
|
2105
|
+
|
|
2106
|
+
/**
|
|
2107
|
+
* Maps standard sizing presets to pixel dimensions.
|
|
2108
|
+
*/
|
|
2109
|
+
const SPINNER_SIZE_MAP = {
|
|
2110
|
+
xs: 16,
|
|
2111
|
+
sm: 20,
|
|
2112
|
+
md: 28,
|
|
2113
|
+
lg: 40,
|
|
2114
|
+
xl: 56
|
|
2115
|
+
};
|
|
2116
|
+
/**
|
|
2117
|
+
* Maps standard sizing presets to default stroke / track widths.
|
|
2118
|
+
*/
|
|
2119
|
+
const SPINNER_STROKE_MAP = {
|
|
2120
|
+
xs: 2,
|
|
2121
|
+
sm: 2.5,
|
|
2122
|
+
md: 3,
|
|
2123
|
+
lg: 4,
|
|
2124
|
+
xl: 5
|
|
2125
|
+
};
|
|
2126
|
+
/**
|
|
2127
|
+
* Normalizes CSS dimension input (number converted to px string, or raw string).
|
|
2128
|
+
*
|
|
2129
|
+
* @param value Dimension input as string or number
|
|
2130
|
+
* @returns CSS dimension string or undefined
|
|
2131
|
+
*/
|
|
2132
|
+
function resolveSpinnerDimension(value) {
|
|
2133
|
+
if (value === null || value === undefined || value === '') {
|
|
2134
|
+
return undefined;
|
|
2135
|
+
}
|
|
2136
|
+
if (typeof value === 'number') {
|
|
2137
|
+
return `${value}px`;
|
|
2138
|
+
}
|
|
2139
|
+
const trimmed = value.trim();
|
|
2140
|
+
if (/^\d+$/.test(trimmed)) {
|
|
2141
|
+
return `${trimmed}px`;
|
|
2142
|
+
}
|
|
2143
|
+
return trimmed;
|
|
2144
|
+
}
|
|
2145
|
+
/**
|
|
2146
|
+
* Extracts a numeric pixel dimension or falls back to size preset lookup.
|
|
2147
|
+
*
|
|
2148
|
+
* @param size Preset or custom dimension
|
|
2149
|
+
* @returns Numeric pixel size
|
|
2150
|
+
*/
|
|
2151
|
+
function resolveNumericSize(size) {
|
|
2152
|
+
if (!size) {
|
|
2153
|
+
return SPINNER_SIZE_MAP.md;
|
|
2154
|
+
}
|
|
2155
|
+
if (typeof size === 'number') {
|
|
2156
|
+
return size;
|
|
2157
|
+
}
|
|
2158
|
+
if (size in SPINNER_SIZE_MAP) {
|
|
2159
|
+
return SPINNER_SIZE_MAP[size];
|
|
2160
|
+
}
|
|
2161
|
+
const parsed = parseFloat(size);
|
|
2162
|
+
return isNaN(parsed) ? SPINNER_SIZE_MAP.md : parsed;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* Global singleton service for displaying full-page or application-level loading spinners.
|
|
2167
|
+
*
|
|
2168
|
+
* Implements reference-counting so concurrent asynchronous operations (such as parallel HTTP requests
|
|
2169
|
+
* or multi-stage workflow transitions) can safely call `show()` and `hide()` without prematurely
|
|
2170
|
+
* dismissing the indicator while other background tasks are still in progress.
|
|
2171
|
+
*
|
|
2172
|
+
* @example
|
|
2173
|
+
* ```typescript
|
|
2174
|
+
* const spinner = inject(TalosSpinnerService);
|
|
2175
|
+
*
|
|
2176
|
+
* // Basic usage
|
|
2177
|
+
* spinner.show('Syncing database...');
|
|
2178
|
+
* await syncData();
|
|
2179
|
+
* spinner.hide();
|
|
2180
|
+
*
|
|
2181
|
+
* // Advanced configuration
|
|
2182
|
+
* spinner.show({
|
|
2183
|
+
* message: 'Processing batch export...',
|
|
2184
|
+
* variant: 'primary',
|
|
2185
|
+
* size: 'lg',
|
|
2186
|
+
* blur: true
|
|
2187
|
+
* });
|
|
2188
|
+
* ```
|
|
2189
|
+
*/
|
|
2190
|
+
class TalosSpinnerService {
|
|
2191
|
+
/** Active concurrent request counter */
|
|
2192
|
+
requestCount = signal(0, /* @ts-ignore */
|
|
2193
|
+
...(ngDevMode ? [{ debugName: "requestCount" }] : /* istanbul ignore next */ []));
|
|
2194
|
+
/** Current active spinner configuration */
|
|
2195
|
+
currentConfig = signal(null, /* @ts-ignore */
|
|
2196
|
+
...(ngDevMode ? [{ debugName: "currentConfig" }] : /* istanbul ignore next */ []));
|
|
2197
|
+
/** Whether the global spinner is currently active */
|
|
2198
|
+
active = computed(() => this.requestCount() > 0, /* @ts-ignore */
|
|
2199
|
+
...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
2200
|
+
/** The message currently displayed on the global spinner */
|
|
2201
|
+
message = computed(() => this.currentConfig()?.message, /* @ts-ignore */
|
|
2202
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
2203
|
+
/** The color variant currently used on the global spinner */
|
|
2204
|
+
variant = computed(() => this.currentConfig()?.variant ?? 'primary', /* @ts-ignore */
|
|
2205
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2206
|
+
/** The size preset currently used on the global spinner */
|
|
2207
|
+
size = computed(() => this.currentConfig()?.size ?? 'lg', /* @ts-ignore */
|
|
2208
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2209
|
+
/** The animation type currently used on the global spinner */
|
|
2210
|
+
type = computed(() => this.currentConfig()?.type ?? 'circular', /* @ts-ignore */
|
|
2211
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2212
|
+
/** Whether backdrop blur is enabled for the global spinner */
|
|
2213
|
+
blur = computed(() => this.currentConfig()?.blur ?? true, /* @ts-ignore */
|
|
2214
|
+
...(ngDevMode ? [{ debugName: "blur" }] : /* istanbul ignore next */ []));
|
|
2215
|
+
/** Accessible label announced to screen readers */
|
|
2216
|
+
ariaLabel = computed(() => {
|
|
2217
|
+
return this.currentConfig()?.ariaLabel || this.currentConfig()?.message || 'Loading, please wait...';
|
|
2218
|
+
}, /* @ts-ignore */
|
|
2219
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2220
|
+
/**
|
|
2221
|
+
* Activates the global loading spinner or increments the active operation counter.
|
|
2222
|
+
*
|
|
2223
|
+
* @param configOrMessage Optional configuration object or text message string
|
|
2224
|
+
*/
|
|
2225
|
+
show(configOrMessage) {
|
|
2226
|
+
const config = typeof configOrMessage === 'string'
|
|
2227
|
+
? { message: configOrMessage }
|
|
2228
|
+
: configOrMessage ?? {};
|
|
2229
|
+
this.currentConfig.set({
|
|
2230
|
+
variant: 'primary',
|
|
2231
|
+
size: 'lg',
|
|
2232
|
+
type: 'circular',
|
|
2233
|
+
blur: true,
|
|
2234
|
+
fullscreen: true,
|
|
2235
|
+
...config
|
|
2236
|
+
});
|
|
2237
|
+
this.requestCount.update(count => count + 1);
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Decrements the active operation counter. Dismisses the global spinner once all operations have completed.
|
|
2241
|
+
*/
|
|
2242
|
+
hide() {
|
|
2243
|
+
this.requestCount.update(count => {
|
|
2244
|
+
const next = Math.max(0, count - 1);
|
|
2245
|
+
if (next === 0) {
|
|
2246
|
+
this.currentConfig.set(null);
|
|
2247
|
+
}
|
|
2248
|
+
return next;
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
/**
|
|
2252
|
+
* Immediately clears all active requests and forces the global spinner to hide.
|
|
2253
|
+
*/
|
|
2254
|
+
forceHide() {
|
|
2255
|
+
this.requestCount.set(0);
|
|
2256
|
+
this.currentConfig.set(null);
|
|
2257
|
+
}
|
|
2258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2259
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerService, providedIn: 'root' });
|
|
2260
|
+
}
|
|
2261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerService, decorators: [{
|
|
2262
|
+
type: Injectable,
|
|
2263
|
+
args: [{
|
|
2264
|
+
providedIn: 'root'
|
|
2265
|
+
}]
|
|
2266
|
+
}] });
|
|
2267
|
+
|
|
2268
|
+
/**
|
|
2269
|
+
* Modern, accessible loading spinner component for inline button indicators,
|
|
2270
|
+
* contextual card loading overlays, and global asynchronous feedback.
|
|
2271
|
+
*
|
|
2272
|
+
* Fully reactive via Angular signals with support for circular, dots, ring,
|
|
2273
|
+
* and orbital animations, standard sizing presets, semantic variants, and WCAG AA compliance.
|
|
2274
|
+
*
|
|
2275
|
+
* @example
|
|
2276
|
+
* ```html
|
|
2277
|
+
* <!-- Standard inline spinner -->
|
|
2278
|
+
* <talos-spinner size="sm" variant="primary" />
|
|
2279
|
+
*
|
|
2280
|
+
* <!-- Centered card overlay with custom label -->
|
|
2281
|
+
* <talos-spinner [overlay]="true" [loading]="isSyncing()" label="Synchronizing records...">
|
|
2282
|
+
* <div class="card-content">...</div>
|
|
2283
|
+
* </talos-spinner>
|
|
2284
|
+
*
|
|
2285
|
+
* <!-- Bouncing dots variant for button states -->
|
|
2286
|
+
* <talos-spinner type="dots" size="xs" variant="inherit" />
|
|
2287
|
+
* ```
|
|
2288
|
+
*/
|
|
2289
|
+
class TalosSpinnerComponent {
|
|
2290
|
+
/**
|
|
2291
|
+
* Visual semantic variant palette for the spinner stroke and accents.
|
|
2292
|
+
* @default 'primary'
|
|
2293
|
+
*/
|
|
2294
|
+
variant = input('primary', /* @ts-ignore */
|
|
2295
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2296
|
+
/**
|
|
2297
|
+
* Sizing preset ('xs' | 'sm' | 'md' | 'lg' | 'xl') or custom numerical / CSS dimension.
|
|
2298
|
+
* @default 'md'
|
|
2299
|
+
*/
|
|
2300
|
+
size = input('md', /* @ts-ignore */
|
|
2301
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
2302
|
+
/**
|
|
2303
|
+
* Animation visual rendering type.
|
|
2304
|
+
* @default 'circular'
|
|
2305
|
+
*/
|
|
2306
|
+
type = input('circular', /* @ts-ignore */
|
|
2307
|
+
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2308
|
+
/**
|
|
2309
|
+
* Cycle animation speed preset.
|
|
2310
|
+
* @default 'normal'
|
|
2311
|
+
*/
|
|
2312
|
+
speed = input('normal', /* @ts-ignore */
|
|
2313
|
+
...(ngDevMode ? [{ debugName: "speed" }] : /* istanbul ignore next */ []));
|
|
2314
|
+
/**
|
|
2315
|
+
* Custom stroke width in pixels for SVG circular / ring animations.
|
|
2316
|
+
*/
|
|
2317
|
+
strokeWidth = input(undefined, /* @ts-ignore */
|
|
2318
|
+
...(ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []));
|
|
2319
|
+
/**
|
|
2320
|
+
* Custom CSS color override for the animated spinner fill.
|
|
2321
|
+
*/
|
|
2322
|
+
color = input(undefined, /* @ts-ignore */
|
|
2323
|
+
...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
2324
|
+
/**
|
|
2325
|
+
* Custom CSS background color override for the subtle circular track ring.
|
|
2326
|
+
*/
|
|
2327
|
+
trackColor = input(undefined, /* @ts-ignore */
|
|
2328
|
+
...(ngDevMode ? [{ debugName: "trackColor" }] : /* istanbul ignore next */ []));
|
|
2329
|
+
/**
|
|
2330
|
+
* Whether to render the secondary background track ring.
|
|
2331
|
+
* @default true
|
|
2332
|
+
*/
|
|
2333
|
+
showTrack = input(true, { ...(ngDevMode ? { debugName: "showTrack" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2334
|
+
/**
|
|
2335
|
+
* Optional visible text label displayed next to or below the spinner.
|
|
2336
|
+
*/
|
|
2337
|
+
label = input(undefined, /* @ts-ignore */
|
|
2338
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2339
|
+
/**
|
|
2340
|
+
* Position of the label text relative to the spinner indicator.
|
|
2341
|
+
* @default 'bottom'
|
|
2342
|
+
*/
|
|
2343
|
+
labelPosition = input('bottom', /* @ts-ignore */
|
|
2344
|
+
...(ngDevMode ? [{ debugName: "labelPosition" }] : /* istanbul ignore next */ []));
|
|
2345
|
+
/**
|
|
2346
|
+
* Whether this spinner functions as a container wrapper overlay over projected content.
|
|
2347
|
+
* @default false
|
|
2348
|
+
*/
|
|
2349
|
+
overlay = input(false, { ...(ngDevMode ? { debugName: "overlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2350
|
+
/**
|
|
2351
|
+
* Active state when used as an overlay wrapper.
|
|
2352
|
+
* @default true
|
|
2353
|
+
*/
|
|
2354
|
+
loading = input(true, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2355
|
+
/**
|
|
2356
|
+
* Whether to apply a frosted glassmorphic backdrop blur to the container overlay.
|
|
2357
|
+
* @default false
|
|
2358
|
+
*/
|
|
2359
|
+
blur = input(false, { ...(ngDevMode ? { debugName: "blur" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2360
|
+
/**
|
|
2361
|
+
* Whether this overlay covers the full viewport screen.
|
|
2362
|
+
* @default false
|
|
2363
|
+
*/
|
|
2364
|
+
fullscreen = input(false, { ...(ngDevMode ? { debugName: "fullscreen" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2365
|
+
/**
|
|
2366
|
+
* Accessible description announced to screen readers.
|
|
2367
|
+
* Defaults to `label` or 'Loading, please wait...'.
|
|
2368
|
+
*/
|
|
2369
|
+
ariaLabel = input(undefined, /* @ts-ignore */
|
|
2370
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2371
|
+
/** Projected custom label directive */
|
|
2372
|
+
customLabel = contentChild(TalosSpinnerLabelDirective, /* @ts-ignore */
|
|
2373
|
+
...(ngDevMode ? [{ debugName: "customLabel" }] : /* istanbul ignore next */ []));
|
|
2374
|
+
/** Evaluated numeric pixel diameter */
|
|
2375
|
+
numericSize = computed(() => {
|
|
2376
|
+
return resolveNumericSize(this.size());
|
|
2377
|
+
}, /* @ts-ignore */
|
|
2378
|
+
...(ngDevMode ? [{ debugName: "numericSize" }] : /* istanbul ignore next */ []));
|
|
2379
|
+
/** Computed CSS dimension string (e.g., '28px') */
|
|
2380
|
+
computedDimension = computed(() => {
|
|
2381
|
+
return resolveSpinnerDimension(this.size()) ?? null;
|
|
2382
|
+
}, /* @ts-ignore */
|
|
2383
|
+
...(ngDevMode ? [{ debugName: "computedDimension" }] : /* istanbul ignore next */ []));
|
|
2384
|
+
/** Evaluated stroke width based on size or custom input */
|
|
2385
|
+
computedStrokeWidth = computed(() => {
|
|
2386
|
+
const custom = this.strokeWidth();
|
|
2387
|
+
if (custom !== undefined && custom > 0) {
|
|
2388
|
+
return custom;
|
|
2389
|
+
}
|
|
2390
|
+
const currentSize = this.size();
|
|
2391
|
+
if (typeof currentSize === 'string' && currentSize in SPINNER_STROKE_MAP) {
|
|
2392
|
+
return SPINNER_STROKE_MAP[currentSize];
|
|
2393
|
+
}
|
|
2394
|
+
const num = this.numericSize();
|
|
2395
|
+
return Math.max(1.75, Math.round((num / 10) * 10) / 10);
|
|
2396
|
+
}, /* @ts-ignore */
|
|
2397
|
+
...(ngDevMode ? [{ debugName: "computedStrokeWidth" }] : /* istanbul ignore next */ []));
|
|
2398
|
+
/** Radius of SVG circle taking stroke into account */
|
|
2399
|
+
computedRadius = computed(() => {
|
|
2400
|
+
const stroke = this.computedStrokeWidth();
|
|
2401
|
+
return Math.max(2, (48 - stroke) / 2);
|
|
2402
|
+
}, /* @ts-ignore */
|
|
2403
|
+
...(ngDevMode ? [{ debugName: "computedRadius" }] : /* istanbul ignore next */ []));
|
|
2404
|
+
/** Circumference of SVG circle for stroke dash animations */
|
|
2405
|
+
computedCircumference = computed(() => {
|
|
2406
|
+
return 2 * Math.PI * this.computedRadius();
|
|
2407
|
+
}, /* @ts-ignore */
|
|
2408
|
+
...(ngDevMode ? [{ debugName: "computedCircumference" }] : /* istanbul ignore next */ []));
|
|
2409
|
+
/** Dash array for SVG circular arc */
|
|
2410
|
+
computedDashArray = computed(() => {
|
|
2411
|
+
const circ = this.computedCircumference();
|
|
2412
|
+
return `${circ * 0.75} ${circ * 0.25}`;
|
|
2413
|
+
}, /* @ts-ignore */
|
|
2414
|
+
...(ngDevMode ? [{ debugName: "computedDashArray" }] : /* istanbul ignore next */ []));
|
|
2415
|
+
/** Dash offset for initial arc position */
|
|
2416
|
+
computedDashOffset = computed(() => {
|
|
2417
|
+
return this.computedCircumference() * 0.25;
|
|
2418
|
+
}, /* @ts-ignore */
|
|
2419
|
+
...(ngDevMode ? [{ debugName: "computedDashOffset" }] : /* istanbul ignore next */ []));
|
|
2420
|
+
/** Resolved accessible label */
|
|
2421
|
+
resolvedAriaLabel = computed(() => {
|
|
2422
|
+
const custom = this.ariaLabel();
|
|
2423
|
+
if (custom && custom.trim().length > 0) {
|
|
2424
|
+
return custom.trim();
|
|
2425
|
+
}
|
|
2426
|
+
const lbl = this.label();
|
|
2427
|
+
if (lbl && lbl.trim().length > 0) {
|
|
2428
|
+
return lbl.trim();
|
|
2429
|
+
}
|
|
2430
|
+
return 'Loading, please wait...';
|
|
2431
|
+
}, /* @ts-ignore */
|
|
2432
|
+
...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
2433
|
+
/** Whether the label is arranged in horizontal inline layout with the spinner */
|
|
2434
|
+
isInlineLayout = computed(() => {
|
|
2435
|
+
const pos = this.labelPosition();
|
|
2436
|
+
return pos === 'inline' || pos === 'start' || pos === 'end';
|
|
2437
|
+
}, /* @ts-ignore */
|
|
2438
|
+
...(ngDevMode ? [{ debugName: "isInlineLayout" }] : /* istanbul ignore next */ []));
|
|
2439
|
+
/** Whether the overlay is actively showing */
|
|
2440
|
+
isOverlayActive = computed(() => {
|
|
2441
|
+
if (!this.overlay()) {
|
|
2442
|
+
return true;
|
|
2443
|
+
}
|
|
2444
|
+
return this.loading();
|
|
2445
|
+
}, /* @ts-ignore */
|
|
2446
|
+
...(ngDevMode ? [{ debugName: "isOverlayActive" }] : /* istanbul ignore next */ []));
|
|
2447
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2448
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosSpinnerComponent, isStandalone: true, selector: "talos-spinner, talos-loading-spinner, [talosSpinner], [talosLoadingSpinner]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, trackColor: { classPropertyName: "trackColor", publicName: "trackColor", isSignal: true, isRequired: false, transformFunction: null }, showTrack: { classPropertyName: "showTrack", publicName: "showTrack", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelPosition: { classPropertyName: "labelPosition", publicName: "labelPosition", isSignal: true, isRequired: false, transformFunction: null }, overlay: { classPropertyName: "overlay", publicName: "overlay", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, blur: { classPropertyName: "blur", publicName: "blur", isSignal: true, isRequired: false, transformFunction: null }, fullscreen: { classPropertyName: "fullscreen", publicName: "fullscreen", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-spinner-host--overlay": "overlay()", "class.talos-spinner-host--active": "isOverlayActive()", "class.talos-spinner-host--blur": "blur()", "class.talos-spinner-host--fullscreen": "fullscreen()", "class.talos-spinner--primary": "variant() === \"primary\"", "class.talos-spinner--secondary": "variant() === \"secondary\"", "class.talos-spinner--success": "variant() === \"success\"", "class.talos-spinner--warning": "variant() === \"warning\"", "class.talos-spinner--danger": "variant() === \"danger\" || variant() === \"error\"", "class.talos-spinner--error": "variant() === \"danger\" || variant() === \"error\"", "class.talos-spinner--info": "variant() === \"info\"", "class.talos-spinner--neutral": "variant() === \"neutral\"", "class.talos-spinner--subtle": "variant() === \"subtle\"", "class.talos-spinner--outline": "variant() === \"outline\"", "class.talos-spinner--inherit": "variant() === \"inherit\"", "class.talos-spinner--xs": "size() === \"xs\"", "class.talos-spinner--sm": "size() === \"sm\"", "class.talos-spinner--md": "size() === \"md\"", "class.talos-spinner--lg": "size() === \"lg\"", "class.talos-spinner--xl": "size() === \"xl\"", "class.talos-spinner--circular": "type() === \"circular\"", "class.talos-spinner--dots": "type() === \"dots\"", "class.talos-spinner--ring": "type() === \"ring\"", "class.talos-spinner--orbit": "type() === \"orbit\"", "class.talos-spinner--slow": "speed() === \"slow\"", "class.talos-spinner--fast": "speed() === \"fast\"", "class.talos-spinner--inline": "isInlineLayout()", "attr.role": "overlay() ? null : \"status\"", "attr.aria-live": "overlay() ? null : \"polite\"", "attr.aria-busy": "overlay() ? (isOverlayActive() ? \"true\" : \"false\") : \"true\"", "attr.aria-label": "overlay() ? null : resolvedAriaLabel()", "style.--talos-spinner-custom-size": "computedDimension()", "style.--talos-spinner-custom-color": "color() ?? null", "style.--talos-spinner-custom-track": "trackColor() ?? null" }, classAttribute: "talos-spinner-host" }, queries: [{ propertyName: "customLabel", first: true, predicate: TalosSpinnerLabelDirective, descendants: true, isSignal: true }], ngImport: i0, template: "@if (overlay()) {\n <!-- Wrapped content projection -->\n <div class=\"talos-spinner__content-slot\" [class.talos-spinner__content-slot--blurred]=\"isOverlayActive() && blur()\">\n <ng-content />\n </div>\n\n <!-- Active overlay backdrop scrim -->\n @if (isOverlayActive()) {\n <div\n class=\"talos-spinner__overlay\"\n [class.talos-spinner__overlay--fullscreen]=\"fullscreen()\"\n [class.talos-spinner__overlay--blur]=\"blur()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div class=\"talos-spinner__inner\" [class.talos-spinner__inner--inline]=\"isInlineLayout()\">\n <!-- Label placed start / top -->\n @if (labelPosition() === 'top' || labelPosition() === 'start') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n\n <!-- Animated Spinner Core -->\n <ng-container *ngTemplateOutlet=\"spinnerCoreTemplate\" />\n\n <!-- Label placed end / bottom / inline -->\n @if (labelPosition() === 'bottom' || labelPosition() === 'end' || labelPosition() === 'inline') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </div>\n </div>\n }\n} @else {\n <!-- Inline / Standalone Spinner Presentation -->\n <div class=\"talos-spinner__inner\" [class.talos-spinner__inner--inline]=\"isInlineLayout()\">\n <!-- Label placed start / top -->\n @if (labelPosition() === 'top' || labelPosition() === 'start') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n\n <!-- Animated Spinner Core -->\n <ng-container *ngTemplateOutlet=\"spinnerCoreTemplate\" />\n\n <!-- Label placed end / bottom / inline -->\n @if (labelPosition() === 'bottom' || labelPosition() === 'end' || labelPosition() === 'inline') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </div>\n\n <!-- Screen reader fallback when no visible label exists -->\n @if (!label() && !customLabel()) {\n <span class=\"sr-only\">{{ resolvedAriaLabel() }}</span>\n }\n}\n\n<!-- Reusable Spinner Core SVG / Graphics Template -->\n<ng-template #spinnerCoreTemplate>\n <div class=\"talos-spinner__graphic\" [attr.aria-hidden]=\"true\">\n @switch (type()) {\n @case ('dots') {\n <div class=\"talos-spinner__dots\">\n <span class=\"talos-spinner__dot talos-spinner__dot--1\"></span>\n <span class=\"talos-spinner__dot talos-spinner__dot--2\"></span>\n <span class=\"talos-spinner__dot talos-spinner__dot--3\"></span>\n </div>\n }\n\n @case ('ring') {\n <svg\n class=\"talos-spinner__svg talos-spinner__svg--ring\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @if (showTrack()) {\n <circle\n class=\"talos-spinner__track\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n />\n }\n <circle\n class=\"talos-spinner__ring-arc talos-spinner__ring-arc--top\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n <circle\n class=\"talos-spinner__ring-arc talos-spinner__ring-arc--bottom\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n\n @case ('orbit') {\n <div class=\"talos-spinner__orbit\">\n <span class=\"talos-spinner__orbit-core\"></span>\n <span class=\"talos-spinner__orbit-satellite talos-spinner__orbit-satellite--1\"></span>\n <span class=\"talos-spinner__orbit-satellite talos-spinner__orbit-satellite--2\"></span>\n </div>\n }\n\n @default {\n <!-- Default circular spinner -->\n <svg\n class=\"talos-spinner__svg talos-spinner__svg--circular\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @if (showTrack()) {\n <circle\n class=\"talos-spinner__track\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n />\n }\n <circle\n class=\"talos-spinner__arc\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n [attr.stroke-dasharray]=\"computedDashArray()\"\n [attr.stroke-dashoffset]=\"computedDashOffset()\"\n />\n </svg>\n }\n }\n </div>\n</ng-template>\n\n<!-- Reusable Label Template -->\n<ng-template #labelTemplate>\n @if (label() || customLabel()) {\n <div\n class=\"talos-spinner__label\"\n [class.talos-spinner__label--top]=\"labelPosition() === 'top'\"\n [class.talos-spinner__label--bottom]=\"labelPosition() === 'bottom'\"\n [class.talos-spinner__label--start]=\"labelPosition() === 'start'\"\n [class.talos-spinner__label--end]=\"labelPosition() === 'end'\"\n [class.talos-spinner__label--inline]=\"labelPosition() === 'inline'\"\n >\n @if (label()) {\n <span>{{ label() }}</span>\n }\n <ng-content select=\"[talosSpinnerLabel]\" />\n </div>\n }\n</ng-template>\n", styles: [":host{display:inline-flex;vertical-align:middle;box-sizing:border-box;--spinner-size: var(--talos-spinner-custom-size, 28px);--spinner-color: var(--talos-spinner-custom-color, var(--talos-primary-color, #2563eb));--spinner-track-color: var(--talos-spinner-custom-track, var(--talos-border-subtle, rgba(226, 232, 240, .8)));--spinner-speed: .85s}:host.talos-spinner--xs{--spinner-size: 16px}:host.talos-spinner--sm{--spinner-size: 20px}:host.talos-spinner--md{--spinner-size: 28px}:host.talos-spinner--lg{--spinner-size: 40px}:host.talos-spinner--xl{--spinner-size: 56px}:host.talos-spinner--primary{--spinner-color: var(--talos-primary-color, #2563eb);--spinner-track-color: var(--talos-primary-light, rgba(37, 99, 235, .15))}:host.talos-spinner--secondary{--spinner-color: var(--talos-secondary, #64748b);--spinner-track-color: rgba(100, 116, 139, .15)}:host.talos-spinner--success{--spinner-color: var(--talos-success-color, #16a34a);--spinner-track-color: var(--talos-success-light, rgba(22, 163, 74, .15))}:host.talos-spinner--warning{--spinner-color: var(--talos-warning-color, #d97706);--spinner-track-color: var(--talos-warning-light, rgba(217, 119, 6, .15))}:host.talos-spinner--danger,:host.talos-spinner--error{--spinner-color: var(--talos-danger-color, #dc2626);--spinner-track-color: var(--talos-danger-light, rgba(220, 38, 38, .15))}:host.talos-spinner--info{--spinner-color: var(--talos-info-color, #0284c7);--spinner-track-color: var(--talos-info-light, rgba(2, 132, 199, .15))}:host.talos-spinner--neutral{--spinner-color: var(--talos-neutral-color, #64748b);--spinner-track-color: rgba(100, 116, 139, .12)}:host.talos-spinner--subtle{--spinner-color: var(--talos-text-muted, #94a3b8);--spinner-track-color: rgba(148, 163, 184, .12)}:host.talos-spinner--outline{--spinner-color: currentColor;--spinner-track-color: transparent}:host.talos-spinner--inherit{--spinner-color: currentColor;--spinner-track-color: rgba(255, 255, 255, .2)}:host.talos-spinner--slow{--spinner-speed: 1.5s}:host.talos-spinner--fast{--spinner-speed: .5s}:host.talos-spinner-host--overlay{position:relative;display:block;width:100%}:host.talos-spinner-host--fullscreen{position:fixed;inset:0;z-index:var(--talos-z-index-modal, 9999)}.talos-spinner__inner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.talos-spinner__inner--inline{flex-direction:row;align-items:center;gap:8px;text-align:left}.talos-spinner__graphic{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--spinner-size);height:var(--spinner-size);flex-shrink:0}.talos-spinner__svg{width:100%;height:100%;display:block;overflow:visible}.talos-spinner__svg--circular{animation:talos-spinner-rotate var(--spinner-speed) linear infinite;transform-origin:center center}.talos-spinner__svg--circular .talos-spinner__arc{animation:talos-spinner-dash calc(var(--spinner-speed) * 1.6) ease-in-out infinite}.talos-spinner__svg--ring{animation:talos-spinner-rotate var(--spinner-speed) linear infinite;transform-origin:center center}.talos-spinner__track{stroke:var(--spinner-track-color);opacity:.85}.talos-spinner__arc{stroke:var(--spinner-color);transform-origin:center center}.talos-spinner__ring-arc{stroke:var(--spinner-color)}.talos-spinner__ring-arc--top{stroke-dasharray:28 32}.talos-spinner__ring-arc--bottom{stroke-dasharray:18 42;opacity:.65}.talos-spinner__dots{display:inline-flex;align-items:center;justify-content:center;gap:calc(var(--spinner-size) * .15);height:100%}.talos-spinner__dot{display:block;width:calc(var(--spinner-size) * .28);height:calc(var(--spinner-size) * .28);border-radius:50%;background-color:var(--spinner-color);animation:talos-spinner-dot-bounce var(--spinner-speed) ease-in-out infinite both}.talos-spinner__dot--1{animation-delay:-.32s}.talos-spinner__dot--2{animation-delay:-.16s}.talos-spinner__dot--3{animation-delay:0s}.talos-spinner__orbit{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;animation:talos-spinner-rotate var(--spinner-speed) linear infinite}.talos-spinner__orbit-core{width:calc(var(--spinner-size) * .3);height:calc(var(--spinner-size) * .3);border-radius:50%;background-color:var(--spinner-color);box-shadow:0 0 calc(var(--spinner-size) * .2) var(--spinner-color)}.talos-spinner__orbit-satellite{position:absolute;border-radius:50%;background-color:var(--spinner-color)}.talos-spinner__orbit-satellite--1{top:0;left:50%;transform:translate(-50%);width:calc(var(--spinner-size) * .22);height:calc(var(--spinner-size) * .22)}.talos-spinner__orbit-satellite--2{bottom:0;left:50%;transform:translate(-50%);width:calc(var(--spinner-size) * .16);height:calc(var(--spinner-size) * .16);opacity:.6}.talos-spinner__label{font-size:var(--talos-font-size-sm, 13px);font-weight:500;line-height:1.4;color:var(--talos-text-color, #1e293b);transition:color .2s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}.talos-spinner__label--bottom{margin-top:2px}.talos-spinner__label--top{margin-bottom:2px}.talos-spinner__label--start{margin-right:2px}.talos-spinner__label--end,.talos-spinner__label--inline{margin-left:2px}.talos-spinner__content-slot{width:100%;transition:filter .2s cubic-bezier(.4,0,.2,1)}.talos-spinner__content-slot--blurred{filter:blur(2px);pointer-events:none;-webkit-user-select:none;user-select:none}.talos-spinner__overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;background-color:var(--talos-spinner-overlay-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:none;backdrop-filter:none;border-radius:inherit;pointer-events:auto;animation:talos-spinner-fade .2s cubic-bezier(.4,0,.2,1)}.talos-spinner__overlay--blur{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.talos-spinner__overlay--fullscreen{position:fixed;z-index:var(--talos-z-index-modal, 9999)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes talos-spinner-rotate{to{transform:rotate(360deg)}}@keyframes talos-spinner-dash{0%{stroke-dasharray:1 120;stroke-dashoffset:0}50%{stroke-dasharray:90 120;stroke-dashoffset:-35}to{stroke-dasharray:90 120;stroke-dashoffset:-124}}@keyframes talos-spinner-dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}@keyframes talos-spinner-fade{0%{opacity:0}to{opacity:1}}[data-theme=dark] :host,[data-mode=dark] :host,.dark :host,.dark-theme :host{--spinner-track-color: var(--talos-spinner-custom-track, rgba(255, 255, 255, .12))}[data-theme=dark] :host .talos-spinner__label,[data-mode=dark] :host .talos-spinner__label,.dark :host .talos-spinner__label,.dark-theme :host .talos-spinner__label{color:var(--talos-text-color, #f1f5f9)}[data-theme=dark] :host .talos-spinner__overlay,[data-mode=dark] :host .talos-spinner__overlay,.dark :host .talos-spinner__overlay,.dark-theme :host .talos-spinner__overlay{background-color:var(--talos-spinner-overlay-bg-dark, rgba(15, 23, 42, .72))}@media(prefers-reduced-motion:reduce){.talos-spinner__svg,.talos-spinner__svg--circular,.talos-spinner__svg--ring,.talos-spinner__orbit{animation:talos-spinner-pulse 1.8s ease-in-out infinite!important}.talos-spinner__arc{animation:none!important;stroke-dasharray:80 40!important}.talos-spinner__dot{animation:talos-spinner-pulse 1.8s ease-in-out infinite!important}@keyframes talos-spinner-pulse{0%,to{opacity:1}50%{opacity:.3}}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
2449
|
+
}
|
|
2450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerComponent, decorators: [{
|
|
2451
|
+
type: Component,
|
|
2452
|
+
args: [{ selector: 'talos-spinner, talos-loading-spinner, [talosSpinner], [talosLoadingSpinner]', imports: [NgTemplateOutlet], host: {
|
|
2453
|
+
'class': 'talos-spinner-host',
|
|
2454
|
+
'[class.talos-spinner-host--overlay]': 'overlay()',
|
|
2455
|
+
'[class.talos-spinner-host--active]': 'isOverlayActive()',
|
|
2456
|
+
'[class.talos-spinner-host--blur]': 'blur()',
|
|
2457
|
+
'[class.talos-spinner-host--fullscreen]': 'fullscreen()',
|
|
2458
|
+
'[class.talos-spinner--primary]': 'variant() === "primary"',
|
|
2459
|
+
'[class.talos-spinner--secondary]': 'variant() === "secondary"',
|
|
2460
|
+
'[class.talos-spinner--success]': 'variant() === "success"',
|
|
2461
|
+
'[class.talos-spinner--warning]': 'variant() === "warning"',
|
|
2462
|
+
'[class.talos-spinner--danger]': 'variant() === "danger" || variant() === "error"',
|
|
2463
|
+
'[class.talos-spinner--error]': 'variant() === "danger" || variant() === "error"',
|
|
2464
|
+
'[class.talos-spinner--info]': 'variant() === "info"',
|
|
2465
|
+
'[class.talos-spinner--neutral]': 'variant() === "neutral"',
|
|
2466
|
+
'[class.talos-spinner--subtle]': 'variant() === "subtle"',
|
|
2467
|
+
'[class.talos-spinner--outline]': 'variant() === "outline"',
|
|
2468
|
+
'[class.talos-spinner--inherit]': 'variant() === "inherit"',
|
|
2469
|
+
'[class.talos-spinner--xs]': 'size() === "xs"',
|
|
2470
|
+
'[class.talos-spinner--sm]': 'size() === "sm"',
|
|
2471
|
+
'[class.talos-spinner--md]': 'size() === "md"',
|
|
2472
|
+
'[class.talos-spinner--lg]': 'size() === "lg"',
|
|
2473
|
+
'[class.talos-spinner--xl]': 'size() === "xl"',
|
|
2474
|
+
'[class.talos-spinner--circular]': 'type() === "circular"',
|
|
2475
|
+
'[class.talos-spinner--dots]': 'type() === "dots"',
|
|
2476
|
+
'[class.talos-spinner--ring]': 'type() === "ring"',
|
|
2477
|
+
'[class.talos-spinner--orbit]': 'type() === "orbit"',
|
|
2478
|
+
'[class.talos-spinner--slow]': 'speed() === "slow"',
|
|
2479
|
+
'[class.talos-spinner--fast]': 'speed() === "fast"',
|
|
2480
|
+
'[class.talos-spinner--inline]': 'isInlineLayout()',
|
|
2481
|
+
'[attr.role]': 'overlay() ? null : "status"',
|
|
2482
|
+
'[attr.aria-live]': 'overlay() ? null : "polite"',
|
|
2483
|
+
'[attr.aria-busy]': 'overlay() ? (isOverlayActive() ? "true" : "false") : "true"',
|
|
2484
|
+
'[attr.aria-label]': 'overlay() ? null : resolvedAriaLabel()',
|
|
2485
|
+
'[style.--talos-spinner-custom-size]': 'computedDimension()',
|
|
2486
|
+
'[style.--talos-spinner-custom-color]': 'color() ?? null',
|
|
2487
|
+
'[style.--talos-spinner-custom-track]': 'trackColor() ?? null'
|
|
2488
|
+
}, template: "@if (overlay()) {\n <!-- Wrapped content projection -->\n <div class=\"talos-spinner__content-slot\" [class.talos-spinner__content-slot--blurred]=\"isOverlayActive() && blur()\">\n <ng-content />\n </div>\n\n <!-- Active overlay backdrop scrim -->\n @if (isOverlayActive()) {\n <div\n class=\"talos-spinner__overlay\"\n [class.talos-spinner__overlay--fullscreen]=\"fullscreen()\"\n [class.talos-spinner__overlay--blur]=\"blur()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n >\n <div class=\"talos-spinner__inner\" [class.talos-spinner__inner--inline]=\"isInlineLayout()\">\n <!-- Label placed start / top -->\n @if (labelPosition() === 'top' || labelPosition() === 'start') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n\n <!-- Animated Spinner Core -->\n <ng-container *ngTemplateOutlet=\"spinnerCoreTemplate\" />\n\n <!-- Label placed end / bottom / inline -->\n @if (labelPosition() === 'bottom' || labelPosition() === 'end' || labelPosition() === 'inline') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </div>\n </div>\n }\n} @else {\n <!-- Inline / Standalone Spinner Presentation -->\n <div class=\"talos-spinner__inner\" [class.talos-spinner__inner--inline]=\"isInlineLayout()\">\n <!-- Label placed start / top -->\n @if (labelPosition() === 'top' || labelPosition() === 'start') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n\n <!-- Animated Spinner Core -->\n <ng-container *ngTemplateOutlet=\"spinnerCoreTemplate\" />\n\n <!-- Label placed end / bottom / inline -->\n @if (labelPosition() === 'bottom' || labelPosition() === 'end' || labelPosition() === 'inline') {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </div>\n\n <!-- Screen reader fallback when no visible label exists -->\n @if (!label() && !customLabel()) {\n <span class=\"sr-only\">{{ resolvedAriaLabel() }}</span>\n }\n}\n\n<!-- Reusable Spinner Core SVG / Graphics Template -->\n<ng-template #spinnerCoreTemplate>\n <div class=\"talos-spinner__graphic\" [attr.aria-hidden]=\"true\">\n @switch (type()) {\n @case ('dots') {\n <div class=\"talos-spinner__dots\">\n <span class=\"talos-spinner__dot talos-spinner__dot--1\"></span>\n <span class=\"talos-spinner__dot talos-spinner__dot--2\"></span>\n <span class=\"talos-spinner__dot talos-spinner__dot--3\"></span>\n </div>\n }\n\n @case ('ring') {\n <svg\n class=\"talos-spinner__svg talos-spinner__svg--ring\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @if (showTrack()) {\n <circle\n class=\"talos-spinner__track\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n />\n }\n <circle\n class=\"talos-spinner__ring-arc talos-spinner__ring-arc--top\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n <circle\n class=\"talos-spinner__ring-arc talos-spinner__ring-arc--bottom\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n </svg>\n }\n\n @case ('orbit') {\n <div class=\"talos-spinner__orbit\">\n <span class=\"talos-spinner__orbit-core\"></span>\n <span class=\"talos-spinner__orbit-satellite talos-spinner__orbit-satellite--1\"></span>\n <span class=\"talos-spinner__orbit-satellite talos-spinner__orbit-satellite--2\"></span>\n </div>\n }\n\n @default {\n <!-- Default circular spinner -->\n <svg\n class=\"talos-spinner__svg talos-spinner__svg--circular\"\n viewBox=\"0 0 48 48\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n @if (showTrack()) {\n <circle\n class=\"talos-spinner__track\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n />\n }\n <circle\n class=\"talos-spinner__arc\"\n cx=\"24\"\n cy=\"24\"\n [attr.r]=\"computedRadius()\"\n [attr.stroke-width]=\"computedStrokeWidth()\"\n fill=\"none\"\n stroke-linecap=\"round\"\n [attr.stroke-dasharray]=\"computedDashArray()\"\n [attr.stroke-dashoffset]=\"computedDashOffset()\"\n />\n </svg>\n }\n }\n </div>\n</ng-template>\n\n<!-- Reusable Label Template -->\n<ng-template #labelTemplate>\n @if (label() || customLabel()) {\n <div\n class=\"talos-spinner__label\"\n [class.talos-spinner__label--top]=\"labelPosition() === 'top'\"\n [class.talos-spinner__label--bottom]=\"labelPosition() === 'bottom'\"\n [class.talos-spinner__label--start]=\"labelPosition() === 'start'\"\n [class.talos-spinner__label--end]=\"labelPosition() === 'end'\"\n [class.talos-spinner__label--inline]=\"labelPosition() === 'inline'\"\n >\n @if (label()) {\n <span>{{ label() }}</span>\n }\n <ng-content select=\"[talosSpinnerLabel]\" />\n </div>\n }\n</ng-template>\n", styles: [":host{display:inline-flex;vertical-align:middle;box-sizing:border-box;--spinner-size: var(--talos-spinner-custom-size, 28px);--spinner-color: var(--talos-spinner-custom-color, var(--talos-primary-color, #2563eb));--spinner-track-color: var(--talos-spinner-custom-track, var(--talos-border-subtle, rgba(226, 232, 240, .8)));--spinner-speed: .85s}:host.talos-spinner--xs{--spinner-size: 16px}:host.talos-spinner--sm{--spinner-size: 20px}:host.talos-spinner--md{--spinner-size: 28px}:host.talos-spinner--lg{--spinner-size: 40px}:host.talos-spinner--xl{--spinner-size: 56px}:host.talos-spinner--primary{--spinner-color: var(--talos-primary-color, #2563eb);--spinner-track-color: var(--talos-primary-light, rgba(37, 99, 235, .15))}:host.talos-spinner--secondary{--spinner-color: var(--talos-secondary, #64748b);--spinner-track-color: rgba(100, 116, 139, .15)}:host.talos-spinner--success{--spinner-color: var(--talos-success-color, #16a34a);--spinner-track-color: var(--talos-success-light, rgba(22, 163, 74, .15))}:host.talos-spinner--warning{--spinner-color: var(--talos-warning-color, #d97706);--spinner-track-color: var(--talos-warning-light, rgba(217, 119, 6, .15))}:host.talos-spinner--danger,:host.talos-spinner--error{--spinner-color: var(--talos-danger-color, #dc2626);--spinner-track-color: var(--talos-danger-light, rgba(220, 38, 38, .15))}:host.talos-spinner--info{--spinner-color: var(--talos-info-color, #0284c7);--spinner-track-color: var(--talos-info-light, rgba(2, 132, 199, .15))}:host.talos-spinner--neutral{--spinner-color: var(--talos-neutral-color, #64748b);--spinner-track-color: rgba(100, 116, 139, .12)}:host.talos-spinner--subtle{--spinner-color: var(--talos-text-muted, #94a3b8);--spinner-track-color: rgba(148, 163, 184, .12)}:host.talos-spinner--outline{--spinner-color: currentColor;--spinner-track-color: transparent}:host.talos-spinner--inherit{--spinner-color: currentColor;--spinner-track-color: rgba(255, 255, 255, .2)}:host.talos-spinner--slow{--spinner-speed: 1.5s}:host.talos-spinner--fast{--spinner-speed: .5s}:host.talos-spinner-host--overlay{position:relative;display:block;width:100%}:host.talos-spinner-host--fullscreen{position:fixed;inset:0;z-index:var(--talos-z-index-modal, 9999)}.talos-spinner__inner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}.talos-spinner__inner--inline{flex-direction:row;align-items:center;gap:8px;text-align:left}.talos-spinner__graphic{position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--spinner-size);height:var(--spinner-size);flex-shrink:0}.talos-spinner__svg{width:100%;height:100%;display:block;overflow:visible}.talos-spinner__svg--circular{animation:talos-spinner-rotate var(--spinner-speed) linear infinite;transform-origin:center center}.talos-spinner__svg--circular .talos-spinner__arc{animation:talos-spinner-dash calc(var(--spinner-speed) * 1.6) ease-in-out infinite}.talos-spinner__svg--ring{animation:talos-spinner-rotate var(--spinner-speed) linear infinite;transform-origin:center center}.talos-spinner__track{stroke:var(--spinner-track-color);opacity:.85}.talos-spinner__arc{stroke:var(--spinner-color);transform-origin:center center}.talos-spinner__ring-arc{stroke:var(--spinner-color)}.talos-spinner__ring-arc--top{stroke-dasharray:28 32}.talos-spinner__ring-arc--bottom{stroke-dasharray:18 42;opacity:.65}.talos-spinner__dots{display:inline-flex;align-items:center;justify-content:center;gap:calc(var(--spinner-size) * .15);height:100%}.talos-spinner__dot{display:block;width:calc(var(--spinner-size) * .28);height:calc(var(--spinner-size) * .28);border-radius:50%;background-color:var(--spinner-color);animation:talos-spinner-dot-bounce var(--spinner-speed) ease-in-out infinite both}.talos-spinner__dot--1{animation-delay:-.32s}.talos-spinner__dot--2{animation-delay:-.16s}.talos-spinner__dot--3{animation-delay:0s}.talos-spinner__orbit{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;animation:talos-spinner-rotate var(--spinner-speed) linear infinite}.talos-spinner__orbit-core{width:calc(var(--spinner-size) * .3);height:calc(var(--spinner-size) * .3);border-radius:50%;background-color:var(--spinner-color);box-shadow:0 0 calc(var(--spinner-size) * .2) var(--spinner-color)}.talos-spinner__orbit-satellite{position:absolute;border-radius:50%;background-color:var(--spinner-color)}.talos-spinner__orbit-satellite--1{top:0;left:50%;transform:translate(-50%);width:calc(var(--spinner-size) * .22);height:calc(var(--spinner-size) * .22)}.talos-spinner__orbit-satellite--2{bottom:0;left:50%;transform:translate(-50%);width:calc(var(--spinner-size) * .16);height:calc(var(--spinner-size) * .16);opacity:.6}.talos-spinner__label{font-size:var(--talos-font-size-sm, 13px);font-weight:500;line-height:1.4;color:var(--talos-text-color, #1e293b);transition:color .2s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none}.talos-spinner__label--bottom{margin-top:2px}.talos-spinner__label--top{margin-bottom:2px}.talos-spinner__label--start{margin-right:2px}.talos-spinner__label--end,.talos-spinner__label--inline{margin-left:2px}.talos-spinner__content-slot{width:100%;transition:filter .2s cubic-bezier(.4,0,.2,1)}.talos-spinner__content-slot--blurred{filter:blur(2px);pointer-events:none;-webkit-user-select:none;user-select:none}.talos-spinner__overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;background-color:var(--talos-spinner-overlay-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:none;backdrop-filter:none;border-radius:inherit;pointer-events:auto;animation:talos-spinner-fade .2s cubic-bezier(.4,0,.2,1)}.talos-spinner__overlay--blur{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.talos-spinner__overlay--fullscreen{position:fixed;z-index:var(--talos-z-index-modal, 9999)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes talos-spinner-rotate{to{transform:rotate(360deg)}}@keyframes talos-spinner-dash{0%{stroke-dasharray:1 120;stroke-dashoffset:0}50%{stroke-dasharray:90 120;stroke-dashoffset:-35}to{stroke-dasharray:90 120;stroke-dashoffset:-124}}@keyframes talos-spinner-dot-bounce{0%,80%,to{transform:scale(.6);opacity:.4}40%{transform:scale(1);opacity:1}}@keyframes talos-spinner-fade{0%{opacity:0}to{opacity:1}}[data-theme=dark] :host,[data-mode=dark] :host,.dark :host,.dark-theme :host{--spinner-track-color: var(--talos-spinner-custom-track, rgba(255, 255, 255, .12))}[data-theme=dark] :host .talos-spinner__label,[data-mode=dark] :host .talos-spinner__label,.dark :host .talos-spinner__label,.dark-theme :host .talos-spinner__label{color:var(--talos-text-color, #f1f5f9)}[data-theme=dark] :host .talos-spinner__overlay,[data-mode=dark] :host .talos-spinner__overlay,.dark :host .talos-spinner__overlay,.dark-theme :host .talos-spinner__overlay{background-color:var(--talos-spinner-overlay-bg-dark, rgba(15, 23, 42, .72))}@media(prefers-reduced-motion:reduce){.talos-spinner__svg,.talos-spinner__svg--circular,.talos-spinner__svg--ring,.talos-spinner__orbit{animation:talos-spinner-pulse 1.8s ease-in-out infinite!important}.talos-spinner__arc{animation:none!important;stroke-dasharray:80 40!important}.talos-spinner__dot{animation:talos-spinner-pulse 1.8s ease-in-out infinite!important}@keyframes talos-spinner-pulse{0%,to{opacity:1}50%{opacity:.3}}}\n"] }]
|
|
2489
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], speed: [{ type: i0.Input, args: [{ isSignal: true, alias: "speed", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], trackColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackColor", required: false }] }], showTrack: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTrack", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPosition", required: false }] }], overlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "overlay", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], blur: [{ type: i0.Input, args: [{ isSignal: true, alias: "blur", required: false }] }], fullscreen: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullscreen", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], customLabel: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TalosSpinnerLabelDirective), { isSignal: true }] }] } });
|
|
2490
|
+
/**
|
|
2491
|
+
* Global overlay component connected to `TalosSpinnerService`.
|
|
2492
|
+
*
|
|
2493
|
+
* Can be placed in the root template (`app.component.html`) to provide a reactive,
|
|
2494
|
+
* unified full-screen loading state for all global asynchronous background processes.
|
|
2495
|
+
*
|
|
2496
|
+
* @example
|
|
2497
|
+
* ```html
|
|
2498
|
+
* <!-- In app.component.html -->
|
|
2499
|
+
* <talos-global-spinner />
|
|
2500
|
+
* ```
|
|
2501
|
+
*/
|
|
2502
|
+
class TalosGlobalSpinnerComponent {
|
|
2503
|
+
spinnerService = inject(TalosSpinnerService);
|
|
2504
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosGlobalSpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2505
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: TalosGlobalSpinnerComponent, isStandalone: true, selector: "talos-global-spinner", ngImport: i0, template: `
|
|
2506
|
+
@if (spinnerService.active()) {
|
|
2507
|
+
<div
|
|
2508
|
+
class="talos-global-spinner-backdrop"
|
|
2509
|
+
[class.talos-global-spinner-backdrop--blur]="spinnerService.blur()"
|
|
2510
|
+
role="dialog"
|
|
2511
|
+
aria-modal="true"
|
|
2512
|
+
[attr.aria-label]="spinnerService.ariaLabel()"
|
|
2513
|
+
>
|
|
2514
|
+
<talos-spinner
|
|
2515
|
+
[variant]="spinnerService.variant()"
|
|
2516
|
+
[size]="spinnerService.size()"
|
|
2517
|
+
[type]="spinnerService.type()"
|
|
2518
|
+
[label]="spinnerService.message()"
|
|
2519
|
+
labelPosition="bottom"
|
|
2520
|
+
[ariaLabel]="spinnerService.ariaLabel()"
|
|
2521
|
+
/>
|
|
2522
|
+
</div>
|
|
2523
|
+
}
|
|
2524
|
+
`, isInline: true, styles: [":host{display:contents}.talos-global-spinner-backdrop{position:fixed;inset:0;z-index:var(--talos-z-index-modal, 9999);display:flex;align-items:center;justify-content:center;background-color:var(--talos-backdrop-bg, rgba(15, 23, 42, .45));-webkit-backdrop-filter:none;backdrop-filter:none;transition:opacity .2s cubic-bezier(.4,0,.2,1);animation:talos-spinner-fade-in .2s ease-out}.talos-global-spinner-backdrop.talos-global-spinner-backdrop--blur{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}@keyframes talos-spinner-fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "component", type: TalosSpinnerComponent, selector: "talos-spinner, talos-loading-spinner, [talosSpinner], [talosLoadingSpinner]", inputs: ["variant", "size", "type", "speed", "strokeWidth", "color", "trackColor", "showTrack", "label", "labelPosition", "overlay", "loading", "blur", "fullscreen", "ariaLabel"] }] });
|
|
2525
|
+
}
|
|
2526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosGlobalSpinnerComponent, decorators: [{
|
|
2527
|
+
type: Component,
|
|
2528
|
+
args: [{ selector: 'talos-global-spinner', imports: [TalosSpinnerComponent], template: `
|
|
2529
|
+
@if (spinnerService.active()) {
|
|
2530
|
+
<div
|
|
2531
|
+
class="talos-global-spinner-backdrop"
|
|
2532
|
+
[class.talos-global-spinner-backdrop--blur]="spinnerService.blur()"
|
|
2533
|
+
role="dialog"
|
|
2534
|
+
aria-modal="true"
|
|
2535
|
+
[attr.aria-label]="spinnerService.ariaLabel()"
|
|
2536
|
+
>
|
|
2537
|
+
<talos-spinner
|
|
2538
|
+
[variant]="spinnerService.variant()"
|
|
2539
|
+
[size]="spinnerService.size()"
|
|
2540
|
+
[type]="spinnerService.type()"
|
|
2541
|
+
[label]="spinnerService.message()"
|
|
2542
|
+
labelPosition="bottom"
|
|
2543
|
+
[ariaLabel]="spinnerService.ariaLabel()"
|
|
2544
|
+
/>
|
|
2545
|
+
</div>
|
|
2546
|
+
}
|
|
2547
|
+
`, styles: [":host{display:contents}.talos-global-spinner-backdrop{position:fixed;inset:0;z-index:var(--talos-z-index-modal, 9999);display:flex;align-items:center;justify-content:center;background-color:var(--talos-backdrop-bg, rgba(15, 23, 42, .45));-webkit-backdrop-filter:none;backdrop-filter:none;transition:opacity .2s cubic-bezier(.4,0,.2,1);animation:talos-spinner-fade-in .2s ease-out}.talos-global-spinner-backdrop.talos-global-spinner-backdrop--blur{backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}@keyframes talos-spinner-fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
2548
|
+
}] });
|
|
2549
|
+
|
|
2550
|
+
/**
|
|
2551
|
+
* Structural / content directive for marking custom spinner label templates.
|
|
2552
|
+
*
|
|
2553
|
+
* @example
|
|
2554
|
+
* ```html
|
|
2555
|
+
* <talos-spinner>
|
|
2556
|
+
* <span *talosSpinnerLabel class="custom-label">
|
|
2557
|
+
* Syncing <strong>24/100</strong> files...
|
|
2558
|
+
* </span>
|
|
2559
|
+
* </talos-spinner>
|
|
2560
|
+
* ```
|
|
2561
|
+
*/
|
|
2562
|
+
class TalosSpinnerLabelDirective {
|
|
2563
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2564
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.1", type: TalosSpinnerLabelDirective, isStandalone: true, selector: "[talosSpinnerLabel]", ngImport: i0 });
|
|
2565
|
+
}
|
|
2566
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerLabelDirective, decorators: [{
|
|
2567
|
+
type: Directive,
|
|
2568
|
+
args: [{
|
|
2569
|
+
selector: '[talosSpinnerLabel]'
|
|
2570
|
+
}]
|
|
2571
|
+
}] });
|
|
2572
|
+
/**
|
|
2573
|
+
* Directive that attaches an accessible loading spinner overlay directly onto any container element
|
|
2574
|
+
* (e.g., card, panel, table, or form section).
|
|
2575
|
+
*
|
|
2576
|
+
* When active, it dims the host container, applies an optional blur effect, disables interactions,
|
|
2577
|
+
* and renders a centered spinner indicator with optional message.
|
|
2578
|
+
*
|
|
2579
|
+
* @example
|
|
2580
|
+
* ```html
|
|
2581
|
+
* <div [talosSpinnerOverlay]="isUpdating()" talosSpinnerMessage="Saving changes..." talosSpinnerVariant="primary">
|
|
2582
|
+
* <p>Card Content...</p>
|
|
2583
|
+
* </div>
|
|
2584
|
+
* ```
|
|
2585
|
+
*/
|
|
2586
|
+
class TalosSpinnerOverlayDirective {
|
|
2587
|
+
elementRef = inject(ElementRef);
|
|
2588
|
+
renderer = inject(Renderer2);
|
|
2589
|
+
appRef = inject(ApplicationRef);
|
|
2590
|
+
envInjector = inject(EnvironmentInjector);
|
|
2591
|
+
overlayElement = null;
|
|
2592
|
+
spinnerRef = null;
|
|
2593
|
+
/**
|
|
2594
|
+
* Whether the loading overlay is currently active.
|
|
2595
|
+
*/
|
|
2596
|
+
talosSpinnerOverlay = input(false, { ...(ngDevMode ? { debugName: "talosSpinnerOverlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2597
|
+
/**
|
|
2598
|
+
* Alias input `talosLoading` for concise developer ergonomics.
|
|
2599
|
+
*/
|
|
2600
|
+
talosLoading = input(false, { ...(ngDevMode ? { debugName: "talosLoading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2601
|
+
/**
|
|
2602
|
+
* Optional loading message or status string to display below the spinner.
|
|
2603
|
+
*/
|
|
2604
|
+
message = input(undefined, { ...(ngDevMode ? { debugName: "message" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerMessage' });
|
|
2605
|
+
/**
|
|
2606
|
+
* Semantic color variant for the attached spinner overlay.
|
|
2607
|
+
* @default 'primary'
|
|
2608
|
+
*/
|
|
2609
|
+
variant = input('primary', { ...(ngDevMode ? { debugName: "variant" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerVariant' });
|
|
2610
|
+
/**
|
|
2611
|
+
* Size preset for the attached spinner indicator.
|
|
2612
|
+
* @default 'md'
|
|
2613
|
+
*/
|
|
2614
|
+
size = input('md', { ...(ngDevMode ? { debugName: "size" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerSize' });
|
|
2615
|
+
/**
|
|
2616
|
+
* Animation rendering type for the attached spinner indicator.
|
|
2617
|
+
* @default 'circular'
|
|
2618
|
+
*/
|
|
2619
|
+
type = input('circular', { ...(ngDevMode ? { debugName: "type" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerType' });
|
|
2620
|
+
/**
|
|
2621
|
+
* Whether to apply a frosted glassmorphic backdrop blur effect.
|
|
2622
|
+
* @default true
|
|
2623
|
+
*/
|
|
2624
|
+
blur = input(true, { ...(ngDevMode ? { debugName: "blur" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerBlur',
|
|
2625
|
+
transform: booleanAttribute });
|
|
2626
|
+
/**
|
|
2627
|
+
* Accessible description announced by assistive technologies.
|
|
2628
|
+
*/
|
|
2629
|
+
ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'talosSpinnerAriaLabel' });
|
|
2630
|
+
constructor() {
|
|
2631
|
+
effect(() => {
|
|
2632
|
+
const active = this.isActive();
|
|
2633
|
+
if (active) {
|
|
2634
|
+
this.renderOverlay();
|
|
2635
|
+
}
|
|
2636
|
+
else {
|
|
2637
|
+
this.removeOverlay();
|
|
2638
|
+
}
|
|
2639
|
+
});
|
|
2640
|
+
}
|
|
2641
|
+
/**
|
|
2642
|
+
* Computes whether the overlay is active from either primary input or alias.
|
|
2643
|
+
*/
|
|
2644
|
+
isActive() {
|
|
2645
|
+
return this.talosSpinnerOverlay() || this.talosLoading();
|
|
2646
|
+
}
|
|
2647
|
+
renderOverlay() {
|
|
2648
|
+
if (!this.overlayElement) {
|
|
2649
|
+
this.overlayElement = this.renderer.createElement('div');
|
|
2650
|
+
this.renderer.addClass(this.overlayElement, 'talos-spinner-overlay');
|
|
2651
|
+
if (this.blur()) {
|
|
2652
|
+
this.renderer.addClass(this.overlayElement, 'talos-spinner-overlay--blur');
|
|
2653
|
+
}
|
|
2654
|
+
this.renderer.setAttribute(this.overlayElement, 'role', 'status');
|
|
2655
|
+
this.renderer.setAttribute(this.overlayElement, 'aria-live', 'polite');
|
|
2656
|
+
const label = this.ariaLabel() || this.message() || 'Loading, please wait...';
|
|
2657
|
+
this.renderer.setAttribute(this.overlayElement, 'aria-label', label);
|
|
2658
|
+
// Create component instance
|
|
2659
|
+
this.spinnerRef = createComponent(TalosSpinnerComponent, {
|
|
2660
|
+
environmentInjector: this.envInjector
|
|
2661
|
+
});
|
|
2662
|
+
this.updateSpinnerInputs();
|
|
2663
|
+
this.appRef.attachView(this.spinnerRef.hostView);
|
|
2664
|
+
this.renderer.appendChild(this.overlayElement, this.spinnerRef.location.nativeElement);
|
|
2665
|
+
this.renderer.appendChild(this.elementRef.nativeElement, this.overlayElement);
|
|
2666
|
+
}
|
|
2667
|
+
else {
|
|
2668
|
+
if (this.blur()) {
|
|
2669
|
+
this.renderer.addClass(this.overlayElement, 'talos-spinner-overlay--blur');
|
|
2670
|
+
}
|
|
2671
|
+
else {
|
|
2672
|
+
this.renderer.removeClass(this.overlayElement, 'talos-spinner-overlay--blur');
|
|
2673
|
+
}
|
|
2674
|
+
this.updateSpinnerInputs();
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
updateSpinnerInputs() {
|
|
2678
|
+
if (!this.spinnerRef)
|
|
2679
|
+
return;
|
|
2680
|
+
this.spinnerRef.setInput('variant', this.variant());
|
|
2681
|
+
this.spinnerRef.setInput('size', this.size());
|
|
2682
|
+
this.spinnerRef.setInput('type', this.type());
|
|
2683
|
+
this.spinnerRef.setInput('label', this.message());
|
|
2684
|
+
this.spinnerRef.setInput('labelPosition', 'bottom');
|
|
2685
|
+
if (this.ariaLabel()) {
|
|
2686
|
+
this.spinnerRef.setInput('ariaLabel', this.ariaLabel());
|
|
2687
|
+
}
|
|
2688
|
+
this.spinnerRef.changeDetectorRef.detectChanges();
|
|
2689
|
+
}
|
|
2690
|
+
removeOverlay() {
|
|
2691
|
+
if (this.spinnerRef) {
|
|
2692
|
+
this.appRef.detachView(this.spinnerRef.hostView);
|
|
2693
|
+
this.spinnerRef.destroy();
|
|
2694
|
+
this.spinnerRef = null;
|
|
2695
|
+
}
|
|
2696
|
+
if (this.overlayElement && this.overlayElement.parentNode) {
|
|
2697
|
+
this.renderer.removeChild(this.overlayElement.parentNode, this.overlayElement);
|
|
2698
|
+
this.overlayElement = null;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
ngOnDestroy() {
|
|
2702
|
+
this.removeOverlay();
|
|
2703
|
+
}
|
|
2704
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerOverlayDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2705
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosSpinnerOverlayDirective, isStandalone: true, selector: "[talosSpinnerOverlay], [talosLoading]", inputs: { talosSpinnerOverlay: { classPropertyName: "talosSpinnerOverlay", publicName: "talosSpinnerOverlay", isSignal: true, isRequired: false, transformFunction: null }, talosLoading: { classPropertyName: "talosLoading", publicName: "talosLoading", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "talosSpinnerMessage", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "talosSpinnerVariant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "talosSpinnerSize", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "talosSpinnerType", isSignal: true, isRequired: false, transformFunction: null }, blur: { classPropertyName: "blur", publicName: "talosSpinnerBlur", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "talosSpinnerAriaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.talos-spinner-overlay-host--active": "isActive()", "class.talos-spinner-overlay-host--blur": "isActive() && blur()", "attr.aria-busy": "isActive() ? \"true\" : null" }, classAttribute: "talos-spinner-overlay-host" }, ngImport: i0 });
|
|
2706
|
+
}
|
|
2707
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerOverlayDirective, decorators: [{
|
|
2708
|
+
type: Directive,
|
|
2709
|
+
args: [{
|
|
2710
|
+
selector: '[talosSpinnerOverlay], [talosLoading]',
|
|
2711
|
+
host: {
|
|
2712
|
+
'class': 'talos-spinner-overlay-host',
|
|
2713
|
+
'[class.talos-spinner-overlay-host--active]': 'isActive()',
|
|
2714
|
+
'[class.talos-spinner-overlay-host--blur]': 'isActive() && blur()',
|
|
2715
|
+
'[attr.aria-busy]': 'isActive() ? "true" : null'
|
|
2716
|
+
}
|
|
2717
|
+
}]
|
|
2718
|
+
}], ctorParameters: () => [], propDecorators: { talosSpinnerOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerOverlay", required: false }] }], talosLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosLoading", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerMessage", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerVariant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerSize", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerType", required: false }] }], blur: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerBlur", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosSpinnerAriaLabel", required: false }] }] } });
|
|
2719
|
+
|
|
2720
|
+
const SPINNER_DECLARATIONS = [
|
|
2721
|
+
TalosSpinnerComponent,
|
|
2722
|
+
TalosGlobalSpinnerComponent,
|
|
2723
|
+
TalosSpinnerLabelDirective,
|
|
2724
|
+
TalosSpinnerOverlayDirective
|
|
2725
|
+
];
|
|
2726
|
+
class TalosSpinnerModule {
|
|
2727
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2728
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerModule, imports: [TalosSpinnerComponent,
|
|
2729
|
+
TalosGlobalSpinnerComponent,
|
|
2730
|
+
TalosSpinnerLabelDirective,
|
|
2731
|
+
TalosSpinnerOverlayDirective], exports: [TalosSpinnerComponent,
|
|
2732
|
+
TalosGlobalSpinnerComponent,
|
|
2733
|
+
TalosSpinnerLabelDirective,
|
|
2734
|
+
TalosSpinnerOverlayDirective] });
|
|
2735
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerModule });
|
|
2736
|
+
}
|
|
2737
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosSpinnerModule, decorators: [{
|
|
2738
|
+
type: NgModule,
|
|
2739
|
+
args: [{
|
|
2740
|
+
imports: [...SPINNER_DECLARATIONS],
|
|
2741
|
+
exports: [...SPINNER_DECLARATIONS]
|
|
2742
|
+
}]
|
|
2743
|
+
}] });
|
|
2744
|
+
|
|
2745
|
+
class TalosTooltipComponent {
|
|
2746
|
+
text = input('', /* @ts-ignore */
|
|
2747
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
2748
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2749
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.1", type: TalosTooltipComponent, isStandalone: true, selector: "talos-tooltip-content", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "tooltip" }, classAttribute: "talos-tooltip-panel" }, ngImport: i0, template: `<div class="talos-tooltip-inner">{{ text() }}</div>`, isInline: true });
|
|
2750
|
+
}
|
|
2751
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosTooltipComponent, decorators: [{
|
|
2752
|
+
type: Component,
|
|
2753
|
+
args: [{
|
|
2754
|
+
selector: 'talos-tooltip-content',
|
|
2755
|
+
template: `<div class="talos-tooltip-inner">{{ text() }}</div>`,
|
|
2756
|
+
host: {
|
|
2757
|
+
'class': 'talos-tooltip-panel',
|
|
2758
|
+
'role': 'tooltip'
|
|
2759
|
+
}
|
|
2760
|
+
}]
|
|
2761
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
2762
|
+
class TalosTooltipDirective {
|
|
2763
|
+
elementRef = inject(ElementRef);
|
|
2764
|
+
overlay = inject(Overlay);
|
|
2765
|
+
destroyRef = inject(DestroyRef);
|
|
2766
|
+
injector = inject(Injector);
|
|
2767
|
+
focusMonitor = inject(FocusMonitor);
|
|
2768
|
+
tooltip = input('', { ...(ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {}), alias: 'talosTooltip' });
|
|
2769
|
+
tooltipContent = input('', { ...(ngDevMode ? { debugName: "tooltipContent" } : /* istanbul ignore next */ {}), alias: 'tooltip' });
|
|
2770
|
+
position = input('top', { ...(ngDevMode ? { debugName: "position" } : /* istanbul ignore next */ {}), alias: 'tooltipPosition' });
|
|
2771
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), alias: 'tooltipDisabled' });
|
|
2772
|
+
overlayRef = null;
|
|
2773
|
+
ngOnInit() {
|
|
2774
|
+
this.focusMonitor.monitor(this.elementRef).subscribe((origin) => {
|
|
2775
|
+
if (origin === 'keyboard') {
|
|
2776
|
+
this.show();
|
|
2777
|
+
}
|
|
2778
|
+
else if (!origin) {
|
|
2779
|
+
this.hide();
|
|
2780
|
+
}
|
|
2781
|
+
});
|
|
2782
|
+
this.destroyRef.onDestroy(() => {
|
|
2783
|
+
this.focusMonitor.stopMonitoring(this.elementRef);
|
|
2784
|
+
this.hide();
|
|
2785
|
+
});
|
|
2786
|
+
}
|
|
2787
|
+
get tooltipText() {
|
|
2788
|
+
return this.tooltip() || this.tooltipContent() || '';
|
|
2789
|
+
}
|
|
2790
|
+
show() {
|
|
2791
|
+
if (this.disabled() || !this.tooltipText || this.overlayRef?.hasAttached()) {
|
|
2792
|
+
return;
|
|
2793
|
+
}
|
|
2794
|
+
const positionStrategy = this.createPositionStrategy();
|
|
2795
|
+
this.overlayRef = this.overlay.create({
|
|
2796
|
+
positionStrategy,
|
|
2797
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
2798
|
+
hasBackdrop: false
|
|
2799
|
+
});
|
|
2800
|
+
const portal = new ComponentPortal(TalosTooltipComponent, null, this.injector);
|
|
2801
|
+
const componentRef = this.overlayRef.attach(portal);
|
|
2802
|
+
componentRef.setInput('text', this.tooltipText);
|
|
2803
|
+
}
|
|
2804
|
+
hide() {
|
|
2805
|
+
if (this.overlayRef) {
|
|
2806
|
+
this.overlayRef.dispose();
|
|
2807
|
+
this.overlayRef = null;
|
|
2808
|
+
}
|
|
2809
|
+
}
|
|
2810
|
+
createPositionStrategy() {
|
|
2811
|
+
const pos = this.position();
|
|
2812
|
+
const strategy = this.overlay
|
|
2813
|
+
.position()
|
|
2814
|
+
.flexibleConnectedTo(this.elementRef)
|
|
2815
|
+
.withFlexibleDimensions(false)
|
|
2816
|
+
.withPush(false);
|
|
2817
|
+
const positions = {
|
|
2818
|
+
top: {
|
|
2819
|
+
originX: 'center',
|
|
2820
|
+
originY: 'top',
|
|
2821
|
+
overlayX: 'center',
|
|
2822
|
+
overlayY: 'bottom',
|
|
2823
|
+
offsetY: -8
|
|
2824
|
+
},
|
|
2825
|
+
bottom: {
|
|
2826
|
+
originX: 'center',
|
|
2827
|
+
originY: 'bottom',
|
|
2828
|
+
overlayX: 'center',
|
|
2829
|
+
overlayY: 'top',
|
|
2830
|
+
offsetY: 8
|
|
2831
|
+
},
|
|
2832
|
+
left: {
|
|
2833
|
+
originX: 'start',
|
|
2834
|
+
originY: 'center',
|
|
2835
|
+
overlayX: 'end',
|
|
2836
|
+
overlayY: 'center',
|
|
2837
|
+
offsetX: -8
|
|
2838
|
+
},
|
|
2839
|
+
right: {
|
|
2840
|
+
originX: 'end',
|
|
2841
|
+
originY: 'center',
|
|
2842
|
+
overlayX: 'start',
|
|
2843
|
+
overlayY: 'center',
|
|
2844
|
+
offsetX: 8
|
|
2845
|
+
}
|
|
2846
|
+
};
|
|
2847
|
+
if (pos === 'top') {
|
|
2848
|
+
strategy.withPositions([positions.top, positions.bottom, positions.left, positions.right]);
|
|
2849
|
+
}
|
|
2850
|
+
else if (pos === 'bottom') {
|
|
2851
|
+
strategy.withPositions([positions.bottom, positions.top, positions.left, positions.right]);
|
|
2852
|
+
}
|
|
2853
|
+
else if (pos === 'left') {
|
|
2854
|
+
strategy.withPositions([positions.left, positions.right, positions.top, positions.bottom]);
|
|
2855
|
+
}
|
|
2856
|
+
else if (pos === 'right') {
|
|
2857
|
+
strategy.withPositions([positions.right, positions.left, positions.top, positions.bottom]);
|
|
2858
|
+
}
|
|
2859
|
+
else {
|
|
2860
|
+
strategy.withPositions([positions.top, positions.bottom, positions.right, positions.left]);
|
|
2861
|
+
}
|
|
2862
|
+
return strategy;
|
|
2863
|
+
}
|
|
2864
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2865
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.1", type: TalosTooltipDirective, isStandalone: true, selector: "[talosTooltip], [tooltip]", inputs: { tooltip: { classPropertyName: "tooltip", publicName: "talosTooltip", isSignal: true, isRequired: false, transformFunction: null }, tooltipContent: { classPropertyName: "tooltipContent", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "tooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "tooltipDisabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()", "click": "hide()", "keydown.escape": "hide()" } }, ngImport: i0 });
|
|
2866
|
+
}
|
|
2867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: TalosTooltipDirective, decorators: [{
|
|
2868
|
+
type: Directive,
|
|
2869
|
+
args: [{
|
|
2870
|
+
selector: '[talosTooltip], [tooltip]',
|
|
2871
|
+
host: {
|
|
2872
|
+
'(mouseenter)': 'show()',
|
|
2873
|
+
'(mouseleave)': 'hide()',
|
|
2874
|
+
'(click)': 'hide()',
|
|
2875
|
+
'(keydown.escape)': 'hide()'
|
|
2876
|
+
}
|
|
2877
|
+
}]
|
|
2878
|
+
}], propDecorators: { tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "talosTooltip", required: false }] }], tooltipContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipPosition", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipDisabled", required: false }] }] } });
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* Generated bundle index. Do not edit.
|
|
2882
|
+
*/
|
|
2883
|
+
|
|
2884
|
+
export { SPINNER_SIZE_MAP, SPINNER_STROKE_MAP, TALOS_DIALOG_CONFIG, TALOS_DIALOG_DATA, TALOS_DIALOG_REF, TalosAlertActionsDirective, TalosAlertComponent, TalosAlertContainerComponent, TalosAlertDescriptionDirective, TalosAlertIconDirective, TalosAlertModule, TalosAlertService, TalosAlertTitleDirective, TalosConfirmDialogComponent, TalosDialogCloseDirective, TalosDialogContentComponent, TalosDialogDescriptionDirective, TalosDialogFooterComponent, TalosDialogHeaderComponent, TalosDialogModule, TalosDialogRef, TalosDialogService, TalosDialogTitleDirective, TalosGlobalSpinnerComponent, TalosProgressBarComponent, TalosProgressBarModule, TalosProgressHintDirective, TalosProgressLabelDirective, TalosProgressValueDirective, TalosSkeletonComponent, TalosSkeletonDirective, TalosSkeletonModule, TalosSnackbarComponent, TalosSnackbarContainerComponent, TalosSnackbarModule, TalosSnackbarService, TalosSpinnerComponent, TalosSpinnerLabelDirective, TalosSpinnerModule, TalosSpinnerOverlayDirective, TalosSpinnerService, TalosTooltipComponent, TalosTooltipDirective, calculatePercentage, clampProgress, resolveCssDimension, resolveNumericSize, resolveProgressDimension, resolveSpinnerDimension };
|
|
2885
|
+
//# sourceMappingURL=weeehaoooz-talos-ui-feedback.mjs.map
|