@acontplus/ng-components 2.1.15 → 2.1.16
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.
|
@@ -1823,7 +1823,6 @@ class AlertDialogService {
|
|
|
1823
1823
|
animation: 'fade',
|
|
1824
1824
|
animationDuration: 300,
|
|
1825
1825
|
toastMode: false,
|
|
1826
|
-
toastPosition: 'top-right',
|
|
1827
1826
|
autoClose: true,
|
|
1828
1827
|
progressBar: true,
|
|
1829
1828
|
};
|
|
@@ -1881,7 +1880,10 @@ class AlertDialogService {
|
|
|
1881
1880
|
mergedOptions.showConfirmButton = mergedOptions.showConfirmButton ?? false;
|
|
1882
1881
|
mergedOptions.timer = mergedOptions.timer || 4000;
|
|
1883
1882
|
mergedOptions.timerProgressBar = mergedOptions.progressBar ?? true;
|
|
1884
|
-
|
|
1883
|
+
// Si no se especificó position, usar por defecto para toasts
|
|
1884
|
+
if (!mergedOptions.position) {
|
|
1885
|
+
mergedOptions.position = 'top-end'; // Por defecto top-right para toasts
|
|
1886
|
+
}
|
|
1885
1887
|
mergedOptions.disableClose = false;
|
|
1886
1888
|
mergedOptions.animation = mergedOptions.animation || 'slide';
|
|
1887
1889
|
mergedOptions.dialogType = 'toast'; // Los toasts usan el z-index más alto
|
|
@@ -1893,9 +1895,7 @@ class AlertDialogService {
|
|
|
1893
1895
|
// Determinar el tipo de diálogo para z-index
|
|
1894
1896
|
const dialogType = mergedOptions.dialogType || (mergedOptions.toastMode ? 'toast' : 'alert');
|
|
1895
1897
|
// Calcular posición del diálogo
|
|
1896
|
-
const position = mergedOptions.
|
|
1897
|
-
? this.getToastDialogPosition(mergedOptions.toastPosition || 'top-right')
|
|
1898
|
-
: this.getDialogPosition(mergedOptions.position || 'center');
|
|
1898
|
+
const position = this.getDialogPosition(mergedOptions.position || 'center');
|
|
1899
1899
|
const dialogRef = this.dialog.open(AlertDialog, {
|
|
1900
1900
|
width: mergedOptions.width,
|
|
1901
1901
|
minWidth: mergedOptions.minWidth,
|
|
@@ -2058,20 +2058,22 @@ class AlertDialogService {
|
|
|
2058
2058
|
toast(options) {
|
|
2059
2059
|
const opts = typeof options === 'string' ? { message: options } : options;
|
|
2060
2060
|
return this.fire({
|
|
2061
|
+
// Valores por defecto que pueden ser sobrescritos
|
|
2061
2062
|
timer: 3000,
|
|
2062
2063
|
showConfirmButton: false,
|
|
2063
|
-
position: 'bottom-start',
|
|
2064
|
+
position: 'bottom-start', // Valor por defecto
|
|
2064
2065
|
width: '350px',
|
|
2065
2066
|
toastMode: true,
|
|
2066
2067
|
dialogType: 'toast',
|
|
2067
|
-
forceToTop: false,
|
|
2068
|
-
allowMultiple: true,
|
|
2069
|
-
disableClose: true,
|
|
2070
|
-
closeOnBackdropClick: false,
|
|
2071
|
-
allowEscapeKey: false,
|
|
2072
|
-
allowEnterKey: false,
|
|
2068
|
+
forceToTop: false,
|
|
2069
|
+
allowMultiple: true,
|
|
2070
|
+
disableClose: true,
|
|
2071
|
+
closeOnBackdropClick: false,
|
|
2072
|
+
allowEscapeKey: false,
|
|
2073
|
+
allowEnterKey: false,
|
|
2073
2074
|
autoClose: true,
|
|
2074
2075
|
progressBar: true,
|
|
2076
|
+
// Los valores del usuario sobrescriben los por defecto
|
|
2075
2077
|
...opts,
|
|
2076
2078
|
});
|
|
2077
2079
|
}
|
|
@@ -2161,28 +2163,6 @@ class AlertDialogService {
|
|
|
2161
2163
|
}
|
|
2162
2164
|
return classes;
|
|
2163
2165
|
}
|
|
2164
|
-
getToastPosition(position) {
|
|
2165
|
-
const positionMap = {
|
|
2166
|
-
'top-right': 'top-end',
|
|
2167
|
-
'top-left': 'top-start',
|
|
2168
|
-
'bottom-right': 'bottom-end',
|
|
2169
|
-
'bottom-left': 'bottom-start',
|
|
2170
|
-
'top-center': 'top',
|
|
2171
|
-
'bottom-center': 'bottom',
|
|
2172
|
-
};
|
|
2173
|
-
return positionMap[position] || 'top-end';
|
|
2174
|
-
}
|
|
2175
|
-
getToastDialogPosition(position) {
|
|
2176
|
-
const positions = {
|
|
2177
|
-
'top-right': { top: '20px', right: '20px' },
|
|
2178
|
-
'top-left': { top: '20px', left: '20px' },
|
|
2179
|
-
'bottom-right': { bottom: '20px', right: '20px' },
|
|
2180
|
-
'bottom-left': { bottom: '20px', left: '20px' },
|
|
2181
|
-
'top-center': { top: '20px' },
|
|
2182
|
-
'bottom-center': { bottom: '20px' },
|
|
2183
|
-
};
|
|
2184
|
-
return positions[position] || positions['top-right'];
|
|
2185
|
-
}
|
|
2186
2166
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2187
2167
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertDialogService, providedIn: 'root' });
|
|
2188
2168
|
}
|