layout-tsi 0.0.1
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 +63 -0
- package/fesm2022/layout-tsi.mjs +1733 -0
- package/fesm2022/layout-tsi.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/models/general/app-tab.model.d.ts +9 -0
- package/lib/models/general/dashboard.model.d.ts +15 -0
- package/lib/models/general/route-info.model.d.ts +16 -0
- package/lib/models/general/session-data.model.d.ts +8 -0
- package/lib/service/detector.service.d.ts +8 -0
- package/lib/service/header-ui.service.d.ts +9 -0
- package/lib/service/menu.service.d.ts +8 -0
- package/lib/service/tabs.service.d.ts +36 -0
- package/lib/ui/bottom-navigation/bottom-navigation.component.d.ts +31 -0
- package/lib/ui/chatbot/chatbot.component.d.ts +30 -0
- package/lib/ui/chatbot/chatbot.model.d.ts +28 -0
- package/lib/ui/chatbot/chatbot.service.d.ts +19 -0
- package/lib/ui/dashboard/dashboard-chart-bars/dashboard-chart-bars.component.d.ts +45 -0
- package/lib/ui/dashboard/dashboard-chart-donut/dashboard-chart-donut.component.d.ts +21 -0
- package/lib/ui/dashboard/dashboard-view-switcher/dashboard-view-switcher.component.d.ts +14 -0
- package/lib/ui/dashboard/item-dashboard/item-dashboard.component.d.ts +26 -0
- package/lib/ui/dashboard/item-dashboard-group/item-dashboard-group.component.d.ts +28 -0
- package/lib/ui/full/full.component.d.ts +48 -0
- package/lib/ui/menu-item/menu-item.component.d.ts +70 -0
- package/lib/ui/not-found/not-found.component.d.ts +7 -0
- package/lib/ui/tab-bar/tab-bar.component.d.ts +23 -0
- package/lib/ui/vertical-header/vertical-header.component.d.ts +95 -0
- package/lib/utils/validaciones.d.ts +1 -0
- package/package.json +24 -0
- package/public-api.d.ts +21 -0
|
@@ -0,0 +1,1733 @@
|
|
|
1
|
+
import * as i1 from '@angular/common';
|
|
2
|
+
import { NgClass, CommonModule, Location, NgStyle, KeyValuePipe, DecimalPipe } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { signal, Injectable, InjectionToken, inject, DestroyRef, Injector, computed, effect, input, ChangeDetectionStrategy, Component, output, HostListener, NgZone, ViewChild, reflectComponentType, ContentChild, viewChild } from '@angular/core';
|
|
5
|
+
import * as i2 from '@angular/router';
|
|
6
|
+
import { Router, NavigationEnd, RouterLink, ChildrenOutletContexts, RouterModule } from '@angular/router';
|
|
7
|
+
import { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
8
|
+
import { Subject, combineLatest, EMPTY, filter as filter$1, map as map$1, startWith } from 'rxjs';
|
|
9
|
+
import { filter, takeUntil, skip, debounceTime, map, distinctUntilChanged, switchMap, catchError } from 'rxjs/operators';
|
|
10
|
+
|
|
11
|
+
class MenuService {
|
|
12
|
+
_openMenus = signal(new Map());
|
|
13
|
+
openMenus = this._openMenus.asReadonly();
|
|
14
|
+
setOpenMenu(level, id) {
|
|
15
|
+
const currentMap = new Map(this._openMenus());
|
|
16
|
+
if (id == null) {
|
|
17
|
+
currentMap.delete(level);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
currentMap.set(level, id);
|
|
21
|
+
}
|
|
22
|
+
this._openMenus.set(currentMap);
|
|
23
|
+
}
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MenuService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MenuService, providedIn: 'root' });
|
|
26
|
+
}
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MenuService, decorators: [{
|
|
28
|
+
type: Injectable,
|
|
29
|
+
args: [{
|
|
30
|
+
providedIn: 'root'
|
|
31
|
+
}]
|
|
32
|
+
}] });
|
|
33
|
+
|
|
34
|
+
class HeaderUiService {
|
|
35
|
+
typeDocumento = signal(null);
|
|
36
|
+
numintDocumento = signal(null);
|
|
37
|
+
setTypeDocumento(value) {
|
|
38
|
+
this.typeDocumento.set(value);
|
|
39
|
+
}
|
|
40
|
+
setNumintDocumento(value) {
|
|
41
|
+
this.numintDocumento.set(value);
|
|
42
|
+
}
|
|
43
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderUiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
44
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderUiService, providedIn: 'root' });
|
|
45
|
+
}
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: HeaderUiService, decorators: [{
|
|
47
|
+
type: Injectable,
|
|
48
|
+
args: [{
|
|
49
|
+
providedIn: 'root'
|
|
50
|
+
}]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
function validaArray(data) {
|
|
54
|
+
return Array.isArray(data) && data.length > 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Provider opcional: sin él, TabsService funciona solo con localStorage (sin sincronizar con backend).
|
|
58
|
+
const TABS_SYNC_PROVIDER = new InjectionToken('TABS_SYNC_PROVIDER');
|
|
59
|
+
const STORAGE_KEY = 'tsi_quick_tabs';
|
|
60
|
+
class TabsService {
|
|
61
|
+
router = inject(Router);
|
|
62
|
+
syncProvider = inject(TABS_SYNC_PROVIDER, { optional: true });
|
|
63
|
+
destroyRef = inject(DestroyRef);
|
|
64
|
+
injector = inject(Injector);
|
|
65
|
+
tabs = signal([]);
|
|
66
|
+
activeId = signal(null);
|
|
67
|
+
visible = signal(true);
|
|
68
|
+
// Corta la carga/sincronización en curso cuando clear() destruye la sesión (logout).
|
|
69
|
+
destroy$ = new Subject();
|
|
70
|
+
sortedTabs = computed(() => {
|
|
71
|
+
const ts = this.tabs();
|
|
72
|
+
return [...ts.filter(t => t.pinned), ...ts.filter(t => !t.pinned)];
|
|
73
|
+
});
|
|
74
|
+
toggleVisible() { this.visible.update(v => !v); }
|
|
75
|
+
constructor() {
|
|
76
|
+
this.loadFromStorage();
|
|
77
|
+
// Guardado inmediato en localStorage en cada cambio
|
|
78
|
+
effect(() => {
|
|
79
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify({
|
|
80
|
+
tabs: this.tabs(),
|
|
81
|
+
visible: this.visible()
|
|
82
|
+
}));
|
|
83
|
+
});
|
|
84
|
+
this.router.events.pipe(filter((e) => e instanceof NavigationEnd), takeUntilDestroyed()).subscribe(e => {
|
|
85
|
+
const path = e.urlAfterRedirects.split('?')[0];
|
|
86
|
+
const tab = this.tabs().find(t => t.path === path);
|
|
87
|
+
if (tab)
|
|
88
|
+
this.activeId.set(tab.id);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// Al ser un servicio singleton (providedIn: 'root'), el constructor sólo se ejecuta
|
|
92
|
+
// una vez por carga de la app. Por eso la carga inicial se expone como init(): debe
|
|
93
|
+
// invocarse en cada inicio de sesión (ver FullComponent) para que, tras un clear()
|
|
94
|
+
// por logout, el siguiente login vuelva a consultar la API y arme sus accesos.
|
|
95
|
+
init() {
|
|
96
|
+
if (!this.syncProvider)
|
|
97
|
+
return;
|
|
98
|
+
this.syncProvider.getAccess().pipe(takeUntil(this.destroy$), takeUntilDestroyed(this.destroyRef)).subscribe({
|
|
99
|
+
next: res => {
|
|
100
|
+
this.parseData(res.message);
|
|
101
|
+
this.startApiSync();
|
|
102
|
+
},
|
|
103
|
+
error: () => this.startApiSync()
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Arranca DESPUÉS de la carga inicial: skip(1) omite el valor actual
|
|
107
|
+
// (recién cargado desde API) y sólo reacciona a cambios del usuario.
|
|
108
|
+
startApiSync() {
|
|
109
|
+
if (!this.syncProvider)
|
|
110
|
+
return;
|
|
111
|
+
combineLatest([
|
|
112
|
+
toObservable(this.tabs, { injector: this.injector }),
|
|
113
|
+
toObservable(this.visible, { injector: this.injector })
|
|
114
|
+
]).pipe(skip(1), debounceTime(1500), map(([tabs, visible]) => JSON.stringify({ tabs, visible })), distinctUntilChanged(), switchMap(payload => this.syncProvider.saveAccess(payload).pipe(catchError(() => EMPTY))), takeUntil(this.destroy$), takeUntilDestroyed(this.destroyRef)).subscribe();
|
|
115
|
+
}
|
|
116
|
+
parseData(raw) {
|
|
117
|
+
const data = JSON.parse(raw);
|
|
118
|
+
if (validaArray(data.tabs))
|
|
119
|
+
this.tabs.set(data.tabs);
|
|
120
|
+
if (typeof data.visible === 'boolean')
|
|
121
|
+
this.visible.set(data.visible);
|
|
122
|
+
}
|
|
123
|
+
loadFromStorage() {
|
|
124
|
+
try {
|
|
125
|
+
const raw = localStorage.getItem(STORAGE_KEY);
|
|
126
|
+
if (!raw)
|
|
127
|
+
return;
|
|
128
|
+
this.parseData(raw);
|
|
129
|
+
}
|
|
130
|
+
catch { }
|
|
131
|
+
}
|
|
132
|
+
clear() {
|
|
133
|
+
this.destroy$.next();
|
|
134
|
+
this.tabs.set([]);
|
|
135
|
+
this.activeId.set(null);
|
|
136
|
+
this.visible.set(true);
|
|
137
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
138
|
+
}
|
|
139
|
+
addBackground(path, title, icon, module, moduleKey) {
|
|
140
|
+
if (this.tabs().some(t => t.path === path))
|
|
141
|
+
return;
|
|
142
|
+
this.tabs.update(ts => [...ts, { id: path, path, title, icon, pinned: false, module, moduleKey }]);
|
|
143
|
+
if (!this.visible())
|
|
144
|
+
this.visible.set(true);
|
|
145
|
+
}
|
|
146
|
+
activate(id) {
|
|
147
|
+
this.activeId.set(id);
|
|
148
|
+
const tab = this.tabs().find(t => t.id === id);
|
|
149
|
+
if (tab)
|
|
150
|
+
this.router.navigate([tab.path]);
|
|
151
|
+
}
|
|
152
|
+
close(id, event) {
|
|
153
|
+
event.stopPropagation();
|
|
154
|
+
const tabs = this.tabs();
|
|
155
|
+
const tab = tabs.find(t => t.id === id);
|
|
156
|
+
if (!tab || tab.pinned)
|
|
157
|
+
return;
|
|
158
|
+
const idx = tabs.findIndex(t => t.id === id);
|
|
159
|
+
const newTabs = tabs.filter(t => t.id !== id);
|
|
160
|
+
this.tabs.set(newTabs);
|
|
161
|
+
if (this.activeId() === id) {
|
|
162
|
+
const next = newTabs[idx] ?? newTabs[idx - 1] ?? null;
|
|
163
|
+
if (next)
|
|
164
|
+
this.activate(next.id);
|
|
165
|
+
else
|
|
166
|
+
this.activeId.set(null);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
closeAll() {
|
|
170
|
+
const pinned = this.tabs().filter(t => t.pinned);
|
|
171
|
+
this.tabs.set(pinned);
|
|
172
|
+
const active = pinned.find(t => t.id === this.activeId());
|
|
173
|
+
if (!active) {
|
|
174
|
+
const last = pinned[pinned.length - 1] ?? null;
|
|
175
|
+
if (last)
|
|
176
|
+
this.activate(last.id);
|
|
177
|
+
else
|
|
178
|
+
this.activeId.set(null);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
togglePin(id, event) {
|
|
182
|
+
event.stopPropagation();
|
|
183
|
+
this.tabs.update(ts => ts.map(t => t.id === id ? { ...t, pinned: !t.pinned } : t));
|
|
184
|
+
}
|
|
185
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TabsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
186
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TabsService, providedIn: 'root' });
|
|
187
|
+
}
|
|
188
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TabsService, decorators: [{
|
|
189
|
+
type: Injectable,
|
|
190
|
+
args: [{ providedIn: 'root' }]
|
|
191
|
+
}], ctorParameters: () => [] });
|
|
192
|
+
|
|
193
|
+
const activeFlyoutKey = signal(null);
|
|
194
|
+
const activeTooltip = signal(null);
|
|
195
|
+
const EXTRALINK_OPENER = new InjectionToken('EXTRALINK_OPENER');
|
|
196
|
+
class MenuItemComponent {
|
|
197
|
+
menuService = inject(MenuService);
|
|
198
|
+
headerUiService = inject(HeaderUiService);
|
|
199
|
+
tabsService = inject(TabsService);
|
|
200
|
+
router = inject(Router);
|
|
201
|
+
extralinkOpener = inject(EXTRALINK_OPENER, { optional: true });
|
|
202
|
+
item = input.required();
|
|
203
|
+
isSidebarOpen = input(true);
|
|
204
|
+
isSidebarHovering = input(false);
|
|
205
|
+
level = input(0);
|
|
206
|
+
parentModuleName = input(null);
|
|
207
|
+
accentColor = input('#398bf7');
|
|
208
|
+
// Accesos/rol de la sesión: se reciben del consumidor (en vez de inyectar
|
|
209
|
+
// SesionService acá) para que layout-tsi no dependa de core-tsi.
|
|
210
|
+
accesos = input([]);
|
|
211
|
+
rolId = input(null);
|
|
212
|
+
open = signal(false);
|
|
213
|
+
flyoutY = signal(0);
|
|
214
|
+
expandedFlyoutChild = signal(null);
|
|
215
|
+
flyoutTimer = null;
|
|
216
|
+
tooltip = activeTooltip;
|
|
217
|
+
showFlyout = computed(() => activeFlyoutKey() === this.getFlyoutKey() && this.isSidebarOpen() && window.innerWidth > 1191);
|
|
218
|
+
// El cierre tenía un delay de 80ms (debounce de onItemMouseLeave/onFlyoutMouseLeave)
|
|
219
|
+
// seguido de un @if que lo desmontaba en seco, sin animación — eso es lo que se
|
|
220
|
+
// sentía como "lag" (una pausa y después un salto). Ahora se anima la salida y
|
|
221
|
+
// recién se desmonta cuando esa animación termina.
|
|
222
|
+
flyoutRendered = signal(false);
|
|
223
|
+
flyoutExitTimer = null;
|
|
224
|
+
currentUrl = toSignal(this.router.events.pipe(filter$1((e) => e instanceof NavigationEnd), map$1(() => this.router.url), startWith(this.router.url)), { initialValue: this.router.url });
|
|
225
|
+
// Una ruta con query param "project" (p. ej. tareas de un proyecto específico)
|
|
226
|
+
// no debe resaltar el item de menú general de esa misma ruta, porque confunde.
|
|
227
|
+
esRutaActiva(path) {
|
|
228
|
+
if (!path)
|
|
229
|
+
return false;
|
|
230
|
+
const [rutaActual, query] = this.currentUrl().split('?');
|
|
231
|
+
const coincide = rutaActual === path || rutaActual.startsWith(`${path}/`);
|
|
232
|
+
if (!coincide)
|
|
233
|
+
return false;
|
|
234
|
+
return !new URLSearchParams(query ?? '').has('project');
|
|
235
|
+
}
|
|
236
|
+
// Reemplaza a @dropdownAnimation (sin @angular/animations), calcado del
|
|
237
|
+
// timing real de consults: fade + scaleY, sin animar altura. La salida no
|
|
238
|
+
// tiene equivalente CSS puro (Angular removía el <ul> recién al terminar el
|
|
239
|
+
// :leave) — acá se mantiene montado con "--closing" el tiempo de esa
|
|
240
|
+
// animación y recién ahí se desmonta.
|
|
241
|
+
submenuRendered = signal(false);
|
|
242
|
+
submenuLeaveTimer = null;
|
|
243
|
+
constructor() {
|
|
244
|
+
effect(() => {
|
|
245
|
+
const openMenus = this.menuService.openMenus();
|
|
246
|
+
const currentOpenId = openMenus.get(this.level());
|
|
247
|
+
if (currentOpenId !== this.getItemId()) {
|
|
248
|
+
this.open.set(false);
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
effect(() => {
|
|
252
|
+
if (this.isOpen()) {
|
|
253
|
+
if (this.submenuLeaveTimer) {
|
|
254
|
+
clearTimeout(this.submenuLeaveTimer);
|
|
255
|
+
this.submenuLeaveTimer = null;
|
|
256
|
+
}
|
|
257
|
+
this.submenuRendered.set(true);
|
|
258
|
+
}
|
|
259
|
+
else if (this.submenuRendered()) {
|
|
260
|
+
this.submenuLeaveTimer = setTimeout(() => this.submenuRendered.set(false), 220);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
effect(() => {
|
|
264
|
+
if (this.showFlyout()) {
|
|
265
|
+
if (this.flyoutExitTimer) {
|
|
266
|
+
clearTimeout(this.flyoutExitTimer);
|
|
267
|
+
this.flyoutExitTimer = null;
|
|
268
|
+
}
|
|
269
|
+
this.flyoutRendered.set(true);
|
|
270
|
+
}
|
|
271
|
+
else if (this.flyoutRendered()) {
|
|
272
|
+
this.flyoutExitTimer = setTimeout(() => this.flyoutRendered.set(false), 130);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
ngOnDestroy() {
|
|
277
|
+
if (this.flyoutTimer)
|
|
278
|
+
clearTimeout(this.flyoutTimer);
|
|
279
|
+
if (this.submenuLeaveTimer)
|
|
280
|
+
clearTimeout(this.submenuLeaveTimer);
|
|
281
|
+
if (this.flyoutExitTimer)
|
|
282
|
+
clearTimeout(this.flyoutExitTimer);
|
|
283
|
+
if (activeFlyoutKey() == this.getFlyoutKey()) {
|
|
284
|
+
activeFlyoutKey.set(null);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
hasAccess(menuItem) {
|
|
288
|
+
const itemToCheck = menuItem || this.item();
|
|
289
|
+
const accesos = this.accesos();
|
|
290
|
+
const rolID = this.rolId();
|
|
291
|
+
if (!menuItem && this.item().extralink) {
|
|
292
|
+
return accesos.some(acc => acc.codmod == this.item().moduloID);
|
|
293
|
+
}
|
|
294
|
+
if (validaArray(itemToCheck.rol)) {
|
|
295
|
+
return itemToCheck.rol.includes(rolID);
|
|
296
|
+
}
|
|
297
|
+
if (!itemToCheck.moduloID && !itemToCheck.accesoID) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
return accesos.some((acc) => acc.codmod == itemToCheck.moduloID &&
|
|
301
|
+
acc.codacc == itemToCheck.accesoID);
|
|
302
|
+
}
|
|
303
|
+
get isSidebarActuallyOpen() {
|
|
304
|
+
return window.innerWidth <= 1191 ? true : !this.isSidebarOpen();
|
|
305
|
+
}
|
|
306
|
+
get isCollapsedMode() {
|
|
307
|
+
return window.innerWidth > 1191 && this.isSidebarOpen();
|
|
308
|
+
}
|
|
309
|
+
getFlyoutKey() {
|
|
310
|
+
return `flyout-${this.level()}-${this.item().title}`;
|
|
311
|
+
}
|
|
312
|
+
onItemMouseEnter(event) {
|
|
313
|
+
if (this.flyoutTimer) {
|
|
314
|
+
clearTimeout(this.flyoutTimer);
|
|
315
|
+
this.flyoutTimer = null;
|
|
316
|
+
}
|
|
317
|
+
if (this.isCollapsedMode) {
|
|
318
|
+
const sidebar = document.getElementById('sidebar');
|
|
319
|
+
if (sidebar) {
|
|
320
|
+
const sidebarRect = sidebar.getBoundingClientRect();
|
|
321
|
+
if (event.clientX > sidebarRect.left + 70)
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const el = event.currentTarget;
|
|
325
|
+
const rect = el.getBoundingClientRect();
|
|
326
|
+
const estimatedHeight = Math.max(60, (this.item().submenu?.length ?? 0) * 38 + 52);
|
|
327
|
+
const maxTop = window.innerHeight - estimatedHeight - 8;
|
|
328
|
+
this.flyoutY.set(Math.min(rect.top, maxTop));
|
|
329
|
+
activeFlyoutKey.set(this.getFlyoutKey());
|
|
330
|
+
}
|
|
331
|
+
else if (this.codAcceso()) {
|
|
332
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
333
|
+
let x = rect.right + 10;
|
|
334
|
+
let y = rect.top + rect.height / 2;
|
|
335
|
+
if (window.innerWidth <= 1191) {
|
|
336
|
+
const sidebarRect = document.getElementById('sidebar')?.getBoundingClientRect();
|
|
337
|
+
if (sidebarRect) {
|
|
338
|
+
x = rect.right - sidebarRect.left + 10;
|
|
339
|
+
y = rect.top - sidebarRect.top + rect.height / 2;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
activeTooltip.set({ text: this.codAcceso(), x, y });
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
onItemMouseOver() {
|
|
346
|
+
if (this.flyoutTimer) {
|
|
347
|
+
clearTimeout(this.flyoutTimer);
|
|
348
|
+
this.flyoutTimer = null;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
onItemMouseLeave() {
|
|
352
|
+
activeTooltip.set(null);
|
|
353
|
+
this.flyoutTimer = setTimeout(() => {
|
|
354
|
+
if (activeFlyoutKey() === this.getFlyoutKey()) {
|
|
355
|
+
activeFlyoutKey.set(null);
|
|
356
|
+
this.expandedFlyoutChild.set(null);
|
|
357
|
+
}
|
|
358
|
+
}, 80);
|
|
359
|
+
}
|
|
360
|
+
showChildTooltip(event, item) {
|
|
361
|
+
const cod = this.codAccesoItem(item);
|
|
362
|
+
if (!cod)
|
|
363
|
+
return;
|
|
364
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
365
|
+
activeTooltip.set({ text: cod, x: rect.right + 10, y: rect.top + rect.height / 2 });
|
|
366
|
+
}
|
|
367
|
+
hideChildTooltip() {
|
|
368
|
+
activeTooltip.set(null);
|
|
369
|
+
}
|
|
370
|
+
onFlyoutMouseEnter() {
|
|
371
|
+
if (this.flyoutTimer) {
|
|
372
|
+
clearTimeout(this.flyoutTimer);
|
|
373
|
+
this.flyoutTimer = null;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
onFlyoutMouseLeave() {
|
|
377
|
+
this.flyoutTimer = setTimeout(() => {
|
|
378
|
+
if (activeFlyoutKey() === this.getFlyoutKey()) {
|
|
379
|
+
activeFlyoutKey.set(null);
|
|
380
|
+
this.expandedFlyoutChild.set(null);
|
|
381
|
+
}
|
|
382
|
+
}, 80);
|
|
383
|
+
}
|
|
384
|
+
toggleFlyoutChild(child) {
|
|
385
|
+
if (!child.submenu?.length)
|
|
386
|
+
return;
|
|
387
|
+
const key = child.title + child.path;
|
|
388
|
+
this.expandedFlyoutChild.set(this.expandedFlyoutChild() == key ? null : key);
|
|
389
|
+
}
|
|
390
|
+
isFlyoutChildExpanded(child) {
|
|
391
|
+
return this.expandedFlyoutChild() === (child.title + child.path);
|
|
392
|
+
}
|
|
393
|
+
onFlyoutItemClick(child, event) {
|
|
394
|
+
if (child.submenu?.length) {
|
|
395
|
+
event.preventDefault();
|
|
396
|
+
event.stopPropagation();
|
|
397
|
+
this.toggleFlyoutChild(child);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
activeFlyoutKey.set(null);
|
|
401
|
+
if (child.extralink) {
|
|
402
|
+
this.openLink(child);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
this.headerUiService.setTypeDocumento(null);
|
|
406
|
+
this.headerUiService.setNumintDocumento(null);
|
|
407
|
+
}
|
|
408
|
+
onFlyoutGrandchildClick(grandchild) {
|
|
409
|
+
activeFlyoutKey.set(null);
|
|
410
|
+
this.expandedFlyoutChild.set(null);
|
|
411
|
+
if (grandchild.extralink) {
|
|
412
|
+
this.openLink(grandchild);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
this.headerUiService.setTypeDocumento(null);
|
|
416
|
+
this.headerUiService.setNumintDocumento(null);
|
|
417
|
+
}
|
|
418
|
+
onFlyoutItemRightClick(event, child) {
|
|
419
|
+
if (child.extralink)
|
|
420
|
+
return;
|
|
421
|
+
if (!child.submenu?.length && child.path) {
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
window.open(child.path);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
onFlyoutItemMiddleClick(event, child) {
|
|
427
|
+
if (event.button === 1 && !child.submenu?.length && child.path && !child.extralink) {
|
|
428
|
+
event.preventDefault();
|
|
429
|
+
this.tabsService.addBackground(child.path, child.title, child.icon, this.item().title);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
toggle() {
|
|
433
|
+
if (this.item().extralink) {
|
|
434
|
+
this.openLink(this.item());
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (this.item()?.submenu?.length > 0) {
|
|
438
|
+
this.open.set(!this.open());
|
|
439
|
+
this.menuService.setOpenMenu(this.level(), this.open() ? this.getItemId() : null);
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
this.headerUiService.setTypeDocumento(null);
|
|
443
|
+
this.headerUiService.setNumintDocumento(null);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
openLink(item) {
|
|
447
|
+
this.extralinkOpener?.open(item.moduloID, item.routeName);
|
|
448
|
+
}
|
|
449
|
+
onMiddleClick(event) {
|
|
450
|
+
if (this.item().extralink) {
|
|
451
|
+
event.preventDefault();
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
if (event.button == 1 && !this.item().submenu?.length && this.item().path) {
|
|
455
|
+
event.preventDefault();
|
|
456
|
+
const module = this.level() === 0 ? null : this.parentModuleName();
|
|
457
|
+
this.tabsService.addBackground(this.item().path, this.item().title, this.item().icon, module);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
onRightClick(event) {
|
|
461
|
+
if (this.item().extralink) {
|
|
462
|
+
event.preventDefault();
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (!this.item().submenu?.length && this.item().path) {
|
|
466
|
+
window.open(this.item().path);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
isOpen() {
|
|
470
|
+
return this.open();
|
|
471
|
+
}
|
|
472
|
+
getItemId() {
|
|
473
|
+
return `${this.level}-${this.item().path}-${this.item().title}`;
|
|
474
|
+
}
|
|
475
|
+
codAcceso = () => {
|
|
476
|
+
const { accesoID, moduloID, extralink } = this.item();
|
|
477
|
+
if (extralink && moduloID != null)
|
|
478
|
+
return `ModuloID: ${moduloID}`;
|
|
479
|
+
if (accesoID == null && moduloID == null)
|
|
480
|
+
return '';
|
|
481
|
+
const mod = moduloID != null ? moduloID : 'ND';
|
|
482
|
+
const acc = accesoID != null ? accesoID : 'ND';
|
|
483
|
+
return `AccesoID: ${mod}-${acc}`;
|
|
484
|
+
};
|
|
485
|
+
codAccesoItem(item) {
|
|
486
|
+
if (item.extralink && item.moduloID != null)
|
|
487
|
+
return `ModuloID: ${item.moduloID}`;
|
|
488
|
+
if (item.accesoID == null && item.moduloID == null)
|
|
489
|
+
return '';
|
|
490
|
+
const mod = item.moduloID != null ? item.moduloID : 'ND';
|
|
491
|
+
const acc = item.accesoID != null ? item.accesoID : 'ND';
|
|
492
|
+
return `AccesoID: ${mod}-${acc}`;
|
|
493
|
+
}
|
|
494
|
+
manejarRuta(item) {
|
|
495
|
+
if (item.extralink)
|
|
496
|
+
return null;
|
|
497
|
+
if (validaArray(item.submenu))
|
|
498
|
+
return null;
|
|
499
|
+
return item.path;
|
|
500
|
+
}
|
|
501
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
502
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: MenuItemComponent, isStandalone: true, selector: "app-menu-item", inputs: { item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: true, transformFunction: null }, isSidebarOpen: { classPropertyName: "isSidebarOpen", publicName: "isSidebarOpen", isSignal: true, isRequired: false, transformFunction: null }, isSidebarHovering: { classPropertyName: "isSidebarHovering", publicName: "isSidebarHovering", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, parentModuleName: { classPropertyName: "parentModuleName", publicName: "parentModuleName", isSignal: true, isRequired: false, transformFunction: null }, accentColor: { classPropertyName: "accentColor", publicName: "accentColor", isSignal: true, isRequired: false, transformFunction: null }, accesos: { classPropertyName: "accesos", publicName: "accesos", isSignal: true, isRequired: false, transformFunction: null }, rolId: { classPropertyName: "rolId", publicName: "rolId", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if(hasAccess()){\r\n<li (mouseenter)=\"onItemMouseEnter($event)\" (mouseleave)=\"onItemMouseLeave()\"\r\n (mouseover)=\"onItemMouseOver()\">\r\n <div class=\"d-flex align-items-center justify-content-between pt-2 pb-2 px-2 item-sidebar\" (click)=\"toggle()\"\r\n (mousedown)=\"onMiddleClick($event)\" (contextmenu)=\"onRightClick($event)\"\r\n [routerLink]=\"(!item().submenu?.length && item().path && !item().extralink) ? item().path : null\"\r\n [class.active-route]=\"esRutaActiva(item().path)\" [class.cursor-pointer]=\"item().submenu?.length == 0\"\r\n [class.cursor-drow]=\"item().submenu?.length > 0\">\r\n <span>\r\n @if (item().title) {\r\n <i [class]=\"(item().icon ? item().icon : '') + (isSidebarActuallyOpen ? ' me-1' : ' me-1 ms-2')\"></i>\r\n <span class=\"sidebar-text\" [class.sidebar-text--hidden]=\"!isSidebarActuallyOpen\">\r\n {{ item().title }}\r\n </span>\r\n }\r\n </span>\r\n @if (item().submenu?.length > 0) {\r\n <i class=\"fas sidebar-chevron\" [class.sidebar-chevron--hidden]=\"!isSidebarActuallyOpen\" [ngClass]=\"{\r\n 'fa-chevron-down': isOpen(),\r\n 'fa-chevron-right': !isOpen()\r\n }\"></i>\r\n }\r\n </div>\r\n @if (item().submenu?.length && isSidebarActuallyOpen && submenuRendered()) {\r\n <ul class=\"list-unstyled ms-3 submenu\" [class.submenu--closing]=\"!isOpen()\">\r\n @for (child of item().submenu; track $index) {\r\n <app-menu-item [item]=\"child\" [level]=\"level() + 1\" [isSidebarOpen]=\"!isSidebarActuallyOpen\" [parentModuleName]=\"parentModuleName()\" [accentColor]=\"accentColor()\" [accesos]=\"accesos()\" [rolId]=\"rolId()\" />\r\n }\r\n </ul>\r\n }\r\n\r\n @if (flyoutRendered()) {\r\n <div class=\"sidebar-flyout\" [class.sidebar-flyout--closing]=\"!showFlyout()\" [style.top.px]=\"flyoutY()\" [style.max-height]=\"'calc(100dvh - ' + flyoutY() + 'px - 8px)'\"\r\n [style.--flyout-accent]=\"accentColor()\" (mouseenter)=\"onFlyoutMouseEnter()\" (mouseleave)=\"onFlyoutMouseLeave()\">\r\n <div class=\"flyout-header\">\r\n <i [class]=\"(item().icon || '') + ' flyout-header-icon'\"></i>\r\n <span class=\"flyout-header-title\">{{ item().title }}</span>\r\n @if (codAcceso()) {\r\n <span class=\"flyout-header-acceso\">{{ codAcceso().split(': ')[1] }}</span>\r\n }\r\n </div>\r\n @if (item().submenu?.length > 0) {\r\n <ul class=\"list-unstyled flyout-items\">\r\n @for (child of item().submenu; track $index) {\r\n @if (hasAccess(child)) {\r\n <li class=\"flyout-group\">\r\n <div class=\"flyout-item\" [class.flyout-item-has-children]=\"child.submenu?.length > 0\"\r\n [class.flyout-item-expanded]=\"isFlyoutChildExpanded(child)\" [routerLink]=\"manejarRuta(child)\"\r\n [class.flyout-item-active]=\"!child.submenu?.length && esRutaActiva(child.path)\"\r\n (click)=\"onFlyoutItemClick(child, $event)\" (mousedown)=\"onFlyoutItemMiddleClick($event, child)\"\r\n (contextmenu)=\"onFlyoutItemRightClick($event, child)\" (mouseenter)=\"showChildTooltip($event, child)\"\r\n (mouseleave)=\"hideChildTooltip()\">\r\n @if (child.icon) {\r\n <i [class]=\"child.icon + ' flyout-item-icon'\"></i>\r\n }\r\n <span class=\"flyout-item-label\">{{ child.title }}</span>\r\n @if (child.submenu?.length > 0) {\r\n <i class=\"fas flyout-chevron\" [class.fa-chevron-down]=\"isFlyoutChildExpanded(child)\"\r\n [class.fa-chevron-right]=\"!isFlyoutChildExpanded(child)\"></i>\r\n }\r\n </div>\r\n\r\n @if (isFlyoutChildExpanded(child) && child.submenu?.length > 0) {\r\n <ul class=\"list-unstyled flyout-subitems\">\r\n @for (grandchild of child.submenu; track $index) {\r\n @if (hasAccess(grandchild)) {\r\n <li class=\"flyout-subitem\" [routerLink]=\"manejarRuta(grandchild)\" [class.flyout-subitem-active]=\"esRutaActiva(grandchild.path)\"\r\n (click)=\"onFlyoutGrandchildClick(grandchild)\" (mousedown)=\"onFlyoutItemMiddleClick($event, grandchild)\"\r\n (contextmenu)=\"onFlyoutItemRightClick($event, grandchild)\"\r\n (mouseenter)=\"showChildTooltip($event, grandchild)\" (mouseleave)=\"hideChildTooltip()\">\r\n @if (grandchild.icon) {\r\n <i [class]=\"grandchild.icon + ' flyout-item-icon'\"></i>\r\n }\r\n <span class=\"flyout-item-label\">{{ grandchild.title }}</span>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n</li>\r\n}\r\n\r\n@if (tooltip()?.text) {\r\n<div class=\"acceso-tooltip-fixed\" [style.left.px]=\"tooltip()!.x\" [style.top.px]=\"tooltip()!.y\">\r\n <span class=\"tooltip-label\">{{ tooltip()!.text.split(': ')[0] }}:</span>\r\n <span class=\"tooltip-value\">{{ tooltip()!.text.split(': ')[1] }}</span>\r\n</div>\r\n}\r\n", styles: [".active-route{color:var(--sidebar-active-text)!important;background:linear-gradient(90deg,#ffffff24,#ffffff0a)!important;border-left:3px solid var(--sidebar-accent, #c50048)!important;border-radius:0 8px 8px 0!important;box-shadow:inset 0 1px #ffffff0f!important}.cursor-drow{cursor:default}.submenu{transform-origin:top;animation:submenuIn .26s cubic-bezier(.4,0,.2,1) both}.submenu--closing{animation:submenuOut .22s cubic-bezier(.4,0,.2,1) both}@keyframes submenuIn{0%{opacity:0;transform:translateY(-8px) scaleY(.94)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes submenuOut{0%{opacity:1;transform:translateY(0) scaleY(1)}to{opacity:0;transform:translateY(-8px) scaleY(.94)}}.acceso-tooltip-fixed{position:fixed;z-index:99999;transform:translateY(-50%);pointer-events:none;padding:4px 10px 4px 8px;border-radius:6px;font-family:monospace;white-space:nowrap;background:#0f0f14;border:1px solid rgba(255,255,255,.07);border-left:2px solid var(--sidebar-accent, #c50048);display:flex;align-items:center;gap:5px;animation:tooltipFadeIn .14s cubic-bezier(.25,.46,.45,.94)}.acceso-tooltip-fixed .tooltip-label{font-size:10px;font-weight:400;color:#fff;letter-spacing:.3px}.acceso-tooltip-fixed .tooltip-value{font-size:11px;font-weight:700;color:var(--sidebar-accent, #c50048)}.acceso-tooltip-fixed:before{content:\"\";position:absolute;right:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-right-color:var(--sidebar-accent, #c50048)}@keyframes tooltipFadeIn{0%{opacity:0;transform:translateY(-50%) translate(-4px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.sidebar-text{display:inline-block;vertical-align:middle;white-space:normal;word-break:break-word;opacity:1;transform:translate(0);transition:opacity .15s ease .22s,transform .15s ease .22s}.sidebar-text--hidden{opacity:0;transform:translate(-4px);white-space:nowrap;max-width:0;overflow:hidden;transition:opacity .12s ease 0s,transform .12s ease 0s,max-width 0s linear .12s}.sidebar-chevron{opacity:1;transition:opacity .15s ease .22s}.sidebar-chevron--hidden{opacity:0;transition:opacity .12s ease 0s}.item-sidebar{color:var(--sidebar-text-color)!important;transition:all .2s ease;border-radius:8px}.item-sidebar>span:first-child{min-width:0;flex:1}.item-sidebar:hover{color:var(--sidebar-active-text)!important;background:#ffffff17!important;transform:translate(2px)}.sidebar-flyout{position:fixed;left:70px;z-index:9999;min-width:220px;max-width:300px;overflow-y:auto;scrollbar-width:none;background:linear-gradient(160deg,var(--sidebar-gradient-start, #1a1a2e) 0%,var(--sidebar-bg, #16213e) 100%);border:1px solid rgba(255,255,255,.1);border-left:3px solid var(--flyout-accent, #c50048);border-radius:0 12px 12px;box-shadow:8px 6px 32px #0000008c,0 0 0 1px #ffffff0a;animation:flyout-slide-in .15s cubic-bezier(.25,.46,.45,.94);pointer-events:auto}.sidebar-flyout--closing{animation:flyout-slide-out .13s ease-in both}@keyframes flyout-slide-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-8px)}}.flyout-header{display:flex;align-items:center;gap:10px;padding:12px 16px 10px;border-bottom:1px solid rgba(255,255,255,.08);background:#ffffff0a}.flyout-header-icon{color:var(--flyout-accent, #c50048);font-size:14px;min-width:16px;text-align:center}.flyout-header-title{font-size:12px;font-weight:700;color:var(--sidebar-active-text, #fff);letter-spacing:.5px;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.flyout-header-acceso{font-size:10px;font-weight:700;font-family:monospace;color:var(--flyout-accent, #c50048);background:#ffffff12;border:1px solid rgba(255,255,255,.1);border-left:2px solid var(--flyout-accent, #c50048);padding:2px 7px;border-radius:4px;white-space:nowrap;flex-shrink:0}.flyout-items{padding:6px;margin:0}.flyout-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:8px;cursor:pointer;color:var(--sidebar-text-color, rgba(255, 255, 255, .7));font-size:13px;transition:background .15s ease,color .15s ease,transform .15s ease;white-space:nowrap;overflow:hidden;position:relative}.flyout-item:hover{background:#ffffff1a;color:var(--sidebar-active-text, #fff);transform:translate(3px)}.flyout-item-active{background:linear-gradient(90deg,#ffffff21,#ffffff08)!important;color:var(--sidebar-active-text, #fff)!important}.flyout-item-active:before{content:\"\";position:absolute;left:0;top:15%;height:70%;width:3px;background:var(--flyout-accent, #c50048);border-radius:0 2px 2px 0}.flyout-item-icon{font-size:12px;min-width:14px;text-align:center;color:inherit;opacity:.75}.flyout-item-label{flex:1;overflow:hidden;text-overflow:ellipsis}.flyout-chevron{font-size:10px;opacity:.5;margin-left:auto;flex-shrink:0;transition:transform .2s ease}.flyout-group{display:flex;flex-direction:column}.flyout-item-has-children{cursor:default}.flyout-item-expanded{background:#ffffff12!important;color:var(--sidebar-active-text, #fff)!important}.flyout-subitems{padding:2px 6px 2px 14px;border-left:2px solid rgba(255,255,255,.1);margin:0 6px 4px 20px}.flyout-subitem{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;cursor:pointer;color:var(--sidebar-text-color, rgba(255, 255, 255, .65));font-size:12px;transition:background .15s ease,color .15s ease,transform .15s ease;white-space:nowrap;overflow:hidden}.flyout-subitem:hover{background:#ffffff17;color:var(--sidebar-active-text, #fff);transform:translate(2px)}.flyout-subitem-active{color:var(--sidebar-active-text, #fff)!important;position:relative}.flyout-subitem-active:before{content:\"\";position:absolute;left:-14px;top:20%;height:60%;width:2px;background:var(--flyout-accent, #c50048);border-radius:1px}@keyframes flyout-slide-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}\n"], dependencies: [{ kind: "component", type: MenuItemComponent, selector: "app-menu-item", inputs: ["item", "isSidebarOpen", "isSidebarHovering", "level", "parentModuleName", "accentColor", "accesos", "rolId"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
503
|
+
}
|
|
504
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: MenuItemComponent, decorators: [{
|
|
505
|
+
type: Component,
|
|
506
|
+
args: [{ selector: 'app-menu-item', imports: [NgClass, RouterLink], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if(hasAccess()){\r\n<li (mouseenter)=\"onItemMouseEnter($event)\" (mouseleave)=\"onItemMouseLeave()\"\r\n (mouseover)=\"onItemMouseOver()\">\r\n <div class=\"d-flex align-items-center justify-content-between pt-2 pb-2 px-2 item-sidebar\" (click)=\"toggle()\"\r\n (mousedown)=\"onMiddleClick($event)\" (contextmenu)=\"onRightClick($event)\"\r\n [routerLink]=\"(!item().submenu?.length && item().path && !item().extralink) ? item().path : null\"\r\n [class.active-route]=\"esRutaActiva(item().path)\" [class.cursor-pointer]=\"item().submenu?.length == 0\"\r\n [class.cursor-drow]=\"item().submenu?.length > 0\">\r\n <span>\r\n @if (item().title) {\r\n <i [class]=\"(item().icon ? item().icon : '') + (isSidebarActuallyOpen ? ' me-1' : ' me-1 ms-2')\"></i>\r\n <span class=\"sidebar-text\" [class.sidebar-text--hidden]=\"!isSidebarActuallyOpen\">\r\n {{ item().title }}\r\n </span>\r\n }\r\n </span>\r\n @if (item().submenu?.length > 0) {\r\n <i class=\"fas sidebar-chevron\" [class.sidebar-chevron--hidden]=\"!isSidebarActuallyOpen\" [ngClass]=\"{\r\n 'fa-chevron-down': isOpen(),\r\n 'fa-chevron-right': !isOpen()\r\n }\"></i>\r\n }\r\n </div>\r\n @if (item().submenu?.length && isSidebarActuallyOpen && submenuRendered()) {\r\n <ul class=\"list-unstyled ms-3 submenu\" [class.submenu--closing]=\"!isOpen()\">\r\n @for (child of item().submenu; track $index) {\r\n <app-menu-item [item]=\"child\" [level]=\"level() + 1\" [isSidebarOpen]=\"!isSidebarActuallyOpen\" [parentModuleName]=\"parentModuleName()\" [accentColor]=\"accentColor()\" [accesos]=\"accesos()\" [rolId]=\"rolId()\" />\r\n }\r\n </ul>\r\n }\r\n\r\n @if (flyoutRendered()) {\r\n <div class=\"sidebar-flyout\" [class.sidebar-flyout--closing]=\"!showFlyout()\" [style.top.px]=\"flyoutY()\" [style.max-height]=\"'calc(100dvh - ' + flyoutY() + 'px - 8px)'\"\r\n [style.--flyout-accent]=\"accentColor()\" (mouseenter)=\"onFlyoutMouseEnter()\" (mouseleave)=\"onFlyoutMouseLeave()\">\r\n <div class=\"flyout-header\">\r\n <i [class]=\"(item().icon || '') + ' flyout-header-icon'\"></i>\r\n <span class=\"flyout-header-title\">{{ item().title }}</span>\r\n @if (codAcceso()) {\r\n <span class=\"flyout-header-acceso\">{{ codAcceso().split(': ')[1] }}</span>\r\n }\r\n </div>\r\n @if (item().submenu?.length > 0) {\r\n <ul class=\"list-unstyled flyout-items\">\r\n @for (child of item().submenu; track $index) {\r\n @if (hasAccess(child)) {\r\n <li class=\"flyout-group\">\r\n <div class=\"flyout-item\" [class.flyout-item-has-children]=\"child.submenu?.length > 0\"\r\n [class.flyout-item-expanded]=\"isFlyoutChildExpanded(child)\" [routerLink]=\"manejarRuta(child)\"\r\n [class.flyout-item-active]=\"!child.submenu?.length && esRutaActiva(child.path)\"\r\n (click)=\"onFlyoutItemClick(child, $event)\" (mousedown)=\"onFlyoutItemMiddleClick($event, child)\"\r\n (contextmenu)=\"onFlyoutItemRightClick($event, child)\" (mouseenter)=\"showChildTooltip($event, child)\"\r\n (mouseleave)=\"hideChildTooltip()\">\r\n @if (child.icon) {\r\n <i [class]=\"child.icon + ' flyout-item-icon'\"></i>\r\n }\r\n <span class=\"flyout-item-label\">{{ child.title }}</span>\r\n @if (child.submenu?.length > 0) {\r\n <i class=\"fas flyout-chevron\" [class.fa-chevron-down]=\"isFlyoutChildExpanded(child)\"\r\n [class.fa-chevron-right]=\"!isFlyoutChildExpanded(child)\"></i>\r\n }\r\n </div>\r\n\r\n @if (isFlyoutChildExpanded(child) && child.submenu?.length > 0) {\r\n <ul class=\"list-unstyled flyout-subitems\">\r\n @for (grandchild of child.submenu; track $index) {\r\n @if (hasAccess(grandchild)) {\r\n <li class=\"flyout-subitem\" [routerLink]=\"manejarRuta(grandchild)\" [class.flyout-subitem-active]=\"esRutaActiva(grandchild.path)\"\r\n (click)=\"onFlyoutGrandchildClick(grandchild)\" (mousedown)=\"onFlyoutItemMiddleClick($event, grandchild)\"\r\n (contextmenu)=\"onFlyoutItemRightClick($event, grandchild)\"\r\n (mouseenter)=\"showChildTooltip($event, grandchild)\" (mouseleave)=\"hideChildTooltip()\">\r\n @if (grandchild.icon) {\r\n <i [class]=\"grandchild.icon + ' flyout-item-icon'\"></i>\r\n }\r\n <span class=\"flyout-item-label\">{{ grandchild.title }}</span>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </li>\r\n }\r\n }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n</li>\r\n}\r\n\r\n@if (tooltip()?.text) {\r\n<div class=\"acceso-tooltip-fixed\" [style.left.px]=\"tooltip()!.x\" [style.top.px]=\"tooltip()!.y\">\r\n <span class=\"tooltip-label\">{{ tooltip()!.text.split(': ')[0] }}:</span>\r\n <span class=\"tooltip-value\">{{ tooltip()!.text.split(': ')[1] }}</span>\r\n</div>\r\n}\r\n", styles: [".active-route{color:var(--sidebar-active-text)!important;background:linear-gradient(90deg,#ffffff24,#ffffff0a)!important;border-left:3px solid var(--sidebar-accent, #c50048)!important;border-radius:0 8px 8px 0!important;box-shadow:inset 0 1px #ffffff0f!important}.cursor-drow{cursor:default}.submenu{transform-origin:top;animation:submenuIn .26s cubic-bezier(.4,0,.2,1) both}.submenu--closing{animation:submenuOut .22s cubic-bezier(.4,0,.2,1) both}@keyframes submenuIn{0%{opacity:0;transform:translateY(-8px) scaleY(.94)}to{opacity:1;transform:translateY(0) scaleY(1)}}@keyframes submenuOut{0%{opacity:1;transform:translateY(0) scaleY(1)}to{opacity:0;transform:translateY(-8px) scaleY(.94)}}.acceso-tooltip-fixed{position:fixed;z-index:99999;transform:translateY(-50%);pointer-events:none;padding:4px 10px 4px 8px;border-radius:6px;font-family:monospace;white-space:nowrap;background:#0f0f14;border:1px solid rgba(255,255,255,.07);border-left:2px solid var(--sidebar-accent, #c50048);display:flex;align-items:center;gap:5px;animation:tooltipFadeIn .14s cubic-bezier(.25,.46,.45,.94)}.acceso-tooltip-fixed .tooltip-label{font-size:10px;font-weight:400;color:#fff;letter-spacing:.3px}.acceso-tooltip-fixed .tooltip-value{font-size:11px;font-weight:700;color:var(--sidebar-accent, #c50048)}.acceso-tooltip-fixed:before{content:\"\";position:absolute;right:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-right-color:var(--sidebar-accent, #c50048)}@keyframes tooltipFadeIn{0%{opacity:0;transform:translateY(-50%) translate(-4px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.sidebar-text{display:inline-block;vertical-align:middle;white-space:normal;word-break:break-word;opacity:1;transform:translate(0);transition:opacity .15s ease .22s,transform .15s ease .22s}.sidebar-text--hidden{opacity:0;transform:translate(-4px);white-space:nowrap;max-width:0;overflow:hidden;transition:opacity .12s ease 0s,transform .12s ease 0s,max-width 0s linear .12s}.sidebar-chevron{opacity:1;transition:opacity .15s ease .22s}.sidebar-chevron--hidden{opacity:0;transition:opacity .12s ease 0s}.item-sidebar{color:var(--sidebar-text-color)!important;transition:all .2s ease;border-radius:8px}.item-sidebar>span:first-child{min-width:0;flex:1}.item-sidebar:hover{color:var(--sidebar-active-text)!important;background:#ffffff17!important;transform:translate(2px)}.sidebar-flyout{position:fixed;left:70px;z-index:9999;min-width:220px;max-width:300px;overflow-y:auto;scrollbar-width:none;background:linear-gradient(160deg,var(--sidebar-gradient-start, #1a1a2e) 0%,var(--sidebar-bg, #16213e) 100%);border:1px solid rgba(255,255,255,.1);border-left:3px solid var(--flyout-accent, #c50048);border-radius:0 12px 12px;box-shadow:8px 6px 32px #0000008c,0 0 0 1px #ffffff0a;animation:flyout-slide-in .15s cubic-bezier(.25,.46,.45,.94);pointer-events:auto}.sidebar-flyout--closing{animation:flyout-slide-out .13s ease-in both}@keyframes flyout-slide-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(-8px)}}.flyout-header{display:flex;align-items:center;gap:10px;padding:12px 16px 10px;border-bottom:1px solid rgba(255,255,255,.08);background:#ffffff0a}.flyout-header-icon{color:var(--flyout-accent, #c50048);font-size:14px;min-width:16px;text-align:center}.flyout-header-title{font-size:12px;font-weight:700;color:var(--sidebar-active-text, #fff);letter-spacing:.5px;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.flyout-header-acceso{font-size:10px;font-weight:700;font-family:monospace;color:var(--flyout-accent, #c50048);background:#ffffff12;border:1px solid rgba(255,255,255,.1);border-left:2px solid var(--flyout-accent, #c50048);padding:2px 7px;border-radius:4px;white-space:nowrap;flex-shrink:0}.flyout-items{padding:6px;margin:0}.flyout-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:8px;cursor:pointer;color:var(--sidebar-text-color, rgba(255, 255, 255, .7));font-size:13px;transition:background .15s ease,color .15s ease,transform .15s ease;white-space:nowrap;overflow:hidden;position:relative}.flyout-item:hover{background:#ffffff1a;color:var(--sidebar-active-text, #fff);transform:translate(3px)}.flyout-item-active{background:linear-gradient(90deg,#ffffff21,#ffffff08)!important;color:var(--sidebar-active-text, #fff)!important}.flyout-item-active:before{content:\"\";position:absolute;left:0;top:15%;height:70%;width:3px;background:var(--flyout-accent, #c50048);border-radius:0 2px 2px 0}.flyout-item-icon{font-size:12px;min-width:14px;text-align:center;color:inherit;opacity:.75}.flyout-item-label{flex:1;overflow:hidden;text-overflow:ellipsis}.flyout-chevron{font-size:10px;opacity:.5;margin-left:auto;flex-shrink:0;transition:transform .2s ease}.flyout-group{display:flex;flex-direction:column}.flyout-item-has-children{cursor:default}.flyout-item-expanded{background:#ffffff12!important;color:var(--sidebar-active-text, #fff)!important}.flyout-subitems{padding:2px 6px 2px 14px;border-left:2px solid rgba(255,255,255,.1);margin:0 6px 4px 20px}.flyout-subitem{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;cursor:pointer;color:var(--sidebar-text-color, rgba(255, 255, 255, .65));font-size:12px;transition:background .15s ease,color .15s ease,transform .15s ease;white-space:nowrap;overflow:hidden}.flyout-subitem:hover{background:#ffffff17;color:var(--sidebar-active-text, #fff);transform:translate(2px)}.flyout-subitem-active{color:var(--sidebar-active-text, #fff)!important;position:relative}.flyout-subitem-active:before{content:\"\";position:absolute;left:-14px;top:20%;height:60%;width:2px;background:var(--flyout-accent, #c50048);border-radius:1px}@keyframes flyout-slide-in{0%{opacity:0;transform:translate(-10px)}to{opacity:1;transform:translate(0)}}\n"] }]
|
|
507
|
+
}], ctorParameters: () => [] });
|
|
508
|
+
|
|
509
|
+
class BottomNavigationComponent {
|
|
510
|
+
menuItems = input([]);
|
|
511
|
+
isVisible = input(true);
|
|
512
|
+
itemClick = output();
|
|
513
|
+
activeDropdown = signal(null);
|
|
514
|
+
onDocumentClick() {
|
|
515
|
+
this.activeDropdown.set(null);
|
|
516
|
+
}
|
|
517
|
+
toggleDropdown(index, event) {
|
|
518
|
+
if (event)
|
|
519
|
+
event.stopPropagation();
|
|
520
|
+
const isOpening = this.activeDropdown() != index;
|
|
521
|
+
this.activeDropdown.set(isOpening ? index : null);
|
|
522
|
+
if (isOpening) {
|
|
523
|
+
const item = this.menuItems()[index];
|
|
524
|
+
item?.onOpen?.();
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
onItemClick(index, item, event) {
|
|
528
|
+
if (event)
|
|
529
|
+
event.stopPropagation();
|
|
530
|
+
this.activeDropdown.set(null);
|
|
531
|
+
this.itemClick.emit({ index, item });
|
|
532
|
+
if (item.action)
|
|
533
|
+
item.action();
|
|
534
|
+
}
|
|
535
|
+
onSubItemClick(subItem, event) {
|
|
536
|
+
if (event)
|
|
537
|
+
event.stopPropagation();
|
|
538
|
+
this.activeDropdown.set(null);
|
|
539
|
+
if (subItem.action)
|
|
540
|
+
subItem.action();
|
|
541
|
+
}
|
|
542
|
+
onDropdownClick(event) { event.stopPropagation(); }
|
|
543
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: BottomNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
544
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: BottomNavigationComponent, isStandalone: true, selector: "app-bottom-navigation", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, isVisible: { classPropertyName: "isVisible", publicName: "isVisible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, host: { listeners: { "document:click": "onDocumentClick()" } }, ngImport: i0, template: "<nav class=\"bottom-nav\" [class.visible]=\"isVisible()\">\r\n @for (item of menuItems(); track $index) {\r\n @if (item.type == 'dropdown') {\r\n <div class=\"bottom-nav-dropdown\">\r\n <button class=\"bottom-nav-item\" [class.active]=\"activeDropdown() === $index\"\r\n (click)=\"toggleDropdown($index, $event)\">\r\n <i [class]=\"item.icon\"></i>\r\n <span>{{ item.label }}</span>\r\n </button>\r\n\r\n @if (activeDropdown() == $index) {\r\n <div class=\"dropdown-menu show\" (click)=\"onDropdownClick($event)\">\r\n @for (subItem of item.items; track subItem.label; let last = $last; let first = $first) {\r\n\r\n <button class=\"dropdown-item\"\r\n [ngClass]=\"{'border-top-radius': first, 'border-bottom-radius': last}\"\r\n (click)=\"onSubItemClick(subItem, $event)\">\r\n\r\n <i [class]=\"subItem.icon\" class=\"me-2\"></i>\r\n <span class=\"flex-grow-1\">{{ subItem.label }}</span>\r\n\r\n @if (subItem.value) {\r\n <span class=\"fw-semibold ms-2\">{{ subItem.value }}</span>\r\n }\r\n </button>\r\n\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <button class=\"bottom-nav-item\" [class.active]=\"item.active\" (click)=\"onItemClick($index, item, $event)\">\r\n <i [class]=\"item.icon\"></i>\r\n <span>{{ item.label }}</span>\r\n </button>\r\n }\r\n }\r\n</nav>\r\n", styles: [".bottom-nav{position:fixed;bottom:0;left:0;right:0;background:var(--sidebar-bg, #ffffff);box-shadow:0 -2px 10px #0000001a;display:flex;justify-content:space-evenly;align-items:center;padding:8px 12px;z-index:1050;border-top:1px solid var(--font-border-input, #e0e0e0);transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);height:60px}.bottom-nav.visible{transform:translateY(0)}@media(min-width:1192px){.bottom-nav{display:none}}.bottom-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;background:none;border:none;padding:4px 2px;cursor:pointer;color:var(--sidebar-text-color, #666);transition:all .2s ease;border-radius:8px;flex:1;min-width:0;max-width:none;position:relative}.bottom-nav-item i{font-size:20px;margin-bottom:2px;transition:transform .2s cubic-bezier(.4,0,.2,1)}.bottom-nav-item span{font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.bottom-nav-item:active{background:var(--bs-table-hover-bg, #f0f0f0);transform:scale(.95)}.bottom-nav-item.active{color:#398bf7}.bottom-nav-item.active i{transform:translateY(-2px)}.bottom-nav-dropdown{position:static;flex:1;display:flex;justify-content:center}.dropdown-menu{position:fixed;bottom:52px;left:50%;transform:translate(-50%) scale(.9);transform-origin:bottom center;background:var(--background-card, #ffffff);border:1px solid var(--border-color-modal, #dee2e6);border-radius:16px;padding:0;min-width:260px;max-width:90%;max-height:70vh;box-shadow:0 -4px 20px #00000026;z-index:1060;margin-bottom:10px;opacity:0;visibility:hidden;transition:all .25s cubic-bezier(.4,0,.2,1);pointer-events:none;overflow:hidden}.dropdown-menu.show{opacity:1;visibility:visible;transform:translate(-50%) scale(1);pointer-events:auto}.dropdown-menu .dropdown-item{display:flex;align-items:center;padding:14px 16px;font-size:10px;color:var(--text-color, #333);background:none;border:none;width:100%;text-align:left;border-bottom:1px solid var(--border-color-modal, #f0f0f0);opacity:0;transform:translateY(10px);animation:slideInItem .2s cubic-bezier(.4,0,.2,1) forwards;animation-delay:calc(.03s * var(--item-index, 0))}.dropdown-menu .dropdown-item:last-child{border-bottom:none}.dropdown-menu .dropdown-item i{width:24px;font-size:12px;transition:transform .2s ease}.dropdown-menu .dropdown-item:hover{background:var(--bs-table-hover-bg, #f8f9fa)}.dropdown-menu .dropdown-item:hover i{transform:scale(1.1)}.dropdown-menu .dropdown-item:active{background:var(--bs-table-hover-bg, #e9ecef);transform:scale(.98)}@keyframes slideInItem{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@media(max-width:480px){.bottom-nav-item span{font-size:10px}.bottom-nav-item i{font-size:18px}.dropdown-menu{min-width:220px}.dropdown-menu .dropdown-item{padding:12px 14px;font-size:10px}}@media(max-width:360px){.bottom-nav-item i{font-size:18px;margin-bottom:1px}.bottom-nav-item span{font-size:10px;font-weight:500}.dropdown-menu{min-width:200px}}.dropdown-overlay{position:fixed;inset:0;background:transparent;z-index:1055;display:none}.dropdown-overlay.active{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
545
|
+
}
|
|
546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: BottomNavigationComponent, decorators: [{
|
|
547
|
+
type: Component,
|
|
548
|
+
args: [{ selector: 'app-bottom-navigation', imports: [CommonModule], template: "<nav class=\"bottom-nav\" [class.visible]=\"isVisible()\">\r\n @for (item of menuItems(); track $index) {\r\n @if (item.type == 'dropdown') {\r\n <div class=\"bottom-nav-dropdown\">\r\n <button class=\"bottom-nav-item\" [class.active]=\"activeDropdown() === $index\"\r\n (click)=\"toggleDropdown($index, $event)\">\r\n <i [class]=\"item.icon\"></i>\r\n <span>{{ item.label }}</span>\r\n </button>\r\n\r\n @if (activeDropdown() == $index) {\r\n <div class=\"dropdown-menu show\" (click)=\"onDropdownClick($event)\">\r\n @for (subItem of item.items; track subItem.label; let last = $last; let first = $first) {\r\n\r\n <button class=\"dropdown-item\"\r\n [ngClass]=\"{'border-top-radius': first, 'border-bottom-radius': last}\"\r\n (click)=\"onSubItemClick(subItem, $event)\">\r\n\r\n <i [class]=\"subItem.icon\" class=\"me-2\"></i>\r\n <span class=\"flex-grow-1\">{{ subItem.label }}</span>\r\n\r\n @if (subItem.value) {\r\n <span class=\"fw-semibold ms-2\">{{ subItem.value }}</span>\r\n }\r\n </button>\r\n\r\n }\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <button class=\"bottom-nav-item\" [class.active]=\"item.active\" (click)=\"onItemClick($index, item, $event)\">\r\n <i [class]=\"item.icon\"></i>\r\n <span>{{ item.label }}</span>\r\n </button>\r\n }\r\n }\r\n</nav>\r\n", styles: [".bottom-nav{position:fixed;bottom:0;left:0;right:0;background:var(--sidebar-bg, #ffffff);box-shadow:0 -2px 10px #0000001a;display:flex;justify-content:space-evenly;align-items:center;padding:8px 12px;z-index:1050;border-top:1px solid var(--font-border-input, #e0e0e0);transform:translateY(100%);transition:transform .3s cubic-bezier(.4,0,.2,1);height:60px}.bottom-nav.visible{transform:translateY(0)}@media(min-width:1192px){.bottom-nav{display:none}}.bottom-nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;background:none;border:none;padding:4px 2px;cursor:pointer;color:var(--sidebar-text-color, #666);transition:all .2s ease;border-radius:8px;flex:1;min-width:0;max-width:none;position:relative}.bottom-nav-item i{font-size:20px;margin-bottom:2px;transition:transform .2s cubic-bezier(.4,0,.2,1)}.bottom-nav-item span{font-size:11px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.bottom-nav-item:active{background:var(--bs-table-hover-bg, #f0f0f0);transform:scale(.95)}.bottom-nav-item.active{color:#398bf7}.bottom-nav-item.active i{transform:translateY(-2px)}.bottom-nav-dropdown{position:static;flex:1;display:flex;justify-content:center}.dropdown-menu{position:fixed;bottom:52px;left:50%;transform:translate(-50%) scale(.9);transform-origin:bottom center;background:var(--background-card, #ffffff);border:1px solid var(--border-color-modal, #dee2e6);border-radius:16px;padding:0;min-width:260px;max-width:90%;max-height:70vh;box-shadow:0 -4px 20px #00000026;z-index:1060;margin-bottom:10px;opacity:0;visibility:hidden;transition:all .25s cubic-bezier(.4,0,.2,1);pointer-events:none;overflow:hidden}.dropdown-menu.show{opacity:1;visibility:visible;transform:translate(-50%) scale(1);pointer-events:auto}.dropdown-menu .dropdown-item{display:flex;align-items:center;padding:14px 16px;font-size:10px;color:var(--text-color, #333);background:none;border:none;width:100%;text-align:left;border-bottom:1px solid var(--border-color-modal, #f0f0f0);opacity:0;transform:translateY(10px);animation:slideInItem .2s cubic-bezier(.4,0,.2,1) forwards;animation-delay:calc(.03s * var(--item-index, 0))}.dropdown-menu .dropdown-item:last-child{border-bottom:none}.dropdown-menu .dropdown-item i{width:24px;font-size:12px;transition:transform .2s ease}.dropdown-menu .dropdown-item:hover{background:var(--bs-table-hover-bg, #f8f9fa)}.dropdown-menu .dropdown-item:hover i{transform:scale(1.1)}.dropdown-menu .dropdown-item:active{background:var(--bs-table-hover-bg, #e9ecef);transform:scale(.98)}@keyframes slideInItem{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@media(max-width:480px){.bottom-nav-item span{font-size:10px}.bottom-nav-item i{font-size:18px}.dropdown-menu{min-width:220px}.dropdown-menu .dropdown-item{padding:12px 14px;font-size:10px}}@media(max-width:360px){.bottom-nav-item i{font-size:18px;margin-bottom:1px}.bottom-nav-item span{font-size:10px;font-weight:500}.dropdown-menu{min-width:200px}}.dropdown-overlay{position:fixed;inset:0;background:transparent;z-index:1055;display:none}.dropdown-overlay.active{display:block}\n"] }]
|
|
549
|
+
}], propDecorators: { onDocumentClick: [{
|
|
550
|
+
type: HostListener,
|
|
551
|
+
args: ['document:click']
|
|
552
|
+
}] } });
|
|
553
|
+
|
|
554
|
+
class VerticalHeaderComponent {
|
|
555
|
+
headerContainerRef;
|
|
556
|
+
headerSideStartRef;
|
|
557
|
+
headerSideEndRef;
|
|
558
|
+
compactSearchWrapperRef;
|
|
559
|
+
// Buscador centrado: se contrae a "F2" apenas su hueco (280px, centrado)
|
|
560
|
+
// choca con el título/módulo de la izquierda o con los íconos de la derecha,
|
|
561
|
+
// en vez de depender de un breakpoint fijo.
|
|
562
|
+
static SEARCH_WIDTH = 280;
|
|
563
|
+
static SEARCH_GAP = 16;
|
|
564
|
+
searchCollapsed = signal(false);
|
|
565
|
+
resizeObserver;
|
|
566
|
+
ngZone = inject(NgZone);
|
|
567
|
+
router = inject(Router);
|
|
568
|
+
tabsService = inject(TabsService);
|
|
569
|
+
actions = input([]);
|
|
570
|
+
// Algunas apps solo muestran el buscador global a ciertos roles.
|
|
571
|
+
showSearch = input(true);
|
|
572
|
+
themes = input([
|
|
573
|
+
{ id: 'light', icon: 'fa-sun', label: 'Claro' },
|
|
574
|
+
{ id: 'dark', icon: 'fa-moon', label: 'Oscuro' },
|
|
575
|
+
{ id: 'sky-blue', icon: 'fa-cloud', label: 'Sky Blue' },
|
|
576
|
+
{ id: 'system', icon: 'fa-desktop', label: 'Sistema' },
|
|
577
|
+
]);
|
|
578
|
+
showThemeSwitcher = input(true);
|
|
579
|
+
showTabs = input(true);
|
|
580
|
+
// Notificaciones: estándar en todas las apps TSI, ícono y estilo fijos —
|
|
581
|
+
// el consumidor solo decide si se muestra y provee el contador y el click.
|
|
582
|
+
showNotifications = input(false);
|
|
583
|
+
notificationsCount = input(0);
|
|
584
|
+
notificationsClick = output();
|
|
585
|
+
/** Opt-in: además de en el header, refleja las notificaciones en el bottom-nav (mobile). Por defecto no baja (igual que en consults). */
|
|
586
|
+
notificationsInBottomNav = input(false);
|
|
587
|
+
// Soporte (chatbot): ídem, ícono y estilo fijos — el consumidor solo
|
|
588
|
+
// decide si está disponible y controla su visibilidad.
|
|
589
|
+
showChatbotToggle = input(false);
|
|
590
|
+
chatbotVisible = input(false);
|
|
591
|
+
chatbotVisibleChange = output();
|
|
592
|
+
/** Opt-in: además de en el header, refleja el toggle de soporte en el bottom-nav (mobile). Por defecto no baja. */
|
|
593
|
+
chatbotInBottomNav = input(false);
|
|
594
|
+
currentTheme = input('light');
|
|
595
|
+
themeChange = output();
|
|
596
|
+
// Espejo de las acciones del header hacia el bottom-nav (mobile): mismo dato,
|
|
597
|
+
// sin listas separadas — cada pieza (notificaciones, soporte, acciones) decide
|
|
598
|
+
// por su cuenta si además de en el header se refleja acá.
|
|
599
|
+
bottomNavItems = computed(() => {
|
|
600
|
+
const items = [];
|
|
601
|
+
if (this.showNotifications() && this.notificationsInBottomNav()) {
|
|
602
|
+
items.push({
|
|
603
|
+
icon: 'fas fa-bell',
|
|
604
|
+
label: this.notificationsCount() > 0 ? `Notificaciones (${this.notificationsCount()})` : 'Notificaciones',
|
|
605
|
+
action: () => this.notificationsClick.emit(),
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
if (this.showChatbotToggle() && this.chatbotInBottomNav()) {
|
|
609
|
+
items.push({
|
|
610
|
+
icon: 'fas fa-robot',
|
|
611
|
+
label: this.chatbotVisible() ? 'Ocultar soporte' : 'Mostrar soporte',
|
|
612
|
+
action: () => this.chatbotVisibleChange.emit(!this.chatbotVisible()),
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
for (const action of this.actions()) {
|
|
616
|
+
if (action.hidden || !action.showInBottomNav)
|
|
617
|
+
continue;
|
|
618
|
+
if (action.items?.length) {
|
|
619
|
+
items.push({
|
|
620
|
+
icon: action.icon,
|
|
621
|
+
label: action.label,
|
|
622
|
+
type: 'dropdown',
|
|
623
|
+
items: action.items.map(i => ({ icon: i.icon, label: i.label, action: i.accion })),
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
else if (action.accion) {
|
|
627
|
+
items.push({ icon: action.icon, label: action.label, action: action.accion });
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return items;
|
|
631
|
+
});
|
|
632
|
+
themeIcon = computed(() => this.themes().find(item => item.id === this.currentTheme())?.icon ?? 'fa-palette');
|
|
633
|
+
themeLabel = computed(() => this.themes().find(item => item.id === this.currentTheme())?.label ?? 'Personalizado');
|
|
634
|
+
versionApp = input('');
|
|
635
|
+
accentColor = input('#398bf7');
|
|
636
|
+
envClass = input('prod');
|
|
637
|
+
produccion = input(false);
|
|
638
|
+
emitirToogle = output();
|
|
639
|
+
isScrolled = input(false);
|
|
640
|
+
isSidebarOpen = input(false);
|
|
641
|
+
nameProyecto = input('');
|
|
642
|
+
searchComponents = output();
|
|
643
|
+
showPanelControl = input(true);
|
|
644
|
+
panelControlClick = output();
|
|
645
|
+
logout = output();
|
|
646
|
+
// Datos de sesión: se reciben del consumidor (en vez de inyectar SesionService
|
|
647
|
+
// acá) para que layout-tsi no dependa de core-tsi.
|
|
648
|
+
userName = input('');
|
|
649
|
+
empresaName = input('');
|
|
650
|
+
tooltip = signal(null);
|
|
651
|
+
// Reemplazan a ngbDropdown (sin @ng-bootstrap acá): un dropdown nativo por
|
|
652
|
+
// click, reutilizando las clases de Bootstrap (dropdown/dropdown-menu/show)
|
|
653
|
+
// que ya vienen estilizadas — así no hace falta reimplementar el CSS.
|
|
654
|
+
openActionKey = signal(null);
|
|
655
|
+
themeMenuOpen = signal(false);
|
|
656
|
+
userMenuOpen = signal(false);
|
|
657
|
+
onDocumentClick() {
|
|
658
|
+
this.tooltip.set(null);
|
|
659
|
+
this.closeAllMenus();
|
|
660
|
+
}
|
|
661
|
+
closeAllMenus() {
|
|
662
|
+
this.openActionKey.set(null);
|
|
663
|
+
this.themeMenuOpen.set(false);
|
|
664
|
+
this.userMenuOpen.set(false);
|
|
665
|
+
}
|
|
666
|
+
toggleActionMenu(event, action) {
|
|
667
|
+
event.stopPropagation();
|
|
668
|
+
const opening = this.openActionKey() !== action.label;
|
|
669
|
+
this.closeAllMenus();
|
|
670
|
+
this.openActionKey.set(opening ? action.label : null);
|
|
671
|
+
}
|
|
672
|
+
runAction(item) {
|
|
673
|
+
this.openActionKey.set(null);
|
|
674
|
+
item.accion();
|
|
675
|
+
}
|
|
676
|
+
toggleThemeMenu(event) {
|
|
677
|
+
event.stopPropagation();
|
|
678
|
+
const opening = !this.themeMenuOpen();
|
|
679
|
+
this.closeAllMenus();
|
|
680
|
+
this.themeMenuOpen.set(opening);
|
|
681
|
+
}
|
|
682
|
+
selectTheme(id) {
|
|
683
|
+
this.themeMenuOpen.set(false);
|
|
684
|
+
this.themeChange.emit(id);
|
|
685
|
+
}
|
|
686
|
+
toggleUserMenu(event) {
|
|
687
|
+
event.stopPropagation();
|
|
688
|
+
const opening = !this.userMenuOpen();
|
|
689
|
+
this.closeAllMenus();
|
|
690
|
+
this.userMenuOpen.set(opening);
|
|
691
|
+
}
|
|
692
|
+
showTooltip(event, text) {
|
|
693
|
+
if (!text)
|
|
694
|
+
return;
|
|
695
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
696
|
+
this.tooltip.set({ text, x: rect.right + 4, y: rect.top + rect.height / 2 });
|
|
697
|
+
}
|
|
698
|
+
hideTooltip() { this.tooltip.set(null); }
|
|
699
|
+
// Ningún atajo de teclado se define acá (ni F2 ni ninguno con `key`): todos
|
|
700
|
+
// viven en el wrapper del consumidor con su propio keydown listener, todos
|
|
701
|
+
// por igual — evita mezclar guards de rol/hasOpenModals en dos lugares.
|
|
702
|
+
goToHome() { this.router.navigate(['/atajos']); }
|
|
703
|
+
ngAfterViewInit() {
|
|
704
|
+
// ResizeObserver corre fuera de la zona de Angular (no está parcheado por
|
|
705
|
+
// zone.js), así que sin ngZone.run() el signal se actualiza pero la vista
|
|
706
|
+
// no se refresca hasta que algo más dispare un ciclo de detección.
|
|
707
|
+
this.resizeObserver = new ResizeObserver(() => this.ngZone.run(() => this.updateSearchCollapse()));
|
|
708
|
+
this.resizeObserver.observe(this.headerContainerRef.nativeElement);
|
|
709
|
+
this.resizeObserver.observe(this.headerSideStartRef.nativeElement);
|
|
710
|
+
this.resizeObserver.observe(this.headerSideEndRef.nativeElement);
|
|
711
|
+
this.updateSearchCollapse();
|
|
712
|
+
}
|
|
713
|
+
ngOnDestroy() {
|
|
714
|
+
this.resizeObserver?.disconnect();
|
|
715
|
+
}
|
|
716
|
+
updateSearchCollapse() {
|
|
717
|
+
const containerRect = this.headerContainerRef.nativeElement.getBoundingClientRect();
|
|
718
|
+
const startRect = this.headerSideStartRef.nativeElement.getBoundingClientRect();
|
|
719
|
+
const endRect = this.headerSideEndRef.nativeElement.getBoundingClientRect();
|
|
720
|
+
// El botón compacto "F2" solo existe cuando ya está colapsado, así que su
|
|
721
|
+
// propio ancho no debe contar para decidir si hay que colapsar — si no,
|
|
722
|
+
// aparecer empuja el límite derecho y el estado queda pegado en "colapsado".
|
|
723
|
+
const compactWidth = this.compactSearchWrapperRef?.nativeElement.getBoundingClientRect().width ?? 0;
|
|
724
|
+
const half = VerticalHeaderComponent.SEARCH_WIDTH / 2;
|
|
725
|
+
const gap = VerticalHeaderComponent.SEARCH_GAP;
|
|
726
|
+
const center = containerRect.left + containerRect.width / 2;
|
|
727
|
+
const searchLeft = center - half;
|
|
728
|
+
const searchRight = center + half;
|
|
729
|
+
const endLeft = endRect.left + compactWidth;
|
|
730
|
+
// Por debajo de md (768px) el buscador centrado ya está oculto por Bootstrap
|
|
731
|
+
// (d-md-flex) sin importar si hay colisión real — así que el ícono compacto
|
|
732
|
+
// tiene que quedar como colapsado ahí sí o sí, no solo cuando choca.
|
|
733
|
+
const belowMd = containerRect.width < 768;
|
|
734
|
+
const collides = belowMd || (startRect.right + gap > searchLeft) || (searchRight + gap > endLeft);
|
|
735
|
+
if (collides !== this.searchCollapsed())
|
|
736
|
+
this.searchCollapsed.set(collides);
|
|
737
|
+
}
|
|
738
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: VerticalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: VerticalHeaderComponent, isStandalone: true, selector: "app-vertical-header", inputs: { actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, showSearch: { classPropertyName: "showSearch", publicName: "showSearch", isSignal: true, isRequired: false, transformFunction: null }, themes: { classPropertyName: "themes", publicName: "themes", isSignal: true, isRequired: false, transformFunction: null }, showThemeSwitcher: { classPropertyName: "showThemeSwitcher", publicName: "showThemeSwitcher", isSignal: true, isRequired: false, transformFunction: null }, showTabs: { classPropertyName: "showTabs", publicName: "showTabs", isSignal: true, isRequired: false, transformFunction: null }, showNotifications: { classPropertyName: "showNotifications", publicName: "showNotifications", isSignal: true, isRequired: false, transformFunction: null }, notificationsCount: { classPropertyName: "notificationsCount", publicName: "notificationsCount", isSignal: true, isRequired: false, transformFunction: null }, notificationsInBottomNav: { classPropertyName: "notificationsInBottomNav", publicName: "notificationsInBottomNav", isSignal: true, isRequired: false, transformFunction: null }, showChatbotToggle: { classPropertyName: "showChatbotToggle", publicName: "showChatbotToggle", isSignal: true, isRequired: false, transformFunction: null }, chatbotVisible: { classPropertyName: "chatbotVisible", publicName: "chatbotVisible", isSignal: true, isRequired: false, transformFunction: null }, chatbotInBottomNav: { classPropertyName: "chatbotInBottomNav", publicName: "chatbotInBottomNav", isSignal: true, isRequired: false, transformFunction: null }, currentTheme: { classPropertyName: "currentTheme", publicName: "currentTheme", isSignal: true, isRequired: false, transformFunction: null }, versionApp: { classPropertyName: "versionApp", publicName: "versionApp", isSignal: true, isRequired: false, transformFunction: null }, accentColor: { classPropertyName: "accentColor", publicName: "accentColor", isSignal: true, isRequired: false, transformFunction: null }, envClass: { classPropertyName: "envClass", publicName: "envClass", isSignal: true, isRequired: false, transformFunction: null }, produccion: { classPropertyName: "produccion", publicName: "produccion", isSignal: true, isRequired: false, transformFunction: null }, isScrolled: { classPropertyName: "isScrolled", publicName: "isScrolled", isSignal: true, isRequired: false, transformFunction: null }, isSidebarOpen: { classPropertyName: "isSidebarOpen", publicName: "isSidebarOpen", isSignal: true, isRequired: false, transformFunction: null }, nameProyecto: { classPropertyName: "nameProyecto", publicName: "nameProyecto", isSignal: true, isRequired: false, transformFunction: null }, showPanelControl: { classPropertyName: "showPanelControl", publicName: "showPanelControl", isSignal: true, isRequired: false, transformFunction: null }, userName: { classPropertyName: "userName", publicName: "userName", isSignal: true, isRequired: false, transformFunction: null }, empresaName: { classPropertyName: "empresaName", publicName: "empresaName", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { notificationsClick: "notificationsClick", chatbotVisibleChange: "chatbotVisibleChange", themeChange: "themeChange", emitirToogle: "emitirToogle", searchComponents: "searchComponents", panelControlClick: "panelControlClick", logout: "logout" }, host: { listeners: { "document:click": "onDocumentClick()" } }, viewQueries: [{ propertyName: "headerContainerRef", first: true, predicate: ["headerContainer"], descendants: true }, { propertyName: "headerSideStartRef", first: true, predicate: ["headerSideStart"], descendants: true }, { propertyName: "headerSideEndRef", first: true, predicate: ["headerSideEnd"], descendants: true }, { propertyName: "compactSearchWrapperRef", first: true, predicate: ["compactSearchWrapper"], descendants: true }], ngImport: i0, template: "<div #headerContainer class=\"d-flex header-container\" [ngClass]=\"envClass()\">\r\n <div class=\"first-header d-none d-md-flex\">\r\n <img src=\"assets/images/logo-tsi-tres.png\" width=\"40px\" height=\"40px\" style=\"cursor:pointer\"\r\n (click)=\"goToHome()\" title=\"Ir a Home\">\r\n <span class=\"text-white empresa-nombre ps-2\" [title]=\"versionApp()\">{{empresaName()}}</span>\r\n </div>\r\n\r\n <div class=\"d-flex w-100 h-100 justify-content-between align-items-center pe-3 ps-0\">\r\n <div #headerSideStart class=\"d-flex align-items-center header-side\">\r\n <button class=\"btn text-white none-style sidebar-toggle-btn\" (click)=\"emitirToogle.emit()\">\r\n <i class=\"fa-solid fa-table-columns\" [class.flipped]=\"isSidebarOpen()\"></i>\r\n <i class=\"fa-solid fa-chevron-left toggle-arrow\" [class.flipped]=\"isSidebarOpen()\"></i>\r\n </button>\r\n <span class=\"text-white empresa-nombre d-inline d-md-none ps-2\">{{empresaName()}}</span>\r\n <span class=\"text-white fs-5 fw-normal d-none d-md-inline ps-2 text-nowrap\">{{nameProyecto()}}</span>\r\n @if (showTabs() && tabsService.tabs().length) {\r\n <button class=\"tabs-header-btn mx-2 d-none d-md-flex\"\r\n [class.tabs-header-btn--active]=\"tabsService.visible()\" (click)=\"tabsService.toggleVisible()\"\r\n [title]=\"tabsService.visible() ? 'Ocultar acceso r\u00E1pido' : 'Mostrar acceso r\u00E1pido'\">\r\n <i class=\"fas fa-layer-group\"></i>\r\n @if (!tabsService.visible()) {\r\n <span class=\"tabs-header-count\">{{ tabsService.tabs().length }}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (showSearch()) {\r\n <button class=\"global-search-trigger d-none d-md-flex align-items-center\"\r\n [class.global-search-trigger--collapsed]=\"searchCollapsed()\" title=\"B\u00FAsqueda de p\u00E1ginas (F2)\"\r\n (click)=\"searchComponents.emit()\">\r\n <i class=\"fas fa-search global-search-icon\"></i>\r\n <span class=\"global-search-placeholder\">Buscar p\u00E1ginas...</span>\r\n <kbd class=\"global-search-kbd\">F2</kbd>\r\n </button>\r\n }\r\n\r\n <div #headerSideEnd class=\"d-flex align-items-center header-side header-side--end\">\r\n\r\n <!-- Fallback del buscador centrado cuando no entra (colisi\u00F3n) o en mobile\r\n (el buscador centrado se oculta por completo por debajo de md): la\r\n p\u00EDldora de texto \"F2\", igual que antes. -->\r\n <div #compactSearchWrapper class=\"h-100 d-flex align-items-center\">\r\n @if (showSearch() && searchCollapsed()) {\r\n <button class=\"global-search-compact-pill\" title=\"Buscar p\u00E1ginas (F2)\"\r\n (click)=\"searchComponents.emit()\">F2</button>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex align-items-center\">\r\n <ng-content select=\"[extra-actions]\" />\r\n\r\n <!-- Acciones adicionales, definidas por el consumidor: siempre a la izquierda\r\n de los tres fijos (tema, notificaciones, soporte). Solo se ocultan en mobile\r\n las que adem\u00E1s se reflejan en el bottom-nav (showInBottomNav) \u2014 si una acci\u00F3n\r\n no baja al bottom-nav, se queda visible ac\u00E1 para no desaparecer del todo. -->\r\n @for (action of actions(); track action.label) {\r\n @if (!action.hidden) {\r\n @if (action.items?.length) {\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"openActionKey() === action.label\" [class.desktop-only]=\"action.showInBottomNav\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" [title]=\"action.label\" (click)=\"toggleActionMenu($event, action)\">\r\n <i class=\"fas text-white\" [ngClass]=\"action.icon\"></i>\r\n </button>\r\n </div>\r\n\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0 custom-dropdown\" [class.show]=\"openActionKey() === action.label\">\r\n @for (opcion of action.items; track opcion.label; let last = $last) {\r\n <button class=\"dropdown-item py-2 fs-7 fw-4\"\r\n [ngClass]=\"{'divider-border': !last,'border-top-radius': $index == 0,'border-bottom-radius': last}\"\r\n (click)=\"runAction(opcion)\"\r\n (mouseenter)=\"showTooltip($event, opcion.title ?? '')\" (mouseleave)=\"hideTooltip()\">\r\n <i [class]=\"opcion.icon\" class=\"me-1\"></i> {{ opcion.label }}\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"h-100 d-flex align-items-center\" [class.desktop-only]=\"action.showInBottomNav\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" [title]=\"action.label\" (click)=\"action.accion?.()\">\r\n <i class=\"fas text-white\" [ngClass]=\"action.icon\"></i>\r\n @if (action.badge) {\r\n <span class=\"notification-badge\" [ngClass]=\"produccion() ? 'bg-danger' : 'bg-info'\">\r\n {{ action.badge }}\r\n </span>\r\n }\r\n </button>\r\n </div>\r\n }\r\n }\r\n }\r\n\r\n @if (showThemeSwitcher()) {\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"themeMenuOpen()\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" (click)=\"toggleThemeMenu($event)\"\r\n [title]=\"'Tema: ' + themeLabel()\">\r\n <i class=\"fas text-white\" [ngClass]=\"themeIcon()\"></i>\r\n </button>\r\n </div>\r\n\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0 custom-dropdown\" [class.show]=\"themeMenuOpen()\">\r\n @for (item of themes(); track item.id) {\r\n <button class=\"dropdown-item py-2 fs-7 fw-4 border-bottom-radius divider-border\"\r\n (click)=\"selectTheme(item.id)\">\r\n <i class=\"fas me-1\" [ngClass]=\"item.icon\"></i> {{ item.label }}\r\n @if (currentTheme() === item.id) {\r\n <i class=\"fas fa-check ms-auto text-success\"></i>\r\n }\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Notificaciones y soporte: \u00EDcono/estilo est\u00E1ndar, siempre visibles tambi\u00E9n en mobile -->\r\n @if (showNotifications()) {\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" title=\"Notificaciones\"\r\n (click)=\"notificationsClick.emit()\">\r\n <i class=\"fas fa-bell text-white\"></i>\r\n @if (notificationsCount() > 0) {\r\n <span class=\"notification-badge\" [ngClass]=\"produccion() ? 'bg-danger' : 'bg-info'\">\r\n {{ notificationsCount() }}\r\n </span>\r\n }\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (showChatbotToggle()) {\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\"\r\n [title]=\"chatbotVisible() ? 'Ocultar soporte' : 'Mostrar soporte'\"\r\n (click)=\"chatbotVisibleChange.emit(!chatbotVisible())\">\r\n <i class=\"fas fa-robot text-white\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"userMenuOpen()\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"border-0 bg-none\" (click)=\"toggleUserMenu($event)\">\r\n <img class=\"circle-icon shadow-sm\" src=\"assets/images/admin-avatar.png\" alt=\"\">\r\n </button>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0\" [class.show]=\"userMenuOpen()\">\r\n <div\r\n class=\"d-flex no-block align-items-center p-3 divider-border bg-gray-user-data border-top-radius\">\r\n <div class=\"d-flex align-items-center\">\r\n <img class=\"circle-icon shadow-sm\" src=\"assets/images/admin-avatar.png\">\r\n <div class=\"ms-2\">\r\n <p class=\"fs-7 my-0 py-0 fw-6\">{{userName()}}</p>\r\n @if (userName().startsWith('DESARROLLADOR')) {\r\n <span class=\"fs-7 fw-bold\">Desarrollador</span>\r\n } @else if (userName().startsWith('SOPORTE')) {\r\n <span class=\"fs-7 fw-bold\">Soporte</span>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n @if (showPanelControl()) {\r\n <button class=\"dropdown-item py-3 fs-7 fw-4\" (click)=\"userMenuOpen.set(false); panelControlClick.emit()\">\r\n Panel de control\r\n </button>\r\n }\r\n <button class=\"dropdown-item py-3 fs-7 fw-4 border-bottom-radius\" (click)=\"userMenuOpen.set(false); logout.emit()\"><i\r\n class=\"fas fa-power-off\"></i> Cerrar sesi\u00F3n</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if (tooltip()?.text) {\r\n<div class=\"acceso-tooltip-fixed\" [style.left.px]=\"tooltip()!.x\" [style.top.px]=\"tooltip()!.y\"\r\n [style.borderLeftColor]=\"accentColor()\" [style.--tooltip-accent]=\"accentColor()\">\r\n <span class=\"tooltip-label\">{{ tooltip()!.text.split(': ')[0] }}:</span>\r\n <span class=\"tooltip-value\" [style.color]=\"accentColor()\">{{ tooltip()!.text.split(': ')[1] }}</span>\r\n</div>\r\n}\r\n", styles: [".header-container{height:50px;display:flex;align-items:center;transition:position .5s ease-in-out,background-color .2s ease;padding:0;margin:0;position:relative;--header-accent: #398bf7;background:var(--header-accent);border-bottom:2px solid transparent}.header-container.dev{--header-accent: rgb(197, 0, 72)}.header-container.prod{--header-accent: #398bf7}.header-container.qa{--header-accent: #20c997}:host-context(.dark-mode) .header-container,:host-context(.sky-blue-mode) .header-container,:host-context(.high-contrast-green-mode) .header-container,:host-context(.purple-mode) .header-container{background:var(--header-bg);border-bottom-color:var(--header-accent)}.first-header{display:flex;align-items:center;gap:6px}.empresa-nombre{max-width:350px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.25;max-height:2.5em;max-width:100%}@media(max-width:575px){.empresa-nombre{display:none!important}.first-header{min-width:auto!important;padding:10px!important}}@media(min-width:576px)and (max-width:1180px){.first-header{padding:10px!important}}@media(min-width:1181px){.first-header{min-width:260px;width:260px;padding:15px}}.bg-gray-user-data{background:var(--background-btn-light)}.dropdown-menu{transform-origin:top;background-color:var(--background-card);border-color:var(--border-color-modal);color:var(--text-color)}.dropdown-menu-end{right:0!important;left:auto!important}.dropdown-item{color:var(--text-color)}.dropdown-item:hover,.dropdown-item:focus{background-color:var(--bs-table-hover-bg);color:var(--text-color)}.dropdown-menu.show{animation:dropdownMenuIn .24s cubic-bezier(.2,0,.2,1) both}@keyframes dropdownMenuIn{0%{opacity:0;transform:translateY(10px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}.dropdown-menu{width:300px!important;min-width:300px!important}.circle-icon{min-height:30px;min-width:30px;height:30px;width:30px;border-radius:100%;border:2px solid white}.none-style{background:none;border:none}.sidebar-toggle-btn{display:flex;align-items:center;gap:4px}.sidebar-toggle-btn i{transition:transform .25s cubic-bezier(.4,0,.2,1)}.sidebar-toggle-btn i.flipped{transform:scaleX(-1)}.sidebar-toggle-btn .toggle-arrow{font-size:9px;color:#fff}.z-index{z-index:1001}.option{position:relative;border-radius:50px;width:33px;height:100%;transition:background-color .3s ease}.option:hover,.dropdown.show .option{background-color:var(--bs-table-hover-bg)!important}.custom-dropdown.dropdown-menu{min-width:unset!important;width:auto!important}.acceso-tooltip-fixed{position:fixed;z-index:99999;transform:translateY(-50%);pointer-events:none;padding:4px 10px 4px 8px;border-radius:6px;font-family:monospace;white-space:nowrap;background:#0f0f14;border:1px solid rgba(255,255,255,.07);border-left:2px solid;display:flex;align-items:center;gap:5px;animation:tooltipFadeIn .14s cubic-bezier(.25,.46,.45,.94)}.acceso-tooltip-fixed:before{content:\"\";position:absolute;right:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-right-color:var(--tooltip-accent, #c50048)}.acceso-tooltip-fixed .tooltip-label{font-size:10px;font-weight:400;color:#fff;letter-spacing:.3px}.acceso-tooltip-fixed .tooltip-value{font-size:11px;font-weight:700}@keyframes tooltipFadeIn{0%{opacity:0;transform:translateY(-50%) translate(-4px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.btn-print{border:1px solid rgba(0,0,0,.5764705882)!important;width:33px;height:30px!important;border-radius:6px}.btn-print:hover{border:1px solid rgba(61,61,61,.5254901961)!important;background-color:#dadadaf8!important}.btn-search{width:40px;height:31px!important;border-radius:6px}.logo-btn{width:25px;height:25px;object-fit:contain}.btn-deudas{background:#fff;border-radius:20px;border:none;white-space:nowrap;flex-shrink:0}.btn-deudas.titilando{animation:bordeTitilante 1s infinite alternate}@keyframes bordeTitilante{0%{box-shadow:0 0 2px red}50%{box-shadow:0 0 5px red,0 0 5px #ff4d4d}to{box-shadow:0 0 2px red}}@media(max-width:1100px){.btn-deudas{width:31px;height:31px!important;border-radius:50px;padding:0;display:flex;align-items:center;justify-content:center;aspect-ratio:1/1}.btn-deudas .texto-deudas{display:none}.btn-deudas .logo-btn{width:20px;height:20px;margin:0}}@keyframes icon-rotate-pop{0%{transform:rotate(0) scale(1)}25%{transform:rotate(10deg) scale(1.05)}50%{transform:rotate(-10deg) scale(1.1)}75%{transform:rotate(10deg) scale(1.05)}to{transform:rotate(0) scale(1)}}.button-icon-hover{display:inline-block}.button-tilt-hover:hover .button-icon-hover{animation:icon-rotate-pop 1s ease-in-out infinite}.desktop-only{display:flex}@media(max-width:667px){.desktop-only{display:none!important}}.notification-btn{position:relative;border:none;background:none;padding:0;margin-right:8px;cursor:pointer;width:33px;height:32px;display:flex;align-items:center;justify-content:center}.notification-btn i{color:#fff}.notification-badge{position:absolute;top:-5px;right:-3px;color:#fff;font-size:11px;font-weight:600;border-radius:4px;min-width:18px;height:18px;display:flex;align-items:center;justify-content:center;padding:0 4px}.header-side{flex:0 1 auto;min-width:0}.header-side--end{justify-content:flex-end}.global-search-trigger{position:absolute;left:50%;transform:translate(-50%);z-index:2;align-self:center;flex-shrink:0;margin:0;gap:8px;height:31px;width:280px;padding:0 6px 0 12px;background:#ffffff26;border:1px solid rgba(255,255,255,.3);border-radius:6px;color:#ffffffe6;font-size:12px;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}.global-search-trigger:hover,.global-search-trigger:focus-visible{background:#ffffff47;border-color:#ffffff80;color:#fff}.global-search-trigger .global-search-icon{font-size:12px;color:#ffffffbf}.global-search-trigger .global-search-placeholder{flex-grow:1;text-align:start}.global-search-trigger .global-search-kbd{font-size:10px;font-weight:600;line-height:1;padding:3px 5px;border-radius:4px;background:#fff3;border:1px solid rgba(255,255,255,.35);color:#fff}.global-search-trigger--collapsed{display:none!important}.global-search-compact-pill{display:flex;align-items:center;justify-content:center;height:31px;margin-right:8px;padding:0 9px;background:#ffffff26;border:1px solid rgba(255,255,255,.3);border-radius:6px;color:#ffffffe6;font-size:11px;font-weight:700;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.global-search-compact-pill:hover,.global-search-compact-pill:focus-visible{background:#ffffff47;border-color:#ffffff80;color:#fff}.tabs-header-btn{display:flex;align-items:center;gap:4px;background:#ffffff1a;border:1px solid rgba(255,255,255,.15);color:#fff9;border-radius:20px;padding:3px 8px;font-size:11px;cursor:pointer;transition:background .15s,color .15s;white-space:nowrap}.tabs-header-btn:hover{background:#fff3;color:#fff}.tabs-header-btn--active{background:#ffffff2e;color:#fff;border-color:#ffffff4d}.tabs-header-btn i{font-size:12px}.tabs-header-count{font-weight:700;font-size:11px;background:#fff3;border-radius:10px;padding:0 5px;min-width:16px;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
740
|
+
}
|
|
741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: VerticalHeaderComponent, decorators: [{
|
|
742
|
+
type: Component,
|
|
743
|
+
args: [{ selector: 'app-vertical-header', imports: [CommonModule], template: "<div #headerContainer class=\"d-flex header-container\" [ngClass]=\"envClass()\">\r\n <div class=\"first-header d-none d-md-flex\">\r\n <img src=\"assets/images/logo-tsi-tres.png\" width=\"40px\" height=\"40px\" style=\"cursor:pointer\"\r\n (click)=\"goToHome()\" title=\"Ir a Home\">\r\n <span class=\"text-white empresa-nombre ps-2\" [title]=\"versionApp()\">{{empresaName()}}</span>\r\n </div>\r\n\r\n <div class=\"d-flex w-100 h-100 justify-content-between align-items-center pe-3 ps-0\">\r\n <div #headerSideStart class=\"d-flex align-items-center header-side\">\r\n <button class=\"btn text-white none-style sidebar-toggle-btn\" (click)=\"emitirToogle.emit()\">\r\n <i class=\"fa-solid fa-table-columns\" [class.flipped]=\"isSidebarOpen()\"></i>\r\n <i class=\"fa-solid fa-chevron-left toggle-arrow\" [class.flipped]=\"isSidebarOpen()\"></i>\r\n </button>\r\n <span class=\"text-white empresa-nombre d-inline d-md-none ps-2\">{{empresaName()}}</span>\r\n <span class=\"text-white fs-5 fw-normal d-none d-md-inline ps-2 text-nowrap\">{{nameProyecto()}}</span>\r\n @if (showTabs() && tabsService.tabs().length) {\r\n <button class=\"tabs-header-btn mx-2 d-none d-md-flex\"\r\n [class.tabs-header-btn--active]=\"tabsService.visible()\" (click)=\"tabsService.toggleVisible()\"\r\n [title]=\"tabsService.visible() ? 'Ocultar acceso r\u00E1pido' : 'Mostrar acceso r\u00E1pido'\">\r\n <i class=\"fas fa-layer-group\"></i>\r\n @if (!tabsService.visible()) {\r\n <span class=\"tabs-header-count\">{{ tabsService.tabs().length }}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (showSearch()) {\r\n <button class=\"global-search-trigger d-none d-md-flex align-items-center\"\r\n [class.global-search-trigger--collapsed]=\"searchCollapsed()\" title=\"B\u00FAsqueda de p\u00E1ginas (F2)\"\r\n (click)=\"searchComponents.emit()\">\r\n <i class=\"fas fa-search global-search-icon\"></i>\r\n <span class=\"global-search-placeholder\">Buscar p\u00E1ginas...</span>\r\n <kbd class=\"global-search-kbd\">F2</kbd>\r\n </button>\r\n }\r\n\r\n <div #headerSideEnd class=\"d-flex align-items-center header-side header-side--end\">\r\n\r\n <!-- Fallback del buscador centrado cuando no entra (colisi\u00F3n) o en mobile\r\n (el buscador centrado se oculta por completo por debajo de md): la\r\n p\u00EDldora de texto \"F2\", igual que antes. -->\r\n <div #compactSearchWrapper class=\"h-100 d-flex align-items-center\">\r\n @if (showSearch() && searchCollapsed()) {\r\n <button class=\"global-search-compact-pill\" title=\"Buscar p\u00E1ginas (F2)\"\r\n (click)=\"searchComponents.emit()\">F2</button>\r\n }\r\n </div>\r\n\r\n <div class=\"d-flex align-items-center\">\r\n <ng-content select=\"[extra-actions]\" />\r\n\r\n <!-- Acciones adicionales, definidas por el consumidor: siempre a la izquierda\r\n de los tres fijos (tema, notificaciones, soporte). Solo se ocultan en mobile\r\n las que adem\u00E1s se reflejan en el bottom-nav (showInBottomNav) \u2014 si una acci\u00F3n\r\n no baja al bottom-nav, se queda visible ac\u00E1 para no desaparecer del todo. -->\r\n @for (action of actions(); track action.label) {\r\n @if (!action.hidden) {\r\n @if (action.items?.length) {\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"openActionKey() === action.label\" [class.desktop-only]=\"action.showInBottomNav\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" [title]=\"action.label\" (click)=\"toggleActionMenu($event, action)\">\r\n <i class=\"fas text-white\" [ngClass]=\"action.icon\"></i>\r\n </button>\r\n </div>\r\n\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0 custom-dropdown\" [class.show]=\"openActionKey() === action.label\">\r\n @for (opcion of action.items; track opcion.label; let last = $last) {\r\n <button class=\"dropdown-item py-2 fs-7 fw-4\"\r\n [ngClass]=\"{'divider-border': !last,'border-top-radius': $index == 0,'border-bottom-radius': last}\"\r\n (click)=\"runAction(opcion)\"\r\n (mouseenter)=\"showTooltip($event, opcion.title ?? '')\" (mouseleave)=\"hideTooltip()\">\r\n <i [class]=\"opcion.icon\" class=\"me-1\"></i> {{ opcion.label }}\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n } @else {\r\n <div class=\"h-100 d-flex align-items-center\" [class.desktop-only]=\"action.showInBottomNav\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" [title]=\"action.label\" (click)=\"action.accion?.()\">\r\n <i class=\"fas text-white\" [ngClass]=\"action.icon\"></i>\r\n @if (action.badge) {\r\n <span class=\"notification-badge\" [ngClass]=\"produccion() ? 'bg-danger' : 'bg-info'\">\r\n {{ action.badge }}\r\n </span>\r\n }\r\n </button>\r\n </div>\r\n }\r\n }\r\n }\r\n\r\n @if (showThemeSwitcher()) {\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"themeMenuOpen()\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" (click)=\"toggleThemeMenu($event)\"\r\n [title]=\"'Tema: ' + themeLabel()\">\r\n <i class=\"fas text-white\" [ngClass]=\"themeIcon()\"></i>\r\n </button>\r\n </div>\r\n\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0 custom-dropdown\" [class.show]=\"themeMenuOpen()\">\r\n @for (item of themes(); track item.id) {\r\n <button class=\"dropdown-item py-2 fs-7 fw-4 border-bottom-radius divider-border\"\r\n (click)=\"selectTheme(item.id)\">\r\n <i class=\"fas me-1\" [ngClass]=\"item.icon\"></i> {{ item.label }}\r\n @if (currentTheme() === item.id) {\r\n <i class=\"fas fa-check ms-auto text-success\"></i>\r\n }\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- Notificaciones y soporte: \u00EDcono/estilo est\u00E1ndar, siempre visibles tambi\u00E9n en mobile -->\r\n @if (showNotifications()) {\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\" title=\"Notificaciones\"\r\n (click)=\"notificationsClick.emit()\">\r\n <i class=\"fas fa-bell text-white\"></i>\r\n @if (notificationsCount() > 0) {\r\n <span class=\"notification-badge\" [ngClass]=\"produccion() ? 'bg-danger' : 'bg-info'\">\r\n {{ notificationsCount() }}\r\n </span>\r\n }\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (showChatbotToggle()) {\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"notification-btn option p-0 m-0 me-2\"\r\n [title]=\"chatbotVisible() ? 'Ocultar soporte' : 'Mostrar soporte'\"\r\n (click)=\"chatbotVisibleChange.emit(!chatbotVisible())\">\r\n <i class=\"fas fa-robot text-white\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"dropdown d-inline-block z-index\" [class.show]=\"userMenuOpen()\">\r\n <div class=\"h-100 d-flex align-items-center\">\r\n <button class=\"border-0 bg-none\" (click)=\"toggleUserMenu($event)\">\r\n <img class=\"circle-icon shadow-sm\" src=\"assets/images/admin-avatar.png\" alt=\"\">\r\n </button>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-end mtp-9 mb-0 py-0\" [class.show]=\"userMenuOpen()\">\r\n <div\r\n class=\"d-flex no-block align-items-center p-3 divider-border bg-gray-user-data border-top-radius\">\r\n <div class=\"d-flex align-items-center\">\r\n <img class=\"circle-icon shadow-sm\" src=\"assets/images/admin-avatar.png\">\r\n <div class=\"ms-2\">\r\n <p class=\"fs-7 my-0 py-0 fw-6\">{{userName()}}</p>\r\n @if (userName().startsWith('DESARROLLADOR')) {\r\n <span class=\"fs-7 fw-bold\">Desarrollador</span>\r\n } @else if (userName().startsWith('SOPORTE')) {\r\n <span class=\"fs-7 fw-bold\">Soporte</span>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n @if (showPanelControl()) {\r\n <button class=\"dropdown-item py-3 fs-7 fw-4\" (click)=\"userMenuOpen.set(false); panelControlClick.emit()\">\r\n Panel de control\r\n </button>\r\n }\r\n <button class=\"dropdown-item py-3 fs-7 fw-4 border-bottom-radius\" (click)=\"userMenuOpen.set(false); logout.emit()\"><i\r\n class=\"fas fa-power-off\"></i> Cerrar sesi\u00F3n</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if (tooltip()?.text) {\r\n<div class=\"acceso-tooltip-fixed\" [style.left.px]=\"tooltip()!.x\" [style.top.px]=\"tooltip()!.y\"\r\n [style.borderLeftColor]=\"accentColor()\" [style.--tooltip-accent]=\"accentColor()\">\r\n <span class=\"tooltip-label\">{{ tooltip()!.text.split(': ')[0] }}:</span>\r\n <span class=\"tooltip-value\" [style.color]=\"accentColor()\">{{ tooltip()!.text.split(': ')[1] }}</span>\r\n</div>\r\n}\r\n", styles: [".header-container{height:50px;display:flex;align-items:center;transition:position .5s ease-in-out,background-color .2s ease;padding:0;margin:0;position:relative;--header-accent: #398bf7;background:var(--header-accent);border-bottom:2px solid transparent}.header-container.dev{--header-accent: rgb(197, 0, 72)}.header-container.prod{--header-accent: #398bf7}.header-container.qa{--header-accent: #20c997}:host-context(.dark-mode) .header-container,:host-context(.sky-blue-mode) .header-container,:host-context(.high-contrast-green-mode) .header-container,:host-context(.purple-mode) .header-container{background:var(--header-bg);border-bottom-color:var(--header-accent)}.first-header{display:flex;align-items:center;gap:6px}.empresa-nombre{max-width:350px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;white-space:normal;line-height:1.25;max-height:2.5em;max-width:100%}@media(max-width:575px){.empresa-nombre{display:none!important}.first-header{min-width:auto!important;padding:10px!important}}@media(min-width:576px)and (max-width:1180px){.first-header{padding:10px!important}}@media(min-width:1181px){.first-header{min-width:260px;width:260px;padding:15px}}.bg-gray-user-data{background:var(--background-btn-light)}.dropdown-menu{transform-origin:top;background-color:var(--background-card);border-color:var(--border-color-modal);color:var(--text-color)}.dropdown-menu-end{right:0!important;left:auto!important}.dropdown-item{color:var(--text-color)}.dropdown-item:hover,.dropdown-item:focus{background-color:var(--bs-table-hover-bg);color:var(--text-color)}.dropdown-menu.show{animation:dropdownMenuIn .24s cubic-bezier(.2,0,.2,1) both}@keyframes dropdownMenuIn{0%{opacity:0;transform:translateY(10px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}.dropdown-menu{width:300px!important;min-width:300px!important}.circle-icon{min-height:30px;min-width:30px;height:30px;width:30px;border-radius:100%;border:2px solid white}.none-style{background:none;border:none}.sidebar-toggle-btn{display:flex;align-items:center;gap:4px}.sidebar-toggle-btn i{transition:transform .25s cubic-bezier(.4,0,.2,1)}.sidebar-toggle-btn i.flipped{transform:scaleX(-1)}.sidebar-toggle-btn .toggle-arrow{font-size:9px;color:#fff}.z-index{z-index:1001}.option{position:relative;border-radius:50px;width:33px;height:100%;transition:background-color .3s ease}.option:hover,.dropdown.show .option{background-color:var(--bs-table-hover-bg)!important}.custom-dropdown.dropdown-menu{min-width:unset!important;width:auto!important}.acceso-tooltip-fixed{position:fixed;z-index:99999;transform:translateY(-50%);pointer-events:none;padding:4px 10px 4px 8px;border-radius:6px;font-family:monospace;white-space:nowrap;background:#0f0f14;border:1px solid rgba(255,255,255,.07);border-left:2px solid;display:flex;align-items:center;gap:5px;animation:tooltipFadeIn .14s cubic-bezier(.25,.46,.45,.94)}.acceso-tooltip-fixed:before{content:\"\";position:absolute;right:100%;top:50%;transform:translateY(-50%);border:4px solid transparent;border-right-color:var(--tooltip-accent, #c50048)}.acceso-tooltip-fixed .tooltip-label{font-size:10px;font-weight:400;color:#fff;letter-spacing:.3px}.acceso-tooltip-fixed .tooltip-value{font-size:11px;font-weight:700}@keyframes tooltipFadeIn{0%{opacity:0;transform:translateY(-50%) translate(-4px)}to{opacity:1;transform:translateY(-50%) translate(0)}}.btn-print{border:1px solid rgba(0,0,0,.5764705882)!important;width:33px;height:30px!important;border-radius:6px}.btn-print:hover{border:1px solid rgba(61,61,61,.5254901961)!important;background-color:#dadadaf8!important}.btn-search{width:40px;height:31px!important;border-radius:6px}.logo-btn{width:25px;height:25px;object-fit:contain}.btn-deudas{background:#fff;border-radius:20px;border:none;white-space:nowrap;flex-shrink:0}.btn-deudas.titilando{animation:bordeTitilante 1s infinite alternate}@keyframes bordeTitilante{0%{box-shadow:0 0 2px red}50%{box-shadow:0 0 5px red,0 0 5px #ff4d4d}to{box-shadow:0 0 2px red}}@media(max-width:1100px){.btn-deudas{width:31px;height:31px!important;border-radius:50px;padding:0;display:flex;align-items:center;justify-content:center;aspect-ratio:1/1}.btn-deudas .texto-deudas{display:none}.btn-deudas .logo-btn{width:20px;height:20px;margin:0}}@keyframes icon-rotate-pop{0%{transform:rotate(0) scale(1)}25%{transform:rotate(10deg) scale(1.05)}50%{transform:rotate(-10deg) scale(1.1)}75%{transform:rotate(10deg) scale(1.05)}to{transform:rotate(0) scale(1)}}.button-icon-hover{display:inline-block}.button-tilt-hover:hover .button-icon-hover{animation:icon-rotate-pop 1s ease-in-out infinite}.desktop-only{display:flex}@media(max-width:667px){.desktop-only{display:none!important}}.notification-btn{position:relative;border:none;background:none;padding:0;margin-right:8px;cursor:pointer;width:33px;height:32px;display:flex;align-items:center;justify-content:center}.notification-btn i{color:#fff}.notification-badge{position:absolute;top:-5px;right:-3px;color:#fff;font-size:11px;font-weight:600;border-radius:4px;min-width:18px;height:18px;display:flex;align-items:center;justify-content:center;padding:0 4px}.header-side{flex:0 1 auto;min-width:0}.header-side--end{justify-content:flex-end}.global-search-trigger{position:absolute;left:50%;transform:translate(-50%);z-index:2;align-self:center;flex-shrink:0;margin:0;gap:8px;height:31px;width:280px;padding:0 6px 0 12px;background:#ffffff26;border:1px solid rgba(255,255,255,.3);border-radius:6px;color:#ffffffe6;font-size:12px;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}.global-search-trigger:hover,.global-search-trigger:focus-visible{background:#ffffff47;border-color:#ffffff80;color:#fff}.global-search-trigger .global-search-icon{font-size:12px;color:#ffffffbf}.global-search-trigger .global-search-placeholder{flex-grow:1;text-align:start}.global-search-trigger .global-search-kbd{font-size:10px;font-weight:600;line-height:1;padding:3px 5px;border-radius:4px;background:#fff3;border:1px solid rgba(255,255,255,.35);color:#fff}.global-search-trigger--collapsed{display:none!important}.global-search-compact-pill{display:flex;align-items:center;justify-content:center;height:31px;margin-right:8px;padding:0 9px;background:#ffffff26;border:1px solid rgba(255,255,255,.3);border-radius:6px;color:#ffffffe6;font-size:11px;font-weight:700;cursor:pointer;transition:background .15s,border-color .15s,color .15s}.global-search-compact-pill:hover,.global-search-compact-pill:focus-visible{background:#ffffff47;border-color:#ffffff80;color:#fff}.tabs-header-btn{display:flex;align-items:center;gap:4px;background:#ffffff1a;border:1px solid rgba(255,255,255,.15);color:#fff9;border-radius:20px;padding:3px 8px;font-size:11px;cursor:pointer;transition:background .15s,color .15s;white-space:nowrap}.tabs-header-btn:hover{background:#fff3;color:#fff}.tabs-header-btn--active{background:#ffffff2e;color:#fff;border-color:#ffffff4d}.tabs-header-btn i{font-size:12px}.tabs-header-count{font-weight:700;font-size:11px;background:#fff3;border-radius:10px;padding:0 5px;min-width:16px;text-align:center}\n"] }]
|
|
744
|
+
}], propDecorators: { headerContainerRef: [{
|
|
745
|
+
type: ViewChild,
|
|
746
|
+
args: ['headerContainer']
|
|
747
|
+
}], headerSideStartRef: [{
|
|
748
|
+
type: ViewChild,
|
|
749
|
+
args: ['headerSideStart']
|
|
750
|
+
}], headerSideEndRef: [{
|
|
751
|
+
type: ViewChild,
|
|
752
|
+
args: ['headerSideEnd']
|
|
753
|
+
}], compactSearchWrapperRef: [{
|
|
754
|
+
type: ViewChild,
|
|
755
|
+
args: ['compactSearchWrapper']
|
|
756
|
+
}], onDocumentClick: [{
|
|
757
|
+
type: HostListener,
|
|
758
|
+
args: ['document:click']
|
|
759
|
+
}] } });
|
|
760
|
+
|
|
761
|
+
const DEFAULT_MODULE_COLORS = {
|
|
762
|
+
'Archivos': '#ea6f0a',
|
|
763
|
+
'Contabilidad': '#059669',
|
|
764
|
+
'Comercial': '#2563eb',
|
|
765
|
+
'Logística': '#9333ea',
|
|
766
|
+
'Cuentas por cobrar': '#d97706',
|
|
767
|
+
'Cuentas por pagar': '#dc2626',
|
|
768
|
+
};
|
|
769
|
+
// Duración de la animación de salida (@keyframes tabBarSlideOut en el scss):
|
|
770
|
+
// se mantiene montada este tiempo antes de desmontarla de verdad.
|
|
771
|
+
const LEAVE_DURATION_MS$1 = 160;
|
|
772
|
+
class TabBarComponent {
|
|
773
|
+
tabs = inject(TabsService);
|
|
774
|
+
// Reemplaza a @slideDown (sin @angular/animations): la salida (:leave) no
|
|
775
|
+
// tiene equivalente CSS puro porque Angular remueve el elemento del DOM al
|
|
776
|
+
// instante — acá lo mantenemos montado con una clase "--leaving" el tiempo
|
|
777
|
+
// que dura la animación de salida, y recién ahí lo desmontamos.
|
|
778
|
+
shouldShow = computed(() => this.tabs.tabs().length > 0 && this.tabs.visible());
|
|
779
|
+
rendered = signal(false);
|
|
780
|
+
leaveTimer = null;
|
|
781
|
+
constructor() {
|
|
782
|
+
effect(() => {
|
|
783
|
+
if (this.shouldShow()) {
|
|
784
|
+
if (this.leaveTimer) {
|
|
785
|
+
clearTimeout(this.leaveTimer);
|
|
786
|
+
this.leaveTimer = null;
|
|
787
|
+
}
|
|
788
|
+
this.rendered.set(true);
|
|
789
|
+
}
|
|
790
|
+
else if (this.rendered()) {
|
|
791
|
+
this.leaveTimer = setTimeout(() => this.rendered.set(false), LEAVE_DURATION_MS$1);
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
// Se combina con los colores por defecto en vez de reemplazarlos: un proyecto solo
|
|
796
|
+
// necesita pasar los módulos que quiera personalizar, el resto sigue con su color base.
|
|
797
|
+
moduleColors = input({});
|
|
798
|
+
// Tooltip nativo al hover (sin ng-bootstrap): mismo patrón fixed-position
|
|
799
|
+
// que ya usan menu-item/vertical-header en esta librería.
|
|
800
|
+
hoveredTab = signal(null);
|
|
801
|
+
tipPosition = signal({ x: 0, y: 0 });
|
|
802
|
+
hoverTimer = null;
|
|
803
|
+
getModuleColor(tab) {
|
|
804
|
+
const key = tab.moduleKey ?? tab.module ?? '';
|
|
805
|
+
return this.moduleColors()[key] ?? DEFAULT_MODULE_COLORS[key] ?? '#6b7280';
|
|
806
|
+
}
|
|
807
|
+
onTabMouseEnter(event, tab) {
|
|
808
|
+
if (this.hoverTimer)
|
|
809
|
+
clearTimeout(this.hoverTimer);
|
|
810
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
811
|
+
this.hoverTimer = setTimeout(() => {
|
|
812
|
+
this.tipPosition.set({ x: rect.left + rect.width / 2, y: rect.bottom + 8 });
|
|
813
|
+
this.hoveredTab.set(tab);
|
|
814
|
+
}, 600);
|
|
815
|
+
}
|
|
816
|
+
onTabMouseLeave() {
|
|
817
|
+
if (this.hoverTimer) {
|
|
818
|
+
clearTimeout(this.hoverTimer);
|
|
819
|
+
this.hoverTimer = null;
|
|
820
|
+
}
|
|
821
|
+
this.hoveredTab.set(null);
|
|
822
|
+
}
|
|
823
|
+
onTabMouseDown(event, tab) {
|
|
824
|
+
if (event.button === 1 && !tab.pinned) {
|
|
825
|
+
event.preventDefault();
|
|
826
|
+
this.tabs.close(tab.id, event);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TabBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
830
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: TabBarComponent, isStandalone: true, selector: "app-tab-bar", inputs: { moduleColors: { classPropertyName: "moduleColors", publicName: "moduleColors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (rendered()) {\r\n<div class=\"tab-bar\" [class.tab-bar--leaving]=\"!shouldShow()\">\r\n <div class=\"tab-list\">\r\n @for (tab of tabs.sortedTabs(); track tab.id) {\r\n\r\n <div class=\"tab\" [class.tab--active]=\"tabs.activeId() === tab.id\" [class.tab--pinned]=\"tab.pinned\"\r\n [class.tab--with-module]=\"!!tab.module\" (mouseenter)=\"onTabMouseEnter($event, tab)\" (mouseleave)=\"onTabMouseLeave()\"\r\n (click)=\"tabs.activate(tab.id)\" (mousedown)=\"onTabMouseDown($event, tab)\">\r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon + ' tab-icon'\"></i>\r\n }\r\n <div class=\"tab-body\">\r\n <span class=\"tab-title\">{{ tab.title }}</span>\r\n @if (tab.module) {\r\n <span class=\"tab-module\">\r\n <span class=\"tab-module-dot\" [style.background]=\"getModuleColor(tab)\"></span>\r\n {{ tab.module }}\r\n </span>\r\n }\r\n </div>\r\n <button class=\"tab-btn tab-pin\" [class.tab-pin--active]=\"tab.pinned\" (click)=\"tabs.togglePin(tab.id, $event)\"\r\n [title]=\"tab.pinned ? 'Desfijar' : 'Fijar'\">\r\n <i class=\"fas fa-thumbtack\"></i>\r\n </button>\r\n @if (!tab.pinned) {\r\n <button class=\"tab-btn tab-close\" (click)=\"tabs.close(tab.id, $event)\" title=\"Cerrar\">\r\n <i class=\"fas fa-times\"></i>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"tab-actions\">\r\n <button class=\"tab-close-all\" (click)=\"tabs.closeAll()\" title=\"Cerrar todas las pesta\u00F1as\">\r\n <i class=\"fas fa-times-circle\"></i>\r\n <span>Cerrar todo</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n@if (hoveredTab(); as tab) {\r\n<div class=\"tab-tip-fixed\" [style.left.px]=\"tipPosition().x\" [style.top.px]=\"tipPosition().y\">\r\n <span class=\"tab-tip-title\">{{ tab.title }}</span>\r\n @if (tab.module) {\r\n <span class=\"tab-tip-module\">\r\n <span class=\"tab-tip-dot\" [style.background]=\"getModuleColor(tab)\"></span>\r\n {{ tab.module }}\r\n </span>\r\n }\r\n</div>\r\n}\r\n}\r\n", styles: ["@media(max-width:767px){.tab-bar{display:none!important}}.tab-bar{display:flex;align-items:center;padding:4px 8px;background:var(--sidebar-bg, #0b1a3d);border-bottom:1px solid rgba(255,255,255,.1);min-height:38px;width:100%;flex-shrink:0;box-shadow:0 2px 8px #00000040;animation:tabBarSlideIn .22s cubic-bezier(.25,.46,.45,.94) both}.tab-bar--leaving{animation:tabBarSlideOut .16s ease-in both}@keyframes tabBarSlideIn{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes tabBarSlideOut{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}.tab-list{display:flex;align-items:stretch;gap:3px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}.tab-list::-webkit-scrollbar{height:2px}.tab-list::-webkit-scrollbar-track{background:transparent}.tab-list::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.tab{display:flex;align-items:center;gap:5px;padding:4px 8px;border-radius:5px;cursor:pointer;white-space:nowrap;font-size:12px;color:#ffffff8c;background:#ffffff0a;border:1px solid transparent;transition:background .15s,border-color .15s,color .15s;flex:1 1 0;min-width:60px;max-width:180px;overflow:hidden;-webkit-user-select:none;user-select:none}.tab--with-module{align-items:flex-start;padding-top:5px;padding-bottom:5px}.tab:hover{background:#ffffff17;color:#fffc}.tab:hover .tab-pin{opacity:.5}.tab--active{background:#398bf726;border-color:#398bf773;color:#93c5fd}.tab--pinned{border-color:#fbbf2459;background:#fbbf2412;flex:0 0 auto}.tab--pinned.tab--active{border-color:#398bf773;background:#398bf726}.tab-icon{font-size:11px;flex-shrink:0;margin-top:1px}.tab--with-module .tab-icon{margin-top:2px}.tab-body{display:flex;flex-direction:column;flex:1;min-width:0;gap:2px}.tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.tab-module{display:flex;align-items:center;gap:4px;font-size:10.5px;color:#fff9;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-module-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;align-self:center;display:block}.tab-btn{background:none;border:none;padding:0 1px;cursor:pointer;color:inherit;font-size:9px;line-height:1;display:flex;align-items:center;flex-shrink:0}.tab-pin{opacity:0;transition:opacity .15s,color .15s,transform .2s;transform:rotate(45deg)}.tab-pin--active{opacity:1!important;color:#fbbf24;transform:rotate(0)}.tab-pin:hover{opacity:1!important}.tab-close{opacity:.4}.tab-close:hover{opacity:1}.tab-actions{display:flex;align-items:center;gap:4px;padding-left:8px;border-left:1px solid rgba(255,255,255,.08);margin-left:4px;flex-shrink:0}.tab-tip-fixed{position:fixed;z-index:99999;transform:translate(-50%);pointer-events:none;padding:6px 10px;border-radius:6px;background:#0f0f14;border:1px solid rgba(255,255,255,.07);white-space:nowrap;display:flex;flex-direction:column;gap:3px;animation:tabTipFadeIn .14s ease}.tab-tip-fixed:before{content:\"\";position:absolute;bottom:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-bottom-color:#0f0f14}.tab-tip-title{font-size:11px;font-weight:600;color:#fff}.tab-tip-module{display:flex;align-items:center;gap:4px;font-size:10px;color:#ffffffa6}.tab-tip-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}@keyframes tabTipFadeIn{0%{opacity:0;transform:translate(-50%) translateY(-4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.tab-close-all{display:flex;align-items:center;gap:5px;background:none;border:none;cursor:pointer;color:#fff6;font-size:11px;padding:3px 6px;border-radius:4px;white-space:nowrap;transition:color .15s,background .15s}.tab-close-all:hover{color:#f87171;background:#f871711a}.tab-close-all i{font-size:12px}\n"] });
|
|
831
|
+
}
|
|
832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TabBarComponent, decorators: [{
|
|
833
|
+
type: Component,
|
|
834
|
+
args: [{ selector: 'app-tab-bar', imports: [], template: "@if (rendered()) {\r\n<div class=\"tab-bar\" [class.tab-bar--leaving]=\"!shouldShow()\">\r\n <div class=\"tab-list\">\r\n @for (tab of tabs.sortedTabs(); track tab.id) {\r\n\r\n <div class=\"tab\" [class.tab--active]=\"tabs.activeId() === tab.id\" [class.tab--pinned]=\"tab.pinned\"\r\n [class.tab--with-module]=\"!!tab.module\" (mouseenter)=\"onTabMouseEnter($event, tab)\" (mouseleave)=\"onTabMouseLeave()\"\r\n (click)=\"tabs.activate(tab.id)\" (mousedown)=\"onTabMouseDown($event, tab)\">\r\n @if (tab.icon) {\r\n <i [class]=\"tab.icon + ' tab-icon'\"></i>\r\n }\r\n <div class=\"tab-body\">\r\n <span class=\"tab-title\">{{ tab.title }}</span>\r\n @if (tab.module) {\r\n <span class=\"tab-module\">\r\n <span class=\"tab-module-dot\" [style.background]=\"getModuleColor(tab)\"></span>\r\n {{ tab.module }}\r\n </span>\r\n }\r\n </div>\r\n <button class=\"tab-btn tab-pin\" [class.tab-pin--active]=\"tab.pinned\" (click)=\"tabs.togglePin(tab.id, $event)\"\r\n [title]=\"tab.pinned ? 'Desfijar' : 'Fijar'\">\r\n <i class=\"fas fa-thumbtack\"></i>\r\n </button>\r\n @if (!tab.pinned) {\r\n <button class=\"tab-btn tab-close\" (click)=\"tabs.close(tab.id, $event)\" title=\"Cerrar\">\r\n <i class=\"fas fa-times\"></i>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"tab-actions\">\r\n <button class=\"tab-close-all\" (click)=\"tabs.closeAll()\" title=\"Cerrar todas las pesta\u00F1as\">\r\n <i class=\"fas fa-times-circle\"></i>\r\n <span>Cerrar todo</span>\r\n </button>\r\n </div>\r\n</div>\r\n\r\n@if (hoveredTab(); as tab) {\r\n<div class=\"tab-tip-fixed\" [style.left.px]=\"tipPosition().x\" [style.top.px]=\"tipPosition().y\">\r\n <span class=\"tab-tip-title\">{{ tab.title }}</span>\r\n @if (tab.module) {\r\n <span class=\"tab-tip-module\">\r\n <span class=\"tab-tip-dot\" [style.background]=\"getModuleColor(tab)\"></span>\r\n {{ tab.module }}\r\n </span>\r\n }\r\n</div>\r\n}\r\n}\r\n", styles: ["@media(max-width:767px){.tab-bar{display:none!important}}.tab-bar{display:flex;align-items:center;padding:4px 8px;background:var(--sidebar-bg, #0b1a3d);border-bottom:1px solid rgba(255,255,255,.1);min-height:38px;width:100%;flex-shrink:0;box-shadow:0 2px 8px #00000040;animation:tabBarSlideIn .22s cubic-bezier(.25,.46,.45,.94) both}.tab-bar--leaving{animation:tabBarSlideOut .16s ease-in both}@keyframes tabBarSlideIn{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes tabBarSlideOut{0%{transform:translateY(0);opacity:1}to{transform:translateY(-100%);opacity:0}}.tab-list{display:flex;align-items:stretch;gap:3px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.15) transparent}.tab-list::-webkit-scrollbar{height:2px}.tab-list::-webkit-scrollbar-track{background:transparent}.tab-list::-webkit-scrollbar-thumb{background:#fff3;border-radius:2px}.tab{display:flex;align-items:center;gap:5px;padding:4px 8px;border-radius:5px;cursor:pointer;white-space:nowrap;font-size:12px;color:#ffffff8c;background:#ffffff0a;border:1px solid transparent;transition:background .15s,border-color .15s,color .15s;flex:1 1 0;min-width:60px;max-width:180px;overflow:hidden;-webkit-user-select:none;user-select:none}.tab--with-module{align-items:flex-start;padding-top:5px;padding-bottom:5px}.tab:hover{background:#ffffff17;color:#fffc}.tab:hover .tab-pin{opacity:.5}.tab--active{background:#398bf726;border-color:#398bf773;color:#93c5fd}.tab--pinned{border-color:#fbbf2459;background:#fbbf2412;flex:0 0 auto}.tab--pinned.tab--active{border-color:#398bf773;background:#398bf726}.tab-icon{font-size:11px;flex-shrink:0;margin-top:1px}.tab--with-module .tab-icon{margin-top:2px}.tab-body{display:flex;flex-direction:column;flex:1;min-width:0;gap:2px}.tab-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}.tab-module{display:flex;align-items:center;gap:4px;font-size:10.5px;color:#fff9;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-module-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;align-self:center;display:block}.tab-btn{background:none;border:none;padding:0 1px;cursor:pointer;color:inherit;font-size:9px;line-height:1;display:flex;align-items:center;flex-shrink:0}.tab-pin{opacity:0;transition:opacity .15s,color .15s,transform .2s;transform:rotate(45deg)}.tab-pin--active{opacity:1!important;color:#fbbf24;transform:rotate(0)}.tab-pin:hover{opacity:1!important}.tab-close{opacity:.4}.tab-close:hover{opacity:1}.tab-actions{display:flex;align-items:center;gap:4px;padding-left:8px;border-left:1px solid rgba(255,255,255,.08);margin-left:4px;flex-shrink:0}.tab-tip-fixed{position:fixed;z-index:99999;transform:translate(-50%);pointer-events:none;padding:6px 10px;border-radius:6px;background:#0f0f14;border:1px solid rgba(255,255,255,.07);white-space:nowrap;display:flex;flex-direction:column;gap:3px;animation:tabTipFadeIn .14s ease}.tab-tip-fixed:before{content:\"\";position:absolute;bottom:100%;left:50%;transform:translate(-50%);border:5px solid transparent;border-bottom-color:#0f0f14}.tab-tip-title{font-size:11px;font-weight:600;color:#fff}.tab-tip-module{display:flex;align-items:center;gap:4px;font-size:10px;color:#ffffffa6}.tab-tip-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}@keyframes tabTipFadeIn{0%{opacity:0;transform:translate(-50%) translateY(-4px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.tab-close-all{display:flex;align-items:center;gap:5px;background:none;border:none;cursor:pointer;color:#fff6;font-size:11px;padding:3px 6px;border-radius:4px;white-space:nowrap;transition:color .15s,background .15s}.tab-close-all:hover{color:#f87171;background:#f871711a}.tab-close-all i{font-size:12px}\n"] }]
|
|
835
|
+
}], ctorParameters: () => [] });
|
|
836
|
+
|
|
837
|
+
class DetectorService {
|
|
838
|
+
componenteActual = signal(null);
|
|
839
|
+
setComponente(componente) {
|
|
840
|
+
this.componenteActual.set(componente);
|
|
841
|
+
}
|
|
842
|
+
getComponente() {
|
|
843
|
+
return this.componenteActual.asReadonly();
|
|
844
|
+
}
|
|
845
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DetectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
846
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DetectorService, providedIn: 'root' });
|
|
847
|
+
}
|
|
848
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DetectorService, decorators: [{
|
|
849
|
+
type: Injectable,
|
|
850
|
+
args: [{
|
|
851
|
+
providedIn: 'root'
|
|
852
|
+
}]
|
|
853
|
+
}] });
|
|
854
|
+
|
|
855
|
+
class FullComponent {
|
|
856
|
+
detectorService = inject(DetectorService);
|
|
857
|
+
contexts = inject(ChildrenOutletContexts);
|
|
858
|
+
router = inject(Router);
|
|
859
|
+
tabsService = inject(TabsService);
|
|
860
|
+
menuItems = input([]);
|
|
861
|
+
nameProyecto = input('');
|
|
862
|
+
accentColor = input('#398bf7');
|
|
863
|
+
showTabs = input(true);
|
|
864
|
+
tabModuleColors = input({});
|
|
865
|
+
currentYear = new Date().getFullYear();
|
|
866
|
+
// El vertical-header se recibe proyectado (<ng-content select="[header]">), así
|
|
867
|
+
// que no es un ViewChild del template propio de `full` sino contenido — por eso
|
|
868
|
+
// ContentChild en vez de ViewChild (mismo mecanismo que usa consults con ViewChild
|
|
869
|
+
// porque ahí el header vive directo en su propio template, no proyectado).
|
|
870
|
+
// El bottom-nav SOLO sale de ahí — igual que en consults, sin lista aparte.
|
|
871
|
+
verticalHeaderSignal = signal(null);
|
|
872
|
+
set verticalHeaderRef(vh) {
|
|
873
|
+
if (vh)
|
|
874
|
+
this.verticalHeaderSignal.set(vh);
|
|
875
|
+
}
|
|
876
|
+
bottomMenuItems = computed(() => this.verticalHeaderSignal()?.bottomNavItems() ?? []);
|
|
877
|
+
isSidebarOpen = signal(false);
|
|
878
|
+
isSidebarHovering = signal(false);
|
|
879
|
+
isScrolled = signal(false);
|
|
880
|
+
isDesktop = window.innerWidth >= 1191;
|
|
881
|
+
isMobileView = signal(window.innerWidth <= 667);
|
|
882
|
+
sidebarWidth = signal(260);
|
|
883
|
+
// Datos de sesión: se reciben del consumidor (en vez de inyectar SesionService
|
|
884
|
+
// acá) para que layout-tsi no dependa de core-tsi. Es un solo objeto requerido
|
|
885
|
+
// (input.required) en vez de 6 inputs sueltos, para que Angular tire error si
|
|
886
|
+
// el consumidor se olvida de pasarlo, en vez de fallar en silencio con '' o [].
|
|
887
|
+
sessionData = input.required();
|
|
888
|
+
nombreSucursal = computed(() => this.sessionData().sucursales?.find(s => s.codsuc == this.sessionData().codsuc)?.sucursal ?? '');
|
|
889
|
+
cambiarSucursal() {
|
|
890
|
+
this.router.navigateByUrl('seleccionar-sucursal');
|
|
891
|
+
}
|
|
892
|
+
get userInitials() {
|
|
893
|
+
return this.sessionData().nombreUser.split(' ').filter(Boolean).slice(0, 2).map(n => n[0].toUpperCase()).join('');
|
|
894
|
+
}
|
|
895
|
+
// El contenido del router-outlet aparecía en seco al cambiar de página/tab.
|
|
896
|
+
// (activate) avisa cada vez que se instancia un componente nuevo ahí — se
|
|
897
|
+
// saca la clase y se vuelve a poner en el siguiente frame para forzar que
|
|
898
|
+
// el @keyframes de entrada se reinicie (una clase ya puesta no reinicia su
|
|
899
|
+
// animación si se la vuelve a poner sin sacarla antes).
|
|
900
|
+
routeAnimating = signal(false);
|
|
901
|
+
onRouteActivate() {
|
|
902
|
+
this.routeAnimating.set(false);
|
|
903
|
+
requestAnimationFrame(() => requestAnimationFrame(() => this.routeAnimating.set(true)));
|
|
904
|
+
}
|
|
905
|
+
constructor() {
|
|
906
|
+
effect(() => {
|
|
907
|
+
document.documentElement.style.setProperty('--sidebar-accent', this.accentColor());
|
|
908
|
+
});
|
|
909
|
+
this.tabsService.init();
|
|
910
|
+
this.router.events.pipe(filter((e) => e instanceof NavigationEnd), takeUntilDestroyed()).subscribe(() => {
|
|
911
|
+
const component = this.contexts.getContext('primary')?.outlet?.component;
|
|
912
|
+
if (component) {
|
|
913
|
+
const mirror = reflectComponentType(component.constructor);
|
|
914
|
+
if (mirror)
|
|
915
|
+
this.detectorService.setComponente(mirror.selector);
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
contentContainer;
|
|
920
|
+
sidebarRef;
|
|
921
|
+
toggleSidebar() {
|
|
922
|
+
this.isSidebarOpen.set(!this.isSidebarOpen());
|
|
923
|
+
this.updateSidebarWidth();
|
|
924
|
+
}
|
|
925
|
+
closeSidebar() {
|
|
926
|
+
this.isSidebarOpen.set(false);
|
|
927
|
+
}
|
|
928
|
+
onResize(event) {
|
|
929
|
+
this.isDesktop = event.target.innerWidth >= 1191;
|
|
930
|
+
this.isMobileView.set(event.target.innerWidth <= 667);
|
|
931
|
+
if (this.isDesktop) {
|
|
932
|
+
this.isSidebarOpen.set(false);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
ngAfterViewInit() {
|
|
936
|
+
if (this.contentContainer) {
|
|
937
|
+
this.contentContainer.nativeElement.addEventListener('scroll', () => {
|
|
938
|
+
const scrollTop = this.contentContainer.nativeElement.scrollTop;
|
|
939
|
+
this.isScrolled.set(scrollTop > 0);
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
if (this.sidebarRef) {
|
|
943
|
+
this.sidebarRef.nativeElement.addEventListener('transitionend', (event) => {
|
|
944
|
+
if (event.propertyName == 'max-width') {
|
|
945
|
+
this.updateSidebarWidth();
|
|
946
|
+
}
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
window.addEventListener('resize', () => this.updateSidebarWidth());
|
|
950
|
+
this.updateSidebarWidth();
|
|
951
|
+
}
|
|
952
|
+
get isSidebarActuallyOpen() {
|
|
953
|
+
return window.innerWidth <= 1191 ? true : !this.isSidebarOpen();
|
|
954
|
+
}
|
|
955
|
+
updateSidebarWidth() {
|
|
956
|
+
if (this.sidebarRef) {
|
|
957
|
+
const newWidth = this.sidebarRef.nativeElement.offsetWidth;
|
|
958
|
+
this.sidebarWidth.set(newWidth);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
onClickOutside(event) {
|
|
962
|
+
if (window.innerWidth > 1191)
|
|
963
|
+
return;
|
|
964
|
+
const sidebarEl = this.sidebarRef?.nativeElement;
|
|
965
|
+
const toggleButton = document.querySelector('app-vertical-header');
|
|
966
|
+
if (this.isSidebarOpen() && sidebarEl &&
|
|
967
|
+
!sidebarEl.contains(event.target) &&
|
|
968
|
+
!toggleButton?.contains(event.target)) {
|
|
969
|
+
this.isSidebarOpen.set(false);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
onSidebarHoverEnter() {
|
|
973
|
+
if (window.innerWidth > 1191 && this.isSidebarOpen()) {
|
|
974
|
+
this.isSidebarHovering.set(true);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
onSidebarHoverLeave() {
|
|
978
|
+
if (window.innerWidth > 1191 && this.isSidebarOpen()) {
|
|
979
|
+
this.isSidebarHovering.set(false);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
showBottomNav = computed(() => this.isMobileView() && !this.isSidebarOpen() && this.bottomMenuItems().length > 0);
|
|
983
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FullComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
984
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: FullComponent, isStandalone: true, selector: "app-full", inputs: { menuItems: { classPropertyName: "menuItems", publicName: "menuItems", isSignal: true, isRequired: false, transformFunction: null }, nameProyecto: { classPropertyName: "nameProyecto", publicName: "nameProyecto", isSignal: true, isRequired: false, transformFunction: null }, accentColor: { classPropertyName: "accentColor", publicName: "accentColor", isSignal: true, isRequired: false, transformFunction: null }, showTabs: { classPropertyName: "showTabs", publicName: "showTabs", isSignal: true, isRequired: false, transformFunction: null }, tabModuleColors: { classPropertyName: "tabModuleColors", publicName: "tabModuleColors", isSignal: true, isRequired: false, transformFunction: null }, sessionData: { classPropertyName: "sessionData", publicName: "sessionData", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "window:resize": "onResize($event)", "document:click": "onClickOutside($event)" } }, queries: [{ propertyName: "verticalHeaderRef", first: true, predicate: VerticalHeaderComponent, descendants: true }], viewQueries: [{ propertyName: "contentContainer", first: true, predicate: ["contentContainer"], descendants: true }, { propertyName: "sidebarRef", first: true, predicate: ["sidebar"], descendants: true }], ngImport: i0, template: "<ng-content select=\"[header]\" />\r\n\r\n<div [ngClass]=\"{'layout': true, 'open': isSidebarOpen()}\">\r\n <div #sidebar class=\"sidebar\" id=\"sidebar\" [ngClass]=\"isSidebarOpen() ? 'open' : ''\"\r\n (mouseenter)=\"onSidebarHoverEnter()\" (mouseleave)=\"onSidebarHoverLeave()\">\r\n <div class=\"sub-sidebar py-3\">\r\n <div class=\"user-profile\" [class.collapsed]=\"!isSidebarActuallyOpen\">\r\n <div class=\"user-info\" [class.user-info--hidden]=\"!isSidebarActuallyOpen\">\r\n <span class=\"fw-6 fs-7 truncate-text user-name\">{{ sessionData().nombreUser }}</span>\r\n <span class=\"truncate-text user-sucursal\">{{ nombreSucursal() }}</span>\r\n </div>\r\n @if (sessionData().sucursales.length > 1) {\r\n <button type=\"button\" class=\"btn-cambiar-sucursal\" title=\"Cambiar sucursal\" aria-label=\"Cambiar sucursal\"\r\n (click)=\"cambiarSucursal()\">\r\n <i class=\"fas fa-right-left\"></i>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"pt-3 px-2 list-menu-sidebar\">\r\n <ul class=\"list-unstyled\">\r\n @for (item of menuItems(); track $index) {\r\n <app-menu-item [item]=\"item\" [isSidebarOpen]=\"isSidebarOpen()\" [isSidebarHovering]=\"isSidebarHovering()\"\r\n [parentModuleName]=\"item.title\" [accentColor]=\"accentColor()\" [accesos]=\"sessionData().accesos\" [rolId]=\"sessionData().rolId\" />\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"sidebar-footer text-center\" [class.sidebar-footer--hidden]=\"!isSidebarActuallyOpen\">\r\n <p> \u00A9 {{ currentYear }} Grupo TSI - {{ sessionData().idCia }} </p>\r\n </div>\r\n </div>\r\n\r\n <div #contentContainer class=\"content\" [class.has-bottom-nav]=\"showBottomNav()\"\r\n [ngStyle]=\"{'background-color': 'var(--background-color)'}\">\r\n @if (showTabs()) {\r\n <app-tab-bar [moduleColors]=\"tabModuleColors()\" />\r\n }\r\n <div class=\"content-scroll\">\r\n <div class=\"container-fluid\" [class.route-fade-in]=\"routeAnimating()\">\r\n <router-outlet (activate)=\"onRouteActivate()\" />\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if (showBottomNav()) {\r\n<app-bottom-navigation [menuItems]=\"bottomMenuItems()\" [isVisible]=\"true\" />\r\n}\r\n<ng-content select=\"[chatbot]\" />\r\n", styles: [".hidden{display:none!important}.header-container{height:50px;background:#c50048;display:flex;justify-content:space-between;align-items:center}.header-sidebar{height:50px;background:#c50048;display:flex;align-items:center;justify-content:space-between;gap:5px}.sub-sidebar{border-bottom:1px solid rgba(255,255,255,.1);background:#ffffff08;min-width:0}.user-profile{display:flex;align-items:center;gap:10px;padding:0 12px;min-width:0;min-height:36px}.user-profile.collapsed{justify-content:center;padding:0;gap:0}.btn-cambiar-sucursal{flex:0 0 auto;width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:12px;border:1px solid rgba(255,255,255,.15);border-radius:8px;background:#ffffff0f;color:var(--sidebar-active-text);cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .15s ease}.btn-cambiar-sucursal:hover{background:#ffffff24;border-color:#ffffff4d}.btn-cambiar-sucursal:active{transform:scale(.94)}.btn-cambiar-sucursal:focus-visible{outline:2px solid var(--sidebar-accent, #c50048);outline-offset:2px}.user-avatar{width:38px;height:38px;min-width:38px;border-radius:50%;background:linear-gradient(135deg,var(--sidebar-accent, #c50048),color-mix(in srgb,var(--sidebar-accent, #c50048) 60%,white));color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;letter-spacing:.5px;box-shadow:0 0 0 2px #ffffff1a,0 4px 12px #0006}.user-info{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;visibility:visible;opacity:1;transition:opacity .15s ease .22s,visibility 0s ease .22s}.user-info--hidden{visibility:hidden!important;opacity:0!important;max-height:0!important;flex:0 0 0!important;width:0!important;overflow:hidden!important;padding:0!important;margin:0!important;transition:opacity .08s ease 0s,visibility 0s ease .08s,max-height 0s ease .08s!important}.user-name{color:var(--sidebar-active-text)}.user-sucursal{font-size:11px;color:var(--sidebar-text-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-unstyled{font-size:13px;color:var(--sidebar-text-color)}.layout{display:grid;grid-template-columns:260px 1fr;height:calc(100dvh - 50px)}.sidebar{background:linear-gradient(160deg,var(--sidebar-gradient-start) 0%,var(--sidebar-bg) 100%)!important;box-shadow:4px 0 24px #00000059;border-right:1px solid rgba(255,255,255,.05);transition:transform .3s ease-in-out;width:260px;overflow:hidden;scrollbar-width:none;display:flex;flex-direction:column}.list-menu-sidebar{flex:1;overflow-y:auto;scrollbar-width:none;margin-bottom:0}.sidebar-footer{font-size:11px;color:var(--sidebar-text-color);padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);margin-top:auto;width:100%;display:flex;align-items:center;justify-content:center;opacity:.65;visibility:visible;transition:opacity .15s ease .25s,visibility 0s ease .25s}.sidebar-footer--hidden{opacity:0;visibility:hidden;transition:opacity .1s ease 0s,visibility 0s ease .1s}.sidebar-footer p{margin:0}.content{display:flex;flex-direction:column;overflow:hidden;max-height:100%}.content-scroll{flex:1;overflow-x:auto;overflow-y:auto;min-height:0;--content-space: .75rem}.content-scroll .container-fluid{padding:var(--content-space)!important}.content-scroll .container-fluid.route-fade-in{animation:routeContentFadeIn .32s cubic-bezier(.4,0,.2,1)}@keyframes routeContentFadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media(max-width:1191px){.layout{grid-template-columns:1fr}.sidebar{position:fixed;top:50px;left:0;width:260px;height:calc(100dvh - 50px);z-index:1000;transform:translate(-100%);scrollbar-width:none;display:flex;flex-direction:column;overflow:visible}.sidebar-footer{display:flex!important}.sidebar.open{transform:translate(0)}}@media(min-width:1192px){.layout{grid-template-columns:260px 1fr;transition:grid-template-columns .3s ease-in-out}.layout.open{grid-template-columns:70px 1fr}.sidebar{width:260px;max-width:260px;transition:width .3s ease-in-out,max-width .3s ease-in-out}.sidebar.open{width:70px;max-width:70px}}.truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;width:100%}.tc-bubble-container{position:fixed;top:111px;right:30px;z-index:9999}.tc-bubble{background:#c50048;color:#fff;padding:10px 14px;border-radius:50px;cursor:pointer;display:flex;align-items:center;gap:8px;box-shadow:0 4px 12px #0003;transition:all .2s ease}.tc-bubble:hover{transform:scale(1.05)}.tc-label{font-size:13px;font-weight:600}.tc-dropdown{margin-top:10px;background:#fff;border-radius:12px;padding:10px;min-width:220px;box-shadow:0 6px 18px #00000026}.tc-item{display:flex;align-items:center;gap:8px;padding:6px 4px;font-size:13px}.tc-item i{color:#c50048}.tc-item .item-content{display:flex;justify-content:space-between;align-items:center;width:100%}.tc-item .item-label{color:#333;text-align:left}.tc-item .item-value{color:#333;text-align:right;font-weight:500;margin-left:16px}@media(max-width:700px){.tc-bubble-container{top:auto;bottom:55px;right:40px}}.mobile-view .content{min-height:calc(100dvh - 110px)}@media(max-width:1191px){.content.has-bottom-nav{padding-bottom:60px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: MenuItemComponent, selector: "app-menu-item", inputs: ["item", "isSidebarOpen", "isSidebarHovering", "level", "parentModuleName", "accentColor", "accesos", "rolId"] }, { kind: "component", type: BottomNavigationComponent, selector: "app-bottom-navigation", inputs: ["menuItems", "isVisible"], outputs: ["itemClick"] }, { kind: "component", type: TabBarComponent, selector: "app-tab-bar", inputs: ["moduleColors"] }] });
|
|
985
|
+
}
|
|
986
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: FullComponent, decorators: [{
|
|
987
|
+
type: Component,
|
|
988
|
+
args: [{ selector: 'app-full', imports: [CommonModule, RouterModule, MenuItemComponent, BottomNavigationComponent, TabBarComponent], template: "<ng-content select=\"[header]\" />\r\n\r\n<div [ngClass]=\"{'layout': true, 'open': isSidebarOpen()}\">\r\n <div #sidebar class=\"sidebar\" id=\"sidebar\" [ngClass]=\"isSidebarOpen() ? 'open' : ''\"\r\n (mouseenter)=\"onSidebarHoverEnter()\" (mouseleave)=\"onSidebarHoverLeave()\">\r\n <div class=\"sub-sidebar py-3\">\r\n <div class=\"user-profile\" [class.collapsed]=\"!isSidebarActuallyOpen\">\r\n <div class=\"user-info\" [class.user-info--hidden]=\"!isSidebarActuallyOpen\">\r\n <span class=\"fw-6 fs-7 truncate-text user-name\">{{ sessionData().nombreUser }}</span>\r\n <span class=\"truncate-text user-sucursal\">{{ nombreSucursal() }}</span>\r\n </div>\r\n @if (sessionData().sucursales.length > 1) {\r\n <button type=\"button\" class=\"btn-cambiar-sucursal\" title=\"Cambiar sucursal\" aria-label=\"Cambiar sucursal\"\r\n (click)=\"cambiarSucursal()\">\r\n <i class=\"fas fa-right-left\"></i>\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"pt-3 px-2 list-menu-sidebar\">\r\n <ul class=\"list-unstyled\">\r\n @for (item of menuItems(); track $index) {\r\n <app-menu-item [item]=\"item\" [isSidebarOpen]=\"isSidebarOpen()\" [isSidebarHovering]=\"isSidebarHovering()\"\r\n [parentModuleName]=\"item.title\" [accentColor]=\"accentColor()\" [accesos]=\"sessionData().accesos\" [rolId]=\"sessionData().rolId\" />\r\n }\r\n </ul>\r\n </div>\r\n\r\n <div class=\"sidebar-footer text-center\" [class.sidebar-footer--hidden]=\"!isSidebarActuallyOpen\">\r\n <p> \u00A9 {{ currentYear }} Grupo TSI - {{ sessionData().idCia }} </p>\r\n </div>\r\n </div>\r\n\r\n <div #contentContainer class=\"content\" [class.has-bottom-nav]=\"showBottomNav()\"\r\n [ngStyle]=\"{'background-color': 'var(--background-color)'}\">\r\n @if (showTabs()) {\r\n <app-tab-bar [moduleColors]=\"tabModuleColors()\" />\r\n }\r\n <div class=\"content-scroll\">\r\n <div class=\"container-fluid\" [class.route-fade-in]=\"routeAnimating()\">\r\n <router-outlet (activate)=\"onRouteActivate()\" />\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n@if (showBottomNav()) {\r\n<app-bottom-navigation [menuItems]=\"bottomMenuItems()\" [isVisible]=\"true\" />\r\n}\r\n<ng-content select=\"[chatbot]\" />\r\n", styles: [".hidden{display:none!important}.header-container{height:50px;background:#c50048;display:flex;justify-content:space-between;align-items:center}.header-sidebar{height:50px;background:#c50048;display:flex;align-items:center;justify-content:space-between;gap:5px}.sub-sidebar{border-bottom:1px solid rgba(255,255,255,.1);background:#ffffff08;min-width:0}.user-profile{display:flex;align-items:center;gap:10px;padding:0 12px;min-width:0;min-height:36px}.user-profile.collapsed{justify-content:center;padding:0;gap:0}.btn-cambiar-sucursal{flex:0 0 auto;width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;font-size:12px;border:1px solid rgba(255,255,255,.15);border-radius:8px;background:#ffffff0f;color:var(--sidebar-active-text);cursor:pointer;transition:background .2s ease,border-color .2s ease,transform .15s ease}.btn-cambiar-sucursal:hover{background:#ffffff24;border-color:#ffffff4d}.btn-cambiar-sucursal:active{transform:scale(.94)}.btn-cambiar-sucursal:focus-visible{outline:2px solid var(--sidebar-accent, #c50048);outline-offset:2px}.user-avatar{width:38px;height:38px;min-width:38px;border-radius:50%;background:linear-gradient(135deg,var(--sidebar-accent, #c50048),color-mix(in srgb,var(--sidebar-accent, #c50048) 60%,white));color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;letter-spacing:.5px;box-shadow:0 0 0 2px #ffffff1a,0 4px 12px #0006}.user-info{display:flex;flex-direction:column;flex:1 1 auto;min-width:0;visibility:visible;opacity:1;transition:opacity .15s ease .22s,visibility 0s ease .22s}.user-info--hidden{visibility:hidden!important;opacity:0!important;max-height:0!important;flex:0 0 0!important;width:0!important;overflow:hidden!important;padding:0!important;margin:0!important;transition:opacity .08s ease 0s,visibility 0s ease .08s,max-height 0s ease .08s!important}.user-name{color:var(--sidebar-active-text)}.user-sucursal{font-size:11px;color:var(--sidebar-text-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-unstyled{font-size:13px;color:var(--sidebar-text-color)}.layout{display:grid;grid-template-columns:260px 1fr;height:calc(100dvh - 50px)}.sidebar{background:linear-gradient(160deg,var(--sidebar-gradient-start) 0%,var(--sidebar-bg) 100%)!important;box-shadow:4px 0 24px #00000059;border-right:1px solid rgba(255,255,255,.05);transition:transform .3s ease-in-out;width:260px;overflow:hidden;scrollbar-width:none;display:flex;flex-direction:column}.list-menu-sidebar{flex:1;overflow-y:auto;scrollbar-width:none;margin-bottom:0}.sidebar-footer{font-size:11px;color:var(--sidebar-text-color);padding:10px 12px;border-top:1px solid rgba(255,255,255,.08);margin-top:auto;width:100%;display:flex;align-items:center;justify-content:center;opacity:.65;visibility:visible;transition:opacity .15s ease .25s,visibility 0s ease .25s}.sidebar-footer--hidden{opacity:0;visibility:hidden;transition:opacity .1s ease 0s,visibility 0s ease .1s}.sidebar-footer p{margin:0}.content{display:flex;flex-direction:column;overflow:hidden;max-height:100%}.content-scroll{flex:1;overflow-x:auto;overflow-y:auto;min-height:0;--content-space: .75rem}.content-scroll .container-fluid{padding:var(--content-space)!important}.content-scroll .container-fluid.route-fade-in{animation:routeContentFadeIn .32s cubic-bezier(.4,0,.2,1)}@keyframes routeContentFadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@media(max-width:1191px){.layout{grid-template-columns:1fr}.sidebar{position:fixed;top:50px;left:0;width:260px;height:calc(100dvh - 50px);z-index:1000;transform:translate(-100%);scrollbar-width:none;display:flex;flex-direction:column;overflow:visible}.sidebar-footer{display:flex!important}.sidebar.open{transform:translate(0)}}@media(min-width:1192px){.layout{grid-template-columns:260px 1fr;transition:grid-template-columns .3s ease-in-out}.layout.open{grid-template-columns:70px 1fr}.sidebar{width:260px;max-width:260px;transition:width .3s ease-in-out,max-width .3s ease-in-out}.sidebar.open{width:70px;max-width:70px}}.truncate-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;width:100%}.tc-bubble-container{position:fixed;top:111px;right:30px;z-index:9999}.tc-bubble{background:#c50048;color:#fff;padding:10px 14px;border-radius:50px;cursor:pointer;display:flex;align-items:center;gap:8px;box-shadow:0 4px 12px #0003;transition:all .2s ease}.tc-bubble:hover{transform:scale(1.05)}.tc-label{font-size:13px;font-weight:600}.tc-dropdown{margin-top:10px;background:#fff;border-radius:12px;padding:10px;min-width:220px;box-shadow:0 6px 18px #00000026}.tc-item{display:flex;align-items:center;gap:8px;padding:6px 4px;font-size:13px}.tc-item i{color:#c50048}.tc-item .item-content{display:flex;justify-content:space-between;align-items:center;width:100%}.tc-item .item-label{color:#333;text-align:left}.tc-item .item-value{color:#333;text-align:right;font-weight:500;margin-left:16px}@media(max-width:700px){.tc-bubble-container{top:auto;bottom:55px;right:40px}}.mobile-view .content{min-height:calc(100dvh - 110px)}@media(max-width:1191px){.content.has-bottom-nav{padding-bottom:60px}}\n"] }]
|
|
989
|
+
}], ctorParameters: () => [], propDecorators: { verticalHeaderRef: [{
|
|
990
|
+
type: ContentChild,
|
|
991
|
+
args: [VerticalHeaderComponent]
|
|
992
|
+
}], contentContainer: [{
|
|
993
|
+
type: ViewChild,
|
|
994
|
+
args: ['contentContainer']
|
|
995
|
+
}], sidebarRef: [{
|
|
996
|
+
type: ViewChild,
|
|
997
|
+
args: ['sidebar']
|
|
998
|
+
}], onResize: [{
|
|
999
|
+
type: HostListener,
|
|
1000
|
+
args: ['window:resize', ['$event']]
|
|
1001
|
+
}], onClickOutside: [{
|
|
1002
|
+
type: HostListener,
|
|
1003
|
+
args: ['document:click', ['$event']]
|
|
1004
|
+
}] } });
|
|
1005
|
+
|
|
1006
|
+
const CHATBOT_CONFIG = new InjectionToken('CHATBOT_CONFIG');
|
|
1007
|
+
|
|
1008
|
+
class ChatbotService {
|
|
1009
|
+
config = inject(CHATBOT_CONFIG);
|
|
1010
|
+
messages = signal([]);
|
|
1011
|
+
isTyping = signal(false);
|
|
1012
|
+
isOpen = signal(false);
|
|
1013
|
+
hasActiveConversation = computed(() => this.messages().length > 1);
|
|
1014
|
+
constructor() {
|
|
1015
|
+
this.init();
|
|
1016
|
+
}
|
|
1017
|
+
getNode(id) {
|
|
1018
|
+
return this.config.nodes.find(n => n.id === id);
|
|
1019
|
+
}
|
|
1020
|
+
init() {
|
|
1021
|
+
const rootNode = this.getNode(this.config.rootNodeId);
|
|
1022
|
+
this.messages.set([{
|
|
1023
|
+
from: 'bot',
|
|
1024
|
+
text: this.config.welcomeMessage,
|
|
1025
|
+
options: rootNode?.options ?? [],
|
|
1026
|
+
optionsDisabled: false
|
|
1027
|
+
}]);
|
|
1028
|
+
}
|
|
1029
|
+
open() {
|
|
1030
|
+
this.isOpen.set(true);
|
|
1031
|
+
}
|
|
1032
|
+
minimize() {
|
|
1033
|
+
this.isOpen.set(false);
|
|
1034
|
+
}
|
|
1035
|
+
close() {
|
|
1036
|
+
this.isOpen.set(false);
|
|
1037
|
+
this.init();
|
|
1038
|
+
}
|
|
1039
|
+
selectOption(option, messageIndex) {
|
|
1040
|
+
this.messages.update(msgs => msgs.map((m, i) => i === messageIndex ? { ...m, optionsDisabled: true } : m));
|
|
1041
|
+
this.messages.update(msgs => [...msgs, { from: 'user', text: option.label }]);
|
|
1042
|
+
this.isTyping.set(true);
|
|
1043
|
+
setTimeout(() => {
|
|
1044
|
+
this.isTyping.set(false);
|
|
1045
|
+
if (option.nextNodeId) {
|
|
1046
|
+
const nextNode = this.getNode(option.nextNodeId);
|
|
1047
|
+
if (nextNode) {
|
|
1048
|
+
this.messages.update(msgs => [...msgs, {
|
|
1049
|
+
from: 'bot',
|
|
1050
|
+
text: nextNode.message,
|
|
1051
|
+
options: nextNode.options ?? [],
|
|
1052
|
+
optionsDisabled: false
|
|
1053
|
+
}]);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
else if (option.response) {
|
|
1057
|
+
this.messages.update(msgs => [
|
|
1058
|
+
...msgs,
|
|
1059
|
+
{ from: 'bot', text: option.response },
|
|
1060
|
+
...(this.config.contactInfo ? [{ from: 'bot', text: this.config.contactInfo }] : [])
|
|
1061
|
+
]);
|
|
1062
|
+
}
|
|
1063
|
+
}, 700);
|
|
1064
|
+
}
|
|
1065
|
+
restart() {
|
|
1066
|
+
this.init();
|
|
1067
|
+
}
|
|
1068
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChatbotService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1069
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChatbotService });
|
|
1070
|
+
}
|
|
1071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChatbotService, decorators: [{
|
|
1072
|
+
type: Injectable
|
|
1073
|
+
}], ctorParameters: () => [] });
|
|
1074
|
+
|
|
1075
|
+
class ChatbotComponent {
|
|
1076
|
+
service = inject(ChatbotService);
|
|
1077
|
+
config = inject(CHATBOT_CONFIG);
|
|
1078
|
+
zone = inject(NgZone);
|
|
1079
|
+
messagesEnd = viewChild('messagesEnd');
|
|
1080
|
+
wrapper = viewChild('wrapper');
|
|
1081
|
+
position = signal(null);
|
|
1082
|
+
isDragging = signal(false);
|
|
1083
|
+
openDir = signal('above');
|
|
1084
|
+
openHDir = signal('right');
|
|
1085
|
+
dragOffset = { x: 0, y: 0 };
|
|
1086
|
+
hasDragged = false;
|
|
1087
|
+
constructor() {
|
|
1088
|
+
effect(() => {
|
|
1089
|
+
this.service.messages();
|
|
1090
|
+
this.service.isTyping();
|
|
1091
|
+
setTimeout(() => this.scrollToBottom(), 50);
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
get primaryColor() { return this.config.primaryColor ?? '#c50048'; }
|
|
1095
|
+
selectOption(option, index) { this.service.selectOption(option, index); }
|
|
1096
|
+
onFabClick() {
|
|
1097
|
+
if (!this.hasDragged) {
|
|
1098
|
+
this.calcOpenDirection();
|
|
1099
|
+
this.service.open();
|
|
1100
|
+
}
|
|
1101
|
+
this.hasDragged = false;
|
|
1102
|
+
}
|
|
1103
|
+
calcOpenDirection() {
|
|
1104
|
+
const el = this.wrapper()?.nativeElement;
|
|
1105
|
+
if (!el)
|
|
1106
|
+
return;
|
|
1107
|
+
const rect = el.getBoundingClientRect();
|
|
1108
|
+
const WINDOW_H = 490;
|
|
1109
|
+
const WINDOW_W = 320;
|
|
1110
|
+
this.openDir.set(rect.top > WINDOW_H ? 'above' : 'below');
|
|
1111
|
+
this.openHDir.set(rect.left + WINDOW_W <= window.innerWidth ? 'right' : 'left');
|
|
1112
|
+
}
|
|
1113
|
+
startDrag(event) {
|
|
1114
|
+
if (event.target.closest('.chatbot-header-actions'))
|
|
1115
|
+
return;
|
|
1116
|
+
event.preventDefault();
|
|
1117
|
+
const el = this.wrapper().nativeElement;
|
|
1118
|
+
const rect = el.getBoundingClientRect();
|
|
1119
|
+
this.dragOffset = { x: event.clientX - rect.left, y: event.clientY - rect.top };
|
|
1120
|
+
this.hasDragged = false;
|
|
1121
|
+
if (!this.position())
|
|
1122
|
+
this.position.set({ x: rect.left, y: rect.top });
|
|
1123
|
+
this.isDragging.set(true);
|
|
1124
|
+
this.zone.runOutsideAngular(() => {
|
|
1125
|
+
document.addEventListener('mousemove', this.onDrag);
|
|
1126
|
+
document.addEventListener('mouseup', this.stopDrag);
|
|
1127
|
+
});
|
|
1128
|
+
}
|
|
1129
|
+
onDrag = (event) => {
|
|
1130
|
+
this.hasDragged = true;
|
|
1131
|
+
const el = this.wrapper().nativeElement;
|
|
1132
|
+
const x = Math.max(0, Math.min(event.clientX - this.dragOffset.x, window.innerWidth - el.offsetWidth));
|
|
1133
|
+
const y = Math.max(0, Math.min(event.clientY - this.dragOffset.y, window.innerHeight - el.offsetHeight));
|
|
1134
|
+
this.zone.run(() => this.position.set({ x, y }));
|
|
1135
|
+
};
|
|
1136
|
+
stopDrag = () => {
|
|
1137
|
+
this.zone.run(() => this.isDragging.set(false));
|
|
1138
|
+
document.removeEventListener('mousemove', this.onDrag);
|
|
1139
|
+
document.removeEventListener('mouseup', this.stopDrag);
|
|
1140
|
+
};
|
|
1141
|
+
scrollToBottom() {
|
|
1142
|
+
this.messagesEnd()?.nativeElement.scrollIntoView({ behavior: 'smooth' });
|
|
1143
|
+
}
|
|
1144
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChatbotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1145
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ChatbotComponent, isStandalone: true, selector: "app-chatbot", providers: [ChatbotService], viewQueries: [{ propertyName: "messagesEnd", first: true, predicate: ["messagesEnd"], descendants: true, isSignal: true }, { propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "<div #wrapper class=\"chatbot-wrapper\"\r\n [class.chatbot-left]=\"config.position === 'bottom-left'\"\r\n [class.chatbot-dragging]=\"isDragging()\"\r\n [style.--chatbot-primary]=\"primaryColor\"\r\n [style.left.px]=\"position()?.x\"\r\n [style.top.px]=\"position()?.y\"\r\n [style.right]=\"position() ? 'auto' : null\"\r\n [style.bottom]=\"position() ? 'auto' : null\">\r\n\r\n @if (!service.isOpen()) {\r\n <span class=\"chatbot-beta\">Beta</span>\r\n }\r\n <button class=\"chatbot-fab\"\r\n [class.chatbot-fab--hidden]=\"service.isOpen()\"\r\n (mousedown)=\"startDrag($event)\"\r\n (click)=\"onFabClick()\"\r\n title=\"Abrir asistente\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n @if (service.hasActiveConversation()) {\r\n <span class=\"chatbot-badge\" title=\"Conversaci\u00F3n en progreso\"></span>\r\n }\r\n </button>\r\n\r\n @if (service.isOpen()) {\r\n <div class=\"chatbot-window\"\r\n [class.open-above]=\"openDir() === 'above'\"\r\n [class.open-below]=\"openDir() === 'below'\"\r\n [class.open-right]=\"openHDir() === 'right'\"\r\n [class.open-left]=\"openHDir() === 'left'\">\r\n\r\n <div class=\"chatbot-header\" (mousedown)=\"startDrag($event)\">\r\n <div class=\"chatbot-header-info\">\r\n <span class=\"chatbot-avatar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n <div>\r\n <div class=\"chatbot-name\">{{ config.botName || 'Asistente' }}</div>\r\n <div class=\"chatbot-status\">En l\u00EDnea</div>\r\n </div>\r\n </div>\r\n <div class=\"chatbot-header-actions\">\r\n <button class=\"chatbot-action-btn\" (click)=\"service.minimize()\" title=\"Minimizar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\r\n <path d=\"M2 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11A.5.5 0 0 1 2 8z\" />\r\n </svg>\r\n </button>\r\n <button class=\"chatbot-action-btn\" (click)=\"service.close()\" title=\"Cerrar y reiniciar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13\" height=\"13\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\r\n <path d=\"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"chatbot-body\">\r\n @for (msg of service.messages(); track $index; let i = $index) {\r\n <div class=\"chat-row\" [class.chat-row-user]=\"msg.from === 'user'\">\r\n @if (msg.from === 'bot') {\r\n <span class=\"bot-icon\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n }\r\n <div class=\"chat-col\">\r\n <div class=\"message-bubble\" [class.bubble-bot]=\"msg.from === 'bot'\" [class.bubble-user]=\"msg.from === 'user'\">\r\n {{ msg.text }}\r\n </div>\r\n @if (msg.options && msg.options.length > 0) {\r\n <div class=\"options-container\">\r\n @for (opt of msg.options; track $index) {\r\n <button class=\"option-btn\" [disabled]=\"msg.optionsDisabled\" (click)=\"selectOption(opt, i)\">\r\n {{ opt.label }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (service.isTyping()) {\r\n <div class=\"chat-row\">\r\n <span class=\"bot-icon\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n <div class=\"message-bubble bubble-bot typing-bubble\">\r\n <span class=\"dot\"></span><span class=\"dot\"></span><span class=\"dot\"></span>\r\n </div>\r\n </div>\r\n }\r\n <div #messagesEnd></div>\r\n </div>\r\n\r\n <div class=\"chatbot-footer\">\r\n <button class=\"restart-btn\" (click)=\"service.restart()\">\u21BA Reiniciar conversaci\u00F3n</button>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{--chatbot-primary: #c50048}.chatbot-wrapper{position:fixed;bottom:24px;right:24px;z-index:10000;font-family:Poppins,sans-serif;animation:chatbotFabIn .26s cubic-bezier(.2,0,.2,1) both}.chatbot-wrapper.chatbot-left{right:auto;left:24px}@keyframes chatbotFabIn{0%{opacity:0;transform:translateY(14px) scale(.85)}to{opacity:1;transform:translateY(0) scale(1)}}.chatbot-dragging{-webkit-user-select:none;user-select:none}.chatbot-dragging *{cursor:grabbing!important}.chatbot-beta{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:#0000008c;color:#ffffffd9;font-size:9px;font-weight:600;letter-spacing:.08em;padding:2px 6px;border-radius:4px;pointer-events:none;text-transform:uppercase;white-space:nowrap}.chatbot-fab{cursor:grab;position:relative;width:54px;height:54px;border-radius:50%;border:none;background:var(--chatbot-primary);color:#fff;cursor:pointer;box-shadow:0 4px 18px #0000004d;display:flex;align-items:center;justify-content:center;transition:transform .2s ease,box-shadow .2s ease}.chatbot-fab:hover{transform:scale(1.08);box-shadow:0 6px 22px #0006}.chatbot-badge{position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;background:#facc15;border:2px solid #fff;animation:cbPulse 1.8s ease-in-out infinite}@keyframes cbPulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.3);opacity:.75}}.chatbot-fab--hidden{visibility:hidden;pointer-events:none}.chatbot-window{position:absolute;width:320px;max-height:490px;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 8px 36px #00000038;background:var(--background-card, #ffffff);animation:cbSlideUp .22s ease}.chatbot-window.open-above{bottom:62px}.chatbot-window.open-below{top:62px}.chatbot-window.open-right{left:0}.chatbot-window.open-left{right:0}@keyframes cbSlideUp{0%{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}.chatbot-header{padding:12px 14px;background:var(--chatbot-primary);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;cursor:grab}.chatbot-header-info{display:flex;align-items:center;gap:8px}.chatbot-avatar{font-size:20px;line-height:1}.chatbot-name{font-size:13px;font-weight:600}.chatbot-status{font-size:10px;opacity:.82}.chatbot-header-actions{display:flex;align-items:center;gap:2px}.chatbot-action-btn{background:none;border:none;color:#fff;cursor:pointer;padding:4px 6px;border-radius:4px;opacity:.75;display:flex;align-items:center;justify-content:center;transition:opacity .15s,background .15s}.chatbot-action-btn:hover{opacity:1;background:#ffffff2e}.chatbot-body{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;background:var(--background-color, #f0f0f0)}.chat-row{display:flex;align-items:flex-start;gap:6px}.chat-row.chat-row-user{flex-direction:row-reverse}.bot-icon{font-size:16px;flex-shrink:0;margin-top:4px}.chat-col{display:flex;flex-direction:column;gap:4px;max-width:82%}.message-bubble{padding:8px 11px;border-radius:12px;font-size:11.5px;line-height:1.55;word-break:break-word}.message-bubble.bubble-bot{background:var(--background-card, #ffffff);color:var(--text-color, #1d1d1d);border-bottom-left-radius:4px;box-shadow:0 1px 4px #00000012}.message-bubble.bubble-user{background:var(--chatbot-primary);color:#fff;border-bottom-right-radius:4px;align-self:flex-end}.options-container{display:flex;flex-direction:column;gap:4px}.option-btn{background:var(--background-card, #ffffff);color:var(--chatbot-primary);border:1.5px solid var(--chatbot-primary);border-radius:8px;padding:5px 10px;font-size:11px;font-weight:600;cursor:pointer;text-align:left;transition:background .18s ease,color .18s ease}.option-btn:hover:not(:disabled){background:var(--chatbot-primary);color:#fff}.option-btn:disabled{opacity:.38;cursor:default}.typing-bubble{display:flex;gap:4px;align-items:center;padding:10px 14px!important}.dot{width:7px;height:7px;background:var(--placeholder-color, #aaa);border-radius:50%;animation:cbBounce 1.2s ease-in-out infinite}.dot:nth-child(2){animation-delay:.18s}.dot:nth-child(3){animation-delay:.36s}@keyframes cbBounce{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-6px)}}.chatbot-footer{padding:7px 12px;background:var(--background-card, #ffffff);border-top:1px solid var(--border-color-modal, #e0e0e0);flex-shrink:0;display:flex;justify-content:center}.restart-btn{background:none;border:none;font-size:10.5px;color:var(--placeholder-color, #999);cursor:pointer;padding:3px 8px;border-radius:4px;transition:color .15s}.restart-btn:hover{color:var(--text-color, #333)}@media(max-width:768px){.chatbot-wrapper{display:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1146
|
+
}
|
|
1147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ChatbotComponent, decorators: [{
|
|
1148
|
+
type: Component,
|
|
1149
|
+
args: [{ selector: 'app-chatbot', providers: [ChatbotService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #wrapper class=\"chatbot-wrapper\"\r\n [class.chatbot-left]=\"config.position === 'bottom-left'\"\r\n [class.chatbot-dragging]=\"isDragging()\"\r\n [style.--chatbot-primary]=\"primaryColor\"\r\n [style.left.px]=\"position()?.x\"\r\n [style.top.px]=\"position()?.y\"\r\n [style.right]=\"position() ? 'auto' : null\"\r\n [style.bottom]=\"position() ? 'auto' : null\">\r\n\r\n @if (!service.isOpen()) {\r\n <span class=\"chatbot-beta\">Beta</span>\r\n }\r\n <button class=\"chatbot-fab\"\r\n [class.chatbot-fab--hidden]=\"service.isOpen()\"\r\n (mousedown)=\"startDrag($event)\"\r\n (click)=\"onFabClick()\"\r\n title=\"Abrir asistente\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"26\" height=\"26\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n @if (service.hasActiveConversation()) {\r\n <span class=\"chatbot-badge\" title=\"Conversaci\u00F3n en progreso\"></span>\r\n }\r\n </button>\r\n\r\n @if (service.isOpen()) {\r\n <div class=\"chatbot-window\"\r\n [class.open-above]=\"openDir() === 'above'\"\r\n [class.open-below]=\"openDir() === 'below'\"\r\n [class.open-right]=\"openHDir() === 'right'\"\r\n [class.open-left]=\"openHDir() === 'left'\">\r\n\r\n <div class=\"chatbot-header\" (mousedown)=\"startDrag($event)\">\r\n <div class=\"chatbot-header-info\">\r\n <span class=\"chatbot-avatar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n <div>\r\n <div class=\"chatbot-name\">{{ config.botName || 'Asistente' }}</div>\r\n <div class=\"chatbot-status\">En l\u00EDnea</div>\r\n </div>\r\n </div>\r\n <div class=\"chatbot-header-actions\">\r\n <button class=\"chatbot-action-btn\" (click)=\"service.minimize()\" title=\"Minimizar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\r\n <path d=\"M2 8a.5.5 0 0 1 .5-.5h11a.5.5 0 0 1 0 1h-11A.5.5 0 0 1 2 8z\" />\r\n </svg>\r\n </button>\r\n <button class=\"chatbot-action-btn\" (click)=\"service.close()\" title=\"Cerrar y reiniciar\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13\" height=\"13\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\r\n <path d=\"M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z\" />\r\n </svg>\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"chatbot-body\">\r\n @for (msg of service.messages(); track $index; let i = $index) {\r\n <div class=\"chat-row\" [class.chat-row-user]=\"msg.from === 'user'\">\r\n @if (msg.from === 'bot') {\r\n <span class=\"bot-icon\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n }\r\n <div class=\"chat-col\">\r\n <div class=\"message-bubble\" [class.bubble-bot]=\"msg.from === 'bot'\" [class.bubble-user]=\"msg.from === 'user'\">\r\n {{ msg.text }}\r\n </div>\r\n @if (msg.options && msg.options.length > 0) {\r\n <div class=\"options-container\">\r\n @for (opt of msg.options; track $index) {\r\n <button class=\"option-btn\" [disabled]=\"msg.optionsDisabled\" (click)=\"selectOption(opt, i)\">\r\n {{ opt.label }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (service.isTyping()) {\r\n <div class=\"chat-row\">\r\n <span class=\"bot-icon\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\r\n <path d=\"M12 2a2 2 0 0 1 2 2c0 .74-.4 1.39-1 1.73V7h1a7 7 0 0 1 7 7h1a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1h-1v1a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-1H2a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a7 7 0 0 1 7-7h1V5.73c-.6-.34-1-.99-1-1.73a2 2 0 0 1 2-2M7.5 13A2.5 2.5 0 0 0 5 15.5 2.5 2.5 0 0 0 7.5 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 7.5 13m9 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 16.5 13z\" />\r\n </svg>\r\n </span>\r\n <div class=\"message-bubble bubble-bot typing-bubble\">\r\n <span class=\"dot\"></span><span class=\"dot\"></span><span class=\"dot\"></span>\r\n </div>\r\n </div>\r\n }\r\n <div #messagesEnd></div>\r\n </div>\r\n\r\n <div class=\"chatbot-footer\">\r\n <button class=\"restart-btn\" (click)=\"service.restart()\">\u21BA Reiniciar conversaci\u00F3n</button>\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{--chatbot-primary: #c50048}.chatbot-wrapper{position:fixed;bottom:24px;right:24px;z-index:10000;font-family:Poppins,sans-serif;animation:chatbotFabIn .26s cubic-bezier(.2,0,.2,1) both}.chatbot-wrapper.chatbot-left{right:auto;left:24px}@keyframes chatbotFabIn{0%{opacity:0;transform:translateY(14px) scale(.85)}to{opacity:1;transform:translateY(0) scale(1)}}.chatbot-dragging{-webkit-user-select:none;user-select:none}.chatbot-dragging *{cursor:grabbing!important}.chatbot-beta{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:#0000008c;color:#ffffffd9;font-size:9px;font-weight:600;letter-spacing:.08em;padding:2px 6px;border-radius:4px;pointer-events:none;text-transform:uppercase;white-space:nowrap}.chatbot-fab{cursor:grab;position:relative;width:54px;height:54px;border-radius:50%;border:none;background:var(--chatbot-primary);color:#fff;cursor:pointer;box-shadow:0 4px 18px #0000004d;display:flex;align-items:center;justify-content:center;transition:transform .2s ease,box-shadow .2s ease}.chatbot-fab:hover{transform:scale(1.08);box-shadow:0 6px 22px #0006}.chatbot-badge{position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;background:#facc15;border:2px solid #fff;animation:cbPulse 1.8s ease-in-out infinite}@keyframes cbPulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.3);opacity:.75}}.chatbot-fab--hidden{visibility:hidden;pointer-events:none}.chatbot-window{position:absolute;width:320px;max-height:490px;border-radius:16px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 8px 36px #00000038;background:var(--background-card, #ffffff);animation:cbSlideUp .22s ease}.chatbot-window.open-above{bottom:62px}.chatbot-window.open-below{top:62px}.chatbot-window.open-right{left:0}.chatbot-window.open-left{right:0}@keyframes cbSlideUp{0%{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}.chatbot-header{padding:12px 14px;background:var(--chatbot-primary);color:#fff;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;cursor:grab}.chatbot-header-info{display:flex;align-items:center;gap:8px}.chatbot-avatar{font-size:20px;line-height:1}.chatbot-name{font-size:13px;font-weight:600}.chatbot-status{font-size:10px;opacity:.82}.chatbot-header-actions{display:flex;align-items:center;gap:2px}.chatbot-action-btn{background:none;border:none;color:#fff;cursor:pointer;padding:4px 6px;border-radius:4px;opacity:.75;display:flex;align-items:center;justify-content:center;transition:opacity .15s,background .15s}.chatbot-action-btn:hover{opacity:1;background:#ffffff2e}.chatbot-body{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;background:var(--background-color, #f0f0f0)}.chat-row{display:flex;align-items:flex-start;gap:6px}.chat-row.chat-row-user{flex-direction:row-reverse}.bot-icon{font-size:16px;flex-shrink:0;margin-top:4px}.chat-col{display:flex;flex-direction:column;gap:4px;max-width:82%}.message-bubble{padding:8px 11px;border-radius:12px;font-size:11.5px;line-height:1.55;word-break:break-word}.message-bubble.bubble-bot{background:var(--background-card, #ffffff);color:var(--text-color, #1d1d1d);border-bottom-left-radius:4px;box-shadow:0 1px 4px #00000012}.message-bubble.bubble-user{background:var(--chatbot-primary);color:#fff;border-bottom-right-radius:4px;align-self:flex-end}.options-container{display:flex;flex-direction:column;gap:4px}.option-btn{background:var(--background-card, #ffffff);color:var(--chatbot-primary);border:1.5px solid var(--chatbot-primary);border-radius:8px;padding:5px 10px;font-size:11px;font-weight:600;cursor:pointer;text-align:left;transition:background .18s ease,color .18s ease}.option-btn:hover:not(:disabled){background:var(--chatbot-primary);color:#fff}.option-btn:disabled{opacity:.38;cursor:default}.typing-bubble{display:flex;gap:4px;align-items:center;padding:10px 14px!important}.dot{width:7px;height:7px;background:var(--placeholder-color, #aaa);border-radius:50%;animation:cbBounce 1.2s ease-in-out infinite}.dot:nth-child(2){animation-delay:.18s}.dot:nth-child(3){animation-delay:.36s}@keyframes cbBounce{0%,80%,to{transform:translateY(0)}40%{transform:translateY(-6px)}}.chatbot-footer{padding:7px 12px;background:var(--background-card, #ffffff);border-top:1px solid var(--border-color-modal, #e0e0e0);flex-shrink:0;display:flex;justify-content:center}.restart-btn{background:none;border:none;font-size:10.5px;color:var(--placeholder-color, #999);cursor:pointer;padding:3px 8px;border-radius:4px;transition:color .15s}.restart-btn:hover{color:var(--text-color, #333)}@media(max-width:768px){.chatbot-wrapper{display:none}}\n"] }]
|
|
1150
|
+
}], ctorParameters: () => [] });
|
|
1151
|
+
|
|
1152
|
+
class NotFoundComponent {
|
|
1153
|
+
location = inject(Location);
|
|
1154
|
+
onBack() {
|
|
1155
|
+
this.location.back();
|
|
1156
|
+
}
|
|
1157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: NotFoundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.25", type: NotFoundComponent, isStandalone: true, selector: "app-not-found", ngImport: i0, template: "<div class=\"nf-page d-flex align-items-center justify-content-center vh-100\">\r\n\r\n <!-- Blobs decorativos de fondo -->\r\n <div class=\"nf-blob nf-blob-1\"></div>\r\n <div class=\"nf-blob nf-blob-2\"></div>\r\n\r\n <div class=\"nf-card bg-white shadow-s text-center px-4 px-md-5 py-4 mx-3\">\r\n\r\n <!-- Ilustraci\u00F3n: ventana con 404 y lupa buscando -->\r\n <svg class=\"nf-illustration\" viewBox=\"0 0 520 340\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"P\u00E1gina no encontrada\">\r\n <defs>\r\n <linearGradient id=\"nfGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" style=\"stop-color: var(--sidebar-accent)\" />\r\n <stop offset=\"100%\" style=\"stop-color: var(--sidebar-accent); stop-opacity: 0.55\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <!-- \u00D3rbita punteada de fondo -->\r\n <circle class=\"nf-orbit\" cx=\"260\" cy=\"170\" r=\"150\"\r\n stroke=\"var(--font-border-input)\" stroke-width=\"1.5\"\r\n stroke-dasharray=\"6 10\" opacity=\"0.7\" />\r\n\r\n <!-- Decoraciones flotantes -->\r\n <g class=\"nf-spark nf-spark-1\" stroke=\"var(--sidebar-accent)\" stroke-width=\"3\" stroke-linecap=\"round\">\r\n <path d=\"M92 78 v20 M82 88 h20\" />\r\n </g>\r\n <g class=\"nf-spark nf-spark-2\" stroke=\"var(--placeholder-color)\" stroke-width=\"3\" stroke-linecap=\"round\">\r\n <path d=\"M448 220 v16 M440 228 h16\" />\r\n </g>\r\n <circle class=\"nf-spark nf-spark-3\" cx=\"430\" cy=\"70\" r=\"6\" fill=\"var(--sidebar-accent)\" opacity=\"0.7\" />\r\n <circle class=\"nf-spark nf-spark-1\" cx=\"70\" cy=\"230\" r=\"5\" fill=\"var(--placeholder-color)\" opacity=\"0.7\" />\r\n <path class=\"nf-spark nf-spark-2\" d=\"M120 300 q8 -10 16 0 q8 10 16 0\"\r\n stroke=\"var(--font-border-input)\" stroke-width=\"3\" stroke-linecap=\"round\" fill=\"none\" />\r\n\r\n <!-- Ventana de navegador -->\r\n <g class=\"nf-window\">\r\n <rect x=\"120\" y=\"60\" width=\"280\" height=\"200\" rx=\"16\"\r\n fill=\"var(--background-input)\" stroke=\"var(--font-border-input)\" stroke-width=\"2\" />\r\n <!-- Barra superior -->\r\n <line x1=\"120\" y1=\"98\" x2=\"400\" y2=\"98\" stroke=\"var(--font-border-input)\" stroke-width=\"2\" />\r\n <circle cx=\"144\" cy=\"79\" r=\"5\" fill=\"var(--sidebar-accent)\" />\r\n <circle cx=\"162\" cy=\"79\" r=\"5\" fill=\"var(--placeholder-color)\" opacity=\"0.8\" />\r\n <circle cx=\"180\" cy=\"79\" r=\"5\" fill=\"var(--font-border-input)\" />\r\n <!-- Barra de direcci\u00F3n -->\r\n <rect x=\"200\" y=\"71\" width=\"184\" height=\"16\" rx=\"8\" fill=\"var(--font-border-input)\" opacity=\"0.5\" />\r\n\r\n <!-- 404 dentro de la ventana -->\r\n <text x=\"260\" y=\"188\" text-anchor=\"middle\" class=\"nf-404-text\" fill=\"url(#nfGrad)\">404</text>\r\n\r\n <!-- L\u00EDneas de contenido (skeleton) -->\r\n <rect x=\"180\" y=\"212\" width=\"160\" height=\"9\" rx=\"4.5\" fill=\"var(--font-border-input)\" opacity=\"0.7\" />\r\n <rect x=\"205\" y=\"230\" width=\"110\" height=\"9\" rx=\"4.5\" fill=\"var(--font-border-input)\" opacity=\"0.45\" />\r\n </g>\r\n\r\n <!-- Lupa buscando -->\r\n <g class=\"nf-lens\">\r\n <circle cx=\"352\" cy=\"238\" r=\"46\" fill=\"var(--background-card)\" fill-opacity=\"0.55\"\r\n stroke=\"url(#nfGrad)\" stroke-width=\"8\" />\r\n <line x1=\"386\" y1=\"272\" x2=\"424\" y2=\"310\" stroke=\"url(#nfGrad)\" stroke-width=\"14\" stroke-linecap=\"round\" />\r\n <!-- Signo de interrogaci\u00F3n dentro de la lupa -->\r\n <path d=\"M340 224 q0 -14 13 -14 q13 0 13 12 q0 9 -10 13 q-3 1.5 -3 7\"\r\n stroke=\"var(--text-color)\" stroke-width=\"5\" stroke-linecap=\"round\" fill=\"none\" />\r\n <circle cx=\"353\" cy=\"256\" r=\"3.5\" fill=\"var(--text-color)\" />\r\n </g>\r\n </svg>\r\n\r\n <!-- Badge -->\r\n <span class=\"nf-badge fw-semibold\">ERROR 404</span>\r\n\r\n <h2 class=\"fw-semibold text-input mt-3\">P\u00E1gina no encontrada</h2>\r\n\r\n <p class=\"nf-desc fs-6 mt-2 mb-4 mx-auto\">\r\n Lo sentimos, la p\u00E1gina que buscas no existe o fue movida.\r\n Verifica la direcci\u00F3n o regresa al inicio.\r\n </p>\r\n\r\n <!-- Acciones -->\r\n <div class=\"d-flex gap-3 justify-content-center flex-wrap\">\r\n <button type=\"button\" (click)=\"onBack()\" class=\"btn nf-btn-primary px-4 py-2 shadow\">\r\n <i class=\"fa-solid fa-arrow-left me-2\"></i>Volver\r\n </button>\r\n <a routerLink=\"/\" class=\"btn nf-btn-ghost text-dark px-4 py-2\">\r\n <i class=\"fa-solid fa-house me-2\"></i>Ir al inicio\r\n </a>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.nf-page{position:relative;overflow:hidden;background:var(--background-color)}.nf-blob{position:absolute;border-radius:50%;filter:blur(90px);opacity:.22;pointer-events:none;animation:nf-drift 12s ease-in-out infinite alternate}.nf-blob-1{width:420px;height:420px;top:-120px;left:-100px;background:var(--sidebar-accent)}.nf-blob-2{width:360px;height:360px;bottom:-100px;right:-80px;background:color-mix(in srgb,var(--sidebar-accent) 60%,var(--text-color));animation-delay:-6s}@keyframes nf-drift{0%{transform:translate(0) scale(1)}to{transform:translate(40px,30px) scale(1.12)}}.nf-card{position:relative;z-index:1;max-width:560px;width:100%;border-radius:1.5rem;border:1px solid var(--font-border-input);backdrop-filter:blur(var(--blur-modal))}.nf-illustration{width:100%;max-width:380px;height:auto;margin-bottom:.5rem}.nf-404-text{font-size:68px;font-weight:800;letter-spacing:4px}.nf-window{animation:nf-float 5s ease-in-out infinite}.nf-lens{transform-origin:370px 260px;animation:nf-search 4s ease-in-out infinite}@keyframes nf-float{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes nf-search{0%,to{transform:translate(0) rotate(0)}35%{transform:translate(-10px,-12px) rotate(-4deg)}70%{transform:translate(6px,-4px) rotate(3deg)}}.nf-orbit{transform-origin:260px 170px;animation:nf-spin 40s linear infinite}@keyframes nf-spin{to{transform:rotate(360deg)}}.nf-spark{animation:nf-twinkle 3s ease-in-out infinite}.nf-spark-2{animation-delay:-1s}.nf-spark-3{animation-delay:-2s}@keyframes nf-twinkle{0%,to{opacity:.9}50%{opacity:.25}}.nf-badge{display:inline-block;font-size:.75rem;letter-spacing:.15em;padding:.35rem .9rem;border-radius:999px;color:var(--sidebar-accent);background:color-mix(in srgb,var(--sidebar-accent) 12%,transparent);border:1px solid color-mix(in srgb,var(--sidebar-accent) 35%,transparent)}.nf-desc{color:var(--placeholder-color);max-width:380px}.nf-btn-primary{color:#fff;border:none;border-radius:.75rem;background:linear-gradient(135deg,var(--sidebar-accent),color-mix(in srgb,var(--sidebar-accent) 70%,#000));transition:transform .25s ease,box-shadow .25s ease}.nf-btn-primary:hover{color:#fff;transform:translateY(-2px);box-shadow:0 8px 20px color-mix(in srgb,var(--sidebar-accent) 40%,transparent)}.nf-btn-ghost{border-radius:.75rem;border:1px solid var(--font-border-input);background:transparent;transition:transform .25s ease,background .25s ease}.nf-btn-ghost:hover{transform:translateY(-2px);background:var(--background-btn-light);border-color:var(--font-border-input)}@media(prefers-reduced-motion:reduce){.nf-blob,.nf-window,.nf-lens,.nf-orbit,.nf-spark{animation:none}}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
|
|
1159
|
+
}
|
|
1160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: NotFoundComponent, decorators: [{
|
|
1161
|
+
type: Component,
|
|
1162
|
+
args: [{ selector: 'app-not-found', imports: [RouterLink], template: "<div class=\"nf-page d-flex align-items-center justify-content-center vh-100\">\r\n\r\n <!-- Blobs decorativos de fondo -->\r\n <div class=\"nf-blob nf-blob-1\"></div>\r\n <div class=\"nf-blob nf-blob-2\"></div>\r\n\r\n <div class=\"nf-card bg-white shadow-s text-center px-4 px-md-5 py-4 mx-3\">\r\n\r\n <!-- Ilustraci\u00F3n: ventana con 404 y lupa buscando -->\r\n <svg class=\"nf-illustration\" viewBox=\"0 0 520 340\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-label=\"P\u00E1gina no encontrada\">\r\n <defs>\r\n <linearGradient id=\"nfGrad\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\r\n <stop offset=\"0%\" style=\"stop-color: var(--sidebar-accent)\" />\r\n <stop offset=\"100%\" style=\"stop-color: var(--sidebar-accent); stop-opacity: 0.55\" />\r\n </linearGradient>\r\n </defs>\r\n\r\n <!-- \u00D3rbita punteada de fondo -->\r\n <circle class=\"nf-orbit\" cx=\"260\" cy=\"170\" r=\"150\"\r\n stroke=\"var(--font-border-input)\" stroke-width=\"1.5\"\r\n stroke-dasharray=\"6 10\" opacity=\"0.7\" />\r\n\r\n <!-- Decoraciones flotantes -->\r\n <g class=\"nf-spark nf-spark-1\" stroke=\"var(--sidebar-accent)\" stroke-width=\"3\" stroke-linecap=\"round\">\r\n <path d=\"M92 78 v20 M82 88 h20\" />\r\n </g>\r\n <g class=\"nf-spark nf-spark-2\" stroke=\"var(--placeholder-color)\" stroke-width=\"3\" stroke-linecap=\"round\">\r\n <path d=\"M448 220 v16 M440 228 h16\" />\r\n </g>\r\n <circle class=\"nf-spark nf-spark-3\" cx=\"430\" cy=\"70\" r=\"6\" fill=\"var(--sidebar-accent)\" opacity=\"0.7\" />\r\n <circle class=\"nf-spark nf-spark-1\" cx=\"70\" cy=\"230\" r=\"5\" fill=\"var(--placeholder-color)\" opacity=\"0.7\" />\r\n <path class=\"nf-spark nf-spark-2\" d=\"M120 300 q8 -10 16 0 q8 10 16 0\"\r\n stroke=\"var(--font-border-input)\" stroke-width=\"3\" stroke-linecap=\"round\" fill=\"none\" />\r\n\r\n <!-- Ventana de navegador -->\r\n <g class=\"nf-window\">\r\n <rect x=\"120\" y=\"60\" width=\"280\" height=\"200\" rx=\"16\"\r\n fill=\"var(--background-input)\" stroke=\"var(--font-border-input)\" stroke-width=\"2\" />\r\n <!-- Barra superior -->\r\n <line x1=\"120\" y1=\"98\" x2=\"400\" y2=\"98\" stroke=\"var(--font-border-input)\" stroke-width=\"2\" />\r\n <circle cx=\"144\" cy=\"79\" r=\"5\" fill=\"var(--sidebar-accent)\" />\r\n <circle cx=\"162\" cy=\"79\" r=\"5\" fill=\"var(--placeholder-color)\" opacity=\"0.8\" />\r\n <circle cx=\"180\" cy=\"79\" r=\"5\" fill=\"var(--font-border-input)\" />\r\n <!-- Barra de direcci\u00F3n -->\r\n <rect x=\"200\" y=\"71\" width=\"184\" height=\"16\" rx=\"8\" fill=\"var(--font-border-input)\" opacity=\"0.5\" />\r\n\r\n <!-- 404 dentro de la ventana -->\r\n <text x=\"260\" y=\"188\" text-anchor=\"middle\" class=\"nf-404-text\" fill=\"url(#nfGrad)\">404</text>\r\n\r\n <!-- L\u00EDneas de contenido (skeleton) -->\r\n <rect x=\"180\" y=\"212\" width=\"160\" height=\"9\" rx=\"4.5\" fill=\"var(--font-border-input)\" opacity=\"0.7\" />\r\n <rect x=\"205\" y=\"230\" width=\"110\" height=\"9\" rx=\"4.5\" fill=\"var(--font-border-input)\" opacity=\"0.45\" />\r\n </g>\r\n\r\n <!-- Lupa buscando -->\r\n <g class=\"nf-lens\">\r\n <circle cx=\"352\" cy=\"238\" r=\"46\" fill=\"var(--background-card)\" fill-opacity=\"0.55\"\r\n stroke=\"url(#nfGrad)\" stroke-width=\"8\" />\r\n <line x1=\"386\" y1=\"272\" x2=\"424\" y2=\"310\" stroke=\"url(#nfGrad)\" stroke-width=\"14\" stroke-linecap=\"round\" />\r\n <!-- Signo de interrogaci\u00F3n dentro de la lupa -->\r\n <path d=\"M340 224 q0 -14 13 -14 q13 0 13 12 q0 9 -10 13 q-3 1.5 -3 7\"\r\n stroke=\"var(--text-color)\" stroke-width=\"5\" stroke-linecap=\"round\" fill=\"none\" />\r\n <circle cx=\"353\" cy=\"256\" r=\"3.5\" fill=\"var(--text-color)\" />\r\n </g>\r\n </svg>\r\n\r\n <!-- Badge -->\r\n <span class=\"nf-badge fw-semibold\">ERROR 404</span>\r\n\r\n <h2 class=\"fw-semibold text-input mt-3\">P\u00E1gina no encontrada</h2>\r\n\r\n <p class=\"nf-desc fs-6 mt-2 mb-4 mx-auto\">\r\n Lo sentimos, la p\u00E1gina que buscas no existe o fue movida.\r\n Verifica la direcci\u00F3n o regresa al inicio.\r\n </p>\r\n\r\n <!-- Acciones -->\r\n <div class=\"d-flex gap-3 justify-content-center flex-wrap\">\r\n <button type=\"button\" (click)=\"onBack()\" class=\"btn nf-btn-primary px-4 py-2 shadow\">\r\n <i class=\"fa-solid fa-arrow-left me-2\"></i>Volver\r\n </button>\r\n <a routerLink=\"/\" class=\"btn nf-btn-ghost text-dark px-4 py-2\">\r\n <i class=\"fa-solid fa-house me-2\"></i>Ir al inicio\r\n </a>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n", styles: ["@charset \"UTF-8\";.nf-page{position:relative;overflow:hidden;background:var(--background-color)}.nf-blob{position:absolute;border-radius:50%;filter:blur(90px);opacity:.22;pointer-events:none;animation:nf-drift 12s ease-in-out infinite alternate}.nf-blob-1{width:420px;height:420px;top:-120px;left:-100px;background:var(--sidebar-accent)}.nf-blob-2{width:360px;height:360px;bottom:-100px;right:-80px;background:color-mix(in srgb,var(--sidebar-accent) 60%,var(--text-color));animation-delay:-6s}@keyframes nf-drift{0%{transform:translate(0) scale(1)}to{transform:translate(40px,30px) scale(1.12)}}.nf-card{position:relative;z-index:1;max-width:560px;width:100%;border-radius:1.5rem;border:1px solid var(--font-border-input);backdrop-filter:blur(var(--blur-modal))}.nf-illustration{width:100%;max-width:380px;height:auto;margin-bottom:.5rem}.nf-404-text{font-size:68px;font-weight:800;letter-spacing:4px}.nf-window{animation:nf-float 5s ease-in-out infinite}.nf-lens{transform-origin:370px 260px;animation:nf-search 4s ease-in-out infinite}@keyframes nf-float{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes nf-search{0%,to{transform:translate(0) rotate(0)}35%{transform:translate(-10px,-12px) rotate(-4deg)}70%{transform:translate(6px,-4px) rotate(3deg)}}.nf-orbit{transform-origin:260px 170px;animation:nf-spin 40s linear infinite}@keyframes nf-spin{to{transform:rotate(360deg)}}.nf-spark{animation:nf-twinkle 3s ease-in-out infinite}.nf-spark-2{animation-delay:-1s}.nf-spark-3{animation-delay:-2s}@keyframes nf-twinkle{0%,to{opacity:.9}50%{opacity:.25}}.nf-badge{display:inline-block;font-size:.75rem;letter-spacing:.15em;padding:.35rem .9rem;border-radius:999px;color:var(--sidebar-accent);background:color-mix(in srgb,var(--sidebar-accent) 12%,transparent);border:1px solid color-mix(in srgb,var(--sidebar-accent) 35%,transparent)}.nf-desc{color:var(--placeholder-color);max-width:380px}.nf-btn-primary{color:#fff;border:none;border-radius:.75rem;background:linear-gradient(135deg,var(--sidebar-accent),color-mix(in srgb,var(--sidebar-accent) 70%,#000));transition:transform .25s ease,box-shadow .25s ease}.nf-btn-primary:hover{color:#fff;transform:translateY(-2px);box-shadow:0 8px 20px color-mix(in srgb,var(--sidebar-accent) 40%,transparent)}.nf-btn-ghost{border-radius:.75rem;border:1px solid var(--font-border-input);background:transparent;transition:transform .25s ease,background .25s ease}.nf-btn-ghost:hover{transform:translateY(-2px);background:var(--background-btn-light);border-color:var(--font-border-input)}@media(prefers-reduced-motion:reduce){.nf-blob,.nf-window,.nf-lens,.nf-orbit,.nf-spark{animation:none}}\n"] }]
|
|
1163
|
+
}] });
|
|
1164
|
+
|
|
1165
|
+
class DashboardChartDonutComponent {
|
|
1166
|
+
textClass = input('text-white');
|
|
1167
|
+
complemento = input('');
|
|
1168
|
+
data = input([]);
|
|
1169
|
+
keyValue = input('value');
|
|
1170
|
+
keyDescri = input('descri');
|
|
1171
|
+
palette = input([]);
|
|
1172
|
+
clicked = output();
|
|
1173
|
+
hoveredIndex = signal(-1);
|
|
1174
|
+
// ── Dona ──────────────────────────────────────────────────────────────────
|
|
1175
|
+
C = 2 * Math.PI * 70;
|
|
1176
|
+
GAP = 2;
|
|
1177
|
+
donutSegments = computed(() => {
|
|
1178
|
+
const data = this.data();
|
|
1179
|
+
const palette = this.palette();
|
|
1180
|
+
const total = data.reduce((s, i) => s + (i[this.keyValue()] || 0), 0);
|
|
1181
|
+
if (total === 0)
|
|
1182
|
+
return [];
|
|
1183
|
+
let cumPercent = 0;
|
|
1184
|
+
return data.map((item, index) => {
|
|
1185
|
+
const val = item[this.keyValue()] || 0;
|
|
1186
|
+
const percent = val / total;
|
|
1187
|
+
const arcLength = Math.max(0, percent * this.C - this.GAP);
|
|
1188
|
+
const rotation = cumPercent * 360 - 90;
|
|
1189
|
+
cumPercent += percent;
|
|
1190
|
+
return {
|
|
1191
|
+
color: palette[index % palette.length],
|
|
1192
|
+
strokeDasharray: `${arcLength} ${this.C - arcLength}`,
|
|
1193
|
+
transform: `rotate(${rotation}, 100, 100)`,
|
|
1194
|
+
label: item[this.keyDescri()] ?? '',
|
|
1195
|
+
value: val,
|
|
1196
|
+
displayValue: String(val),
|
|
1197
|
+
percent: val > 0 ? (Math.round(percent * 100) < 1 ? '<1' : String(Math.round(percent * 100))) : '0',
|
|
1198
|
+
item,
|
|
1199
|
+
};
|
|
1200
|
+
});
|
|
1201
|
+
});
|
|
1202
|
+
centerDisplay = computed(() => {
|
|
1203
|
+
const idx = this.hoveredIndex();
|
|
1204
|
+
const segs = this.donutSegments();
|
|
1205
|
+
if (idx >= 0 && segs[idx]) {
|
|
1206
|
+
const s = segs[idx];
|
|
1207
|
+
return { value: s.displayValue, sub: s.percent + '%' };
|
|
1208
|
+
}
|
|
1209
|
+
const total = segs.reduce((acc, s) => acc + s.value, 0);
|
|
1210
|
+
return { value: String(total), sub: 'Total' };
|
|
1211
|
+
});
|
|
1212
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardChartDonutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1213
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DashboardChartDonutComponent, isStandalone: true, selector: "app-dashboard-chart-donut", inputs: { textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null }, complemento: { classPropertyName: "complemento", publicName: "complemento", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, keyValue: { classPropertyName: "keyValue", publicName: "keyValue", isSignal: true, isRequired: false, transformFunction: null }, keyDescri: { classPropertyName: "keyDescri", publicName: "keyDescri", isSignal: true, isRequired: false, transformFunction: null }, palette: { classPropertyName: "palette", publicName: "palette", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
1214
|
+
<div class="d-flex flex-column align-items-center py-1 px-2">
|
|
1215
|
+
|
|
1216
|
+
<!-- SVG ring -->
|
|
1217
|
+
<div style="position:relative; width:160px; height:160px; flex-shrink:0;">
|
|
1218
|
+
<svg viewBox="0 0 200 200" style="width:100%; height:100%;">
|
|
1219
|
+
@for (seg of donutSegments(); track $index) {
|
|
1220
|
+
<circle cx="100" cy="100" r="70" fill="none"
|
|
1221
|
+
[attr.stroke]="seg.color"
|
|
1222
|
+
stroke-width="42"
|
|
1223
|
+
[attr.stroke-dasharray]="seg.strokeDasharray"
|
|
1224
|
+
[attr.transform]="seg.transform"
|
|
1225
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1226
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.3'"
|
|
1227
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1228
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1229
|
+
(click)="clicked.emit(seg.item)" />
|
|
1230
|
+
}
|
|
1231
|
+
</svg>
|
|
1232
|
+
|
|
1233
|
+
<!-- Centro: cambia al hacer hover -->
|
|
1234
|
+
<div style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
|
|
1235
|
+
text-align:center; pointer-events:none; line-height:1.2; width:70px;">
|
|
1236
|
+
<div style="font-size:1.4rem; font-weight:700; color:#fff; white-space:nowrap;">
|
|
1237
|
+
{{ centerDisplay().value }}
|
|
1238
|
+
</div>
|
|
1239
|
+
<div style="font-size:.7rem; color:rgba(255,255,255,0.65); text-transform:uppercase; letter-spacing:.04em;">
|
|
1240
|
+
{{ centerDisplay().sub }}
|
|
1241
|
+
</div>
|
|
1242
|
+
</div>
|
|
1243
|
+
</div>
|
|
1244
|
+
|
|
1245
|
+
<!-- Leyenda -->
|
|
1246
|
+
<ul class="list-unstyled m-0 w-100 mt-2">
|
|
1247
|
+
@for (seg of donutSegments(); track $index) {
|
|
1248
|
+
<li class="d-flex align-items-start gap-2 mb-2"
|
|
1249
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1250
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.35'"
|
|
1251
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1252
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1253
|
+
(click)="clicked.emit(seg.item)">
|
|
1254
|
+
<span class="rounded-circle flex-shrink-0 mt-1"
|
|
1255
|
+
[ngStyle]="{ background: seg.color }"
|
|
1256
|
+
style="width:9px; height:9px; display:inline-block;">
|
|
1257
|
+
</span>
|
|
1258
|
+
<span [ngClass]="textClass()" style="font-size:.75rem; line-height:1.3; flex:1;">
|
|
1259
|
+
{{ seg.label }}
|
|
1260
|
+
</span>
|
|
1261
|
+
<span class="flex-shrink-0 px-1"
|
|
1262
|
+
style="font-size:.75rem; font-weight:600; color:rgba(255,255,255,0.9); white-space:nowrap;">
|
|
1263
|
+
{{ complemento() }}{{ seg.displayValue }}
|
|
1264
|
+
<span style="opacity:.7;">({{ seg.percent }}%)</span>
|
|
1265
|
+
</span>
|
|
1266
|
+
</li>
|
|
1267
|
+
}
|
|
1268
|
+
</ul>
|
|
1269
|
+
|
|
1270
|
+
</div>
|
|
1271
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1272
|
+
}
|
|
1273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardChartDonutComponent, decorators: [{
|
|
1274
|
+
type: Component,
|
|
1275
|
+
args: [{
|
|
1276
|
+
selector: 'app-dashboard-chart-donut',
|
|
1277
|
+
imports: [NgClass, NgStyle],
|
|
1278
|
+
template: `
|
|
1279
|
+
<div class="d-flex flex-column align-items-center py-1 px-2">
|
|
1280
|
+
|
|
1281
|
+
<!-- SVG ring -->
|
|
1282
|
+
<div style="position:relative; width:160px; height:160px; flex-shrink:0;">
|
|
1283
|
+
<svg viewBox="0 0 200 200" style="width:100%; height:100%;">
|
|
1284
|
+
@for (seg of donutSegments(); track $index) {
|
|
1285
|
+
<circle cx="100" cy="100" r="70" fill="none"
|
|
1286
|
+
[attr.stroke]="seg.color"
|
|
1287
|
+
stroke-width="42"
|
|
1288
|
+
[attr.stroke-dasharray]="seg.strokeDasharray"
|
|
1289
|
+
[attr.transform]="seg.transform"
|
|
1290
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1291
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.3'"
|
|
1292
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1293
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1294
|
+
(click)="clicked.emit(seg.item)" />
|
|
1295
|
+
}
|
|
1296
|
+
</svg>
|
|
1297
|
+
|
|
1298
|
+
<!-- Centro: cambia al hacer hover -->
|
|
1299
|
+
<div style="position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
|
|
1300
|
+
text-align:center; pointer-events:none; line-height:1.2; width:70px;">
|
|
1301
|
+
<div style="font-size:1.4rem; font-weight:700; color:#fff; white-space:nowrap;">
|
|
1302
|
+
{{ centerDisplay().value }}
|
|
1303
|
+
</div>
|
|
1304
|
+
<div style="font-size:.7rem; color:rgba(255,255,255,0.65); text-transform:uppercase; letter-spacing:.04em;">
|
|
1305
|
+
{{ centerDisplay().sub }}
|
|
1306
|
+
</div>
|
|
1307
|
+
</div>
|
|
1308
|
+
</div>
|
|
1309
|
+
|
|
1310
|
+
<!-- Leyenda -->
|
|
1311
|
+
<ul class="list-unstyled m-0 w-100 mt-2">
|
|
1312
|
+
@for (seg of donutSegments(); track $index) {
|
|
1313
|
+
<li class="d-flex align-items-start gap-2 mb-2"
|
|
1314
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1315
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.35'"
|
|
1316
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1317
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1318
|
+
(click)="clicked.emit(seg.item)">
|
|
1319
|
+
<span class="rounded-circle flex-shrink-0 mt-1"
|
|
1320
|
+
[ngStyle]="{ background: seg.color }"
|
|
1321
|
+
style="width:9px; height:9px; display:inline-block;">
|
|
1322
|
+
</span>
|
|
1323
|
+
<span [ngClass]="textClass()" style="font-size:.75rem; line-height:1.3; flex:1;">
|
|
1324
|
+
{{ seg.label }}
|
|
1325
|
+
</span>
|
|
1326
|
+
<span class="flex-shrink-0 px-1"
|
|
1327
|
+
style="font-size:.75rem; font-weight:600; color:rgba(255,255,255,0.9); white-space:nowrap;">
|
|
1328
|
+
{{ complemento() }}{{ seg.displayValue }}
|
|
1329
|
+
<span style="opacity:.7;">({{ seg.percent }}%)</span>
|
|
1330
|
+
</span>
|
|
1331
|
+
</li>
|
|
1332
|
+
}
|
|
1333
|
+
</ul>
|
|
1334
|
+
|
|
1335
|
+
</div>
|
|
1336
|
+
`
|
|
1337
|
+
}]
|
|
1338
|
+
}] });
|
|
1339
|
+
|
|
1340
|
+
class DashboardChartBarsComponent {
|
|
1341
|
+
data = input.required();
|
|
1342
|
+
maxValue = input(null);
|
|
1343
|
+
keyValue = input('value');
|
|
1344
|
+
keyDescri = input('descri');
|
|
1345
|
+
palette = input([]);
|
|
1346
|
+
textClass = input('text-white');
|
|
1347
|
+
complemento = input('');
|
|
1348
|
+
clicked = output();
|
|
1349
|
+
hoveredIndex = signal(-1);
|
|
1350
|
+
// ── Barras horizontales SVG ───────────────────────────────────────────────
|
|
1351
|
+
chartData = computed(() => {
|
|
1352
|
+
const data = this.data();
|
|
1353
|
+
const max = Number(this.maxValue());
|
|
1354
|
+
const palette = this.palette();
|
|
1355
|
+
const total = data.reduce((s, i) => s + (i[this.keyValue()] || 0), 0);
|
|
1356
|
+
const LFT = 6, RGT = 6, TOP = 4, BTM = 16, SLOT_H = 18, TICK_N = 4, SVG_W = 260;
|
|
1357
|
+
const BAR_H = Math.round(SLOT_H * 0.6);
|
|
1358
|
+
const chartW = SVG_W - LFT - RGT;
|
|
1359
|
+
const chartH = data.length * SLOT_H;
|
|
1360
|
+
const svgH = TOP + chartH + BTM;
|
|
1361
|
+
const axisY = TOP + chartH;
|
|
1362
|
+
const xTicks = Array.from({ length: TICK_N + 1 }, (_, i) => ({
|
|
1363
|
+
val: Math.round((i / TICK_N) * max),
|
|
1364
|
+
x: Math.round(LFT + (i / TICK_N) * chartW),
|
|
1365
|
+
}));
|
|
1366
|
+
const bars = data.map((item, i) => {
|
|
1367
|
+
const val = item[this.keyValue()] || 0;
|
|
1368
|
+
const w = max > 0 ? Math.max(2, Math.round((val / max) * chartW)) : 2;
|
|
1369
|
+
const y = TOP + i * SLOT_H + Math.round((SLOT_H - BAR_H) / 2);
|
|
1370
|
+
const cy = y + Math.round(BAR_H / 2);
|
|
1371
|
+
const tipX = Math.min(LFT + w + 4, SVG_W - 50);
|
|
1372
|
+
const tipY = Math.max(0, cy - 14);
|
|
1373
|
+
return {
|
|
1374
|
+
x: LFT, y, w, barH: BAR_H, cy,
|
|
1375
|
+
tooltipX: tipX, tooltipY: tipY,
|
|
1376
|
+
value: val, displayValue: String(val),
|
|
1377
|
+
percent: total > 0 ? (val > 0 ? (Math.round((val / total) * 100) < 1 ? '<1' : String(Math.round((val / total) * 100))) : '0') : '0',
|
|
1378
|
+
label: (item[this.keyDescri()] ?? '').toString(),
|
|
1379
|
+
color: palette[i % palette.length],
|
|
1380
|
+
item,
|
|
1381
|
+
};
|
|
1382
|
+
});
|
|
1383
|
+
return { bars, xTicks, svgW: SVG_W, svgH, axisY, axisLft: LFT, svgRgt: SVG_W - RGT, svgTop: TOP };
|
|
1384
|
+
});
|
|
1385
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardChartBarsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1386
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DashboardChartBarsComponent, isStandalone: true, selector: "app-dashboard-chart-bars", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, keyValue: { classPropertyName: "keyValue", publicName: "keyValue", isSignal: true, isRequired: false, transformFunction: null }, keyDescri: { classPropertyName: "keyDescri", publicName: "keyDescri", isSignal: true, isRequired: false, transformFunction: null }, palette: { classPropertyName: "palette", publicName: "palette", isSignal: true, isRequired: false, transformFunction: null }, textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null }, complemento: { classPropertyName: "complemento", publicName: "complemento", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
1387
|
+
<div class="d-flex flex-column align-items-center py-1 px-2">
|
|
1388
|
+
|
|
1389
|
+
<!-- SVG: barras horizontales + ejes -->
|
|
1390
|
+
<div style="width:100%;">
|
|
1391
|
+
<svg [attr.viewBox]="'0 0 ' + chartData().svgW + ' ' + chartData().svgH"
|
|
1392
|
+
style="width:100%; display:block; overflow:visible;">
|
|
1393
|
+
|
|
1394
|
+
<!-- Grid lines verticales + labels eje X -->
|
|
1395
|
+
@for (tick of chartData().xTicks; track tick.val) {
|
|
1396
|
+
<line [attr.x1]="tick.x" [attr.y1]="chartData().svgTop"
|
|
1397
|
+
[attr.x2]="tick.x" [attr.y2]="chartData().axisY"
|
|
1398
|
+
stroke="rgba(255,255,255,0.1)" stroke-width="1" />
|
|
1399
|
+
<text [attr.x]="tick.x" [attr.y]="chartData().axisY + 10"
|
|
1400
|
+
text-anchor="middle" font-size="7" fill="rgba(255,255,255,0.45)"
|
|
1401
|
+
style="pointer-events:none;">{{ tick.val }}</text>
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
<!-- Eje Y (izquierda) -->
|
|
1405
|
+
<line [attr.x1]="chartData().axisLft" [attr.y1]="chartData().svgTop"
|
|
1406
|
+
[attr.x2]="chartData().axisLft" [attr.y2]="chartData().axisY"
|
|
1407
|
+
stroke="rgba(255,255,255,0.35)" stroke-width="1" />
|
|
1408
|
+
|
|
1409
|
+
<!-- Eje X (abajo) -->
|
|
1410
|
+
<line [attr.x1]="chartData().axisLft" [attr.y1]="chartData().axisY"
|
|
1411
|
+
[attr.x2]="chartData().svgRgt" [attr.y2]="chartData().axisY"
|
|
1412
|
+
stroke="rgba(255,255,255,0.35)" stroke-width="1" />
|
|
1413
|
+
|
|
1414
|
+
<!-- Barras -->
|
|
1415
|
+
@for (bar of chartData().bars; track $index) {
|
|
1416
|
+
<rect [attr.x]="bar.x" [attr.y]="bar.y"
|
|
1417
|
+
[attr.width]="bar.w" [attr.height]="bar.barH"
|
|
1418
|
+
[attr.fill]="bar.color" rx="3"
|
|
1419
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1420
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.25'"
|
|
1421
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1422
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1423
|
+
(click)="clicked.emit(bar.item)" />
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
<!-- Tooltips (encima de todo) -->
|
|
1427
|
+
@for (bar of chartData().bars; track $index) {
|
|
1428
|
+
@if (hoveredIndex() === $index) {
|
|
1429
|
+
<g style="pointer-events:none;">
|
|
1430
|
+
<rect [attr.x]="bar.tooltipX" [attr.y]="bar.tooltipY"
|
|
1431
|
+
width="46" height="28" rx="4" fill="white"
|
|
1432
|
+
style="filter:drop-shadow(0 2px 6px rgba(0,0,0,0.35));" />
|
|
1433
|
+
<text [attr.x]="bar.tooltipX + 23" [attr.y]="bar.tooltipY + 11"
|
|
1434
|
+
text-anchor="middle" font-size="9" font-weight="700" fill="#111">
|
|
1435
|
+
{{ complemento() }}{{ bar.displayValue }}
|
|
1436
|
+
</text>
|
|
1437
|
+
<text [attr.x]="bar.tooltipX + 23" [attr.y]="bar.tooltipY + 22"
|
|
1438
|
+
text-anchor="middle" font-size="8" fill="#555">
|
|
1439
|
+
{{ bar.percent }}%
|
|
1440
|
+
</text>
|
|
1441
|
+
</g>
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
</svg>
|
|
1446
|
+
</div>
|
|
1447
|
+
|
|
1448
|
+
<!-- Leyenda -->
|
|
1449
|
+
<ul class="list-unstyled m-0 w-100 mt-2">
|
|
1450
|
+
@for (bar of chartData().bars; track $index) {
|
|
1451
|
+
<li class="d-flex align-items-start gap-2 mb-2"
|
|
1452
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1453
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.35'"
|
|
1454
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1455
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1456
|
+
(click)="clicked.emit(bar.item)">
|
|
1457
|
+
<span class="flex-shrink-0 mt-1"
|
|
1458
|
+
[ngStyle]="{ background: bar.color }"
|
|
1459
|
+
style="width:9px; height:9px; display:inline-block; border-radius:2px;">
|
|
1460
|
+
</span>
|
|
1461
|
+
<span [ngClass]="textClass()" style="font-size:.75rem; line-height:1.3; flex:1;">
|
|
1462
|
+
{{ bar.label }}
|
|
1463
|
+
</span>
|
|
1464
|
+
<span class="flex-shrink-0 px-1"
|
|
1465
|
+
style="font-size:.75rem; font-weight:600; color:rgba(255,255,255,0.9); white-space:nowrap;">
|
|
1466
|
+
{{ complemento() }}{{ bar.displayValue }}
|
|
1467
|
+
<span style="opacity:.7;">({{ bar.percent }}%)</span>
|
|
1468
|
+
</span>
|
|
1469
|
+
</li>
|
|
1470
|
+
}
|
|
1471
|
+
</ul>
|
|
1472
|
+
|
|
1473
|
+
</div>
|
|
1474
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
1475
|
+
}
|
|
1476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardChartBarsComponent, decorators: [{
|
|
1477
|
+
type: Component,
|
|
1478
|
+
args: [{
|
|
1479
|
+
selector: 'app-dashboard-chart-bars',
|
|
1480
|
+
imports: [NgClass, NgStyle],
|
|
1481
|
+
template: `
|
|
1482
|
+
<div class="d-flex flex-column align-items-center py-1 px-2">
|
|
1483
|
+
|
|
1484
|
+
<!-- SVG: barras horizontales + ejes -->
|
|
1485
|
+
<div style="width:100%;">
|
|
1486
|
+
<svg [attr.viewBox]="'0 0 ' + chartData().svgW + ' ' + chartData().svgH"
|
|
1487
|
+
style="width:100%; display:block; overflow:visible;">
|
|
1488
|
+
|
|
1489
|
+
<!-- Grid lines verticales + labels eje X -->
|
|
1490
|
+
@for (tick of chartData().xTicks; track tick.val) {
|
|
1491
|
+
<line [attr.x1]="tick.x" [attr.y1]="chartData().svgTop"
|
|
1492
|
+
[attr.x2]="tick.x" [attr.y2]="chartData().axisY"
|
|
1493
|
+
stroke="rgba(255,255,255,0.1)" stroke-width="1" />
|
|
1494
|
+
<text [attr.x]="tick.x" [attr.y]="chartData().axisY + 10"
|
|
1495
|
+
text-anchor="middle" font-size="7" fill="rgba(255,255,255,0.45)"
|
|
1496
|
+
style="pointer-events:none;">{{ tick.val }}</text>
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
<!-- Eje Y (izquierda) -->
|
|
1500
|
+
<line [attr.x1]="chartData().axisLft" [attr.y1]="chartData().svgTop"
|
|
1501
|
+
[attr.x2]="chartData().axisLft" [attr.y2]="chartData().axisY"
|
|
1502
|
+
stroke="rgba(255,255,255,0.35)" stroke-width="1" />
|
|
1503
|
+
|
|
1504
|
+
<!-- Eje X (abajo) -->
|
|
1505
|
+
<line [attr.x1]="chartData().axisLft" [attr.y1]="chartData().axisY"
|
|
1506
|
+
[attr.x2]="chartData().svgRgt" [attr.y2]="chartData().axisY"
|
|
1507
|
+
stroke="rgba(255,255,255,0.35)" stroke-width="1" />
|
|
1508
|
+
|
|
1509
|
+
<!-- Barras -->
|
|
1510
|
+
@for (bar of chartData().bars; track $index) {
|
|
1511
|
+
<rect [attr.x]="bar.x" [attr.y]="bar.y"
|
|
1512
|
+
[attr.width]="bar.w" [attr.height]="bar.barH"
|
|
1513
|
+
[attr.fill]="bar.color" rx="3"
|
|
1514
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1515
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.25'"
|
|
1516
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1517
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1518
|
+
(click)="clicked.emit(bar.item)" />
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
<!-- Tooltips (encima de todo) -->
|
|
1522
|
+
@for (bar of chartData().bars; track $index) {
|
|
1523
|
+
@if (hoveredIndex() === $index) {
|
|
1524
|
+
<g style="pointer-events:none;">
|
|
1525
|
+
<rect [attr.x]="bar.tooltipX" [attr.y]="bar.tooltipY"
|
|
1526
|
+
width="46" height="28" rx="4" fill="white"
|
|
1527
|
+
style="filter:drop-shadow(0 2px 6px rgba(0,0,0,0.35));" />
|
|
1528
|
+
<text [attr.x]="bar.tooltipX + 23" [attr.y]="bar.tooltipY + 11"
|
|
1529
|
+
text-anchor="middle" font-size="9" font-weight="700" fill="#111">
|
|
1530
|
+
{{ complemento() }}{{ bar.displayValue }}
|
|
1531
|
+
</text>
|
|
1532
|
+
<text [attr.x]="bar.tooltipX + 23" [attr.y]="bar.tooltipY + 22"
|
|
1533
|
+
text-anchor="middle" font-size="8" fill="#555">
|
|
1534
|
+
{{ bar.percent }}%
|
|
1535
|
+
</text>
|
|
1536
|
+
</g>
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
</svg>
|
|
1541
|
+
</div>
|
|
1542
|
+
|
|
1543
|
+
<!-- Leyenda -->
|
|
1544
|
+
<ul class="list-unstyled m-0 w-100 mt-2">
|
|
1545
|
+
@for (bar of chartData().bars; track $index) {
|
|
1546
|
+
<li class="d-flex align-items-start gap-2 mb-2"
|
|
1547
|
+
style="cursor:pointer; transition:opacity .2s ease;"
|
|
1548
|
+
[style.opacity]="hoveredIndex() === -1 || hoveredIndex() === $index ? '1' : '0.35'"
|
|
1549
|
+
(mouseenter)="hoveredIndex.set($index)"
|
|
1550
|
+
(mouseleave)="hoveredIndex.set(-1)"
|
|
1551
|
+
(click)="clicked.emit(bar.item)">
|
|
1552
|
+
<span class="flex-shrink-0 mt-1"
|
|
1553
|
+
[ngStyle]="{ background: bar.color }"
|
|
1554
|
+
style="width:9px; height:9px; display:inline-block; border-radius:2px;">
|
|
1555
|
+
</span>
|
|
1556
|
+
<span [ngClass]="textClass()" style="font-size:.75rem; line-height:1.3; flex:1;">
|
|
1557
|
+
{{ bar.label }}
|
|
1558
|
+
</span>
|
|
1559
|
+
<span class="flex-shrink-0 px-1"
|
|
1560
|
+
style="font-size:.75rem; font-weight:600; color:rgba(255,255,255,0.9); white-space:nowrap;">
|
|
1561
|
+
{{ complemento() }}{{ bar.displayValue }}
|
|
1562
|
+
<span style="opacity:.7;">({{ bar.percent }}%)</span>
|
|
1563
|
+
</span>
|
|
1564
|
+
</li>
|
|
1565
|
+
}
|
|
1566
|
+
</ul>
|
|
1567
|
+
|
|
1568
|
+
</div>
|
|
1569
|
+
`
|
|
1570
|
+
}]
|
|
1571
|
+
}] });
|
|
1572
|
+
|
|
1573
|
+
class ItemDashboardComponent {
|
|
1574
|
+
data = input([]);
|
|
1575
|
+
titulo = input('');
|
|
1576
|
+
textClass = input('text-white');
|
|
1577
|
+
colorClass = input('');
|
|
1578
|
+
keyValue = input('value');
|
|
1579
|
+
keyDescri = input('descri');
|
|
1580
|
+
complemento = input('');
|
|
1581
|
+
isDesplegable = input(false);
|
|
1582
|
+
isLoading = input(false);
|
|
1583
|
+
viewMode = input('cards');
|
|
1584
|
+
showContent = signal(false);
|
|
1585
|
+
emit = output();
|
|
1586
|
+
emitContent = output();
|
|
1587
|
+
filteredData = computed(() => this.data().filter(item => item[this.keyValue()] > 0));
|
|
1588
|
+
totalItems = computed(() => this.filteredData().reduce((sum, item) => sum + (item[this.keyValue()] || 0), 0));
|
|
1589
|
+
maxValue = computed(() => {
|
|
1590
|
+
const vals = this.filteredData().map(item => item[this.keyValue()] || 0);
|
|
1591
|
+
return vals.length > 0 ? Math.max(...vals) : 1;
|
|
1592
|
+
});
|
|
1593
|
+
// ── Paleta compartida entre dona y barras ──────────────────────────────────
|
|
1594
|
+
palette = [
|
|
1595
|
+
'#ffffff', '#48dae4', '#06d6a0', '#ff9f1c',
|
|
1596
|
+
'#c77dff', '#fff06d', '#ef476f', '#b5e48c',
|
|
1597
|
+
];
|
|
1598
|
+
getPercent(item) {
|
|
1599
|
+
const max = this.maxValue();
|
|
1600
|
+
return max === 0 ? 0 : Math.round((item[this.keyValue()] / max) * 100);
|
|
1601
|
+
}
|
|
1602
|
+
toggleMostrar() {
|
|
1603
|
+
const before = this.showContent();
|
|
1604
|
+
this.showContent.update(v => !v);
|
|
1605
|
+
if (before)
|
|
1606
|
+
return;
|
|
1607
|
+
this.emitContent.emit(this.titulo());
|
|
1608
|
+
}
|
|
1609
|
+
mover(item) {
|
|
1610
|
+
this.emit.emit(item);
|
|
1611
|
+
}
|
|
1612
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ItemDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1613
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ItemDashboardComponent, isStandalone: true, selector: "app-item-dashboard", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, titulo: { classPropertyName: "titulo", publicName: "titulo", isSignal: true, isRequired: false, transformFunction: null }, textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null }, colorClass: { classPropertyName: "colorClass", publicName: "colorClass", isSignal: true, isRequired: false, transformFunction: null }, keyValue: { classPropertyName: "keyValue", publicName: "keyValue", isSignal: true, isRequired: false, transformFunction: null }, keyDescri: { classPropertyName: "keyDescri", publicName: "keyDescri", isSignal: true, isRequired: false, transformFunction: null }, complemento: { classPropertyName: "complemento", publicName: "complemento", isSignal: true, isRequired: false, transformFunction: null }, isDesplegable: { classPropertyName: "isDesplegable", publicName: "isDesplegable", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { emit: "emit", emitContent: "emitContent" }, ngImport: i0, template: "<div class=\"iv2-card mb-2\" [ngClass]=\"colorClass() ? colorClass() : 'bg-danger'\">\r\n\r\n <!-- \u2500\u2500 HEADER \u2500\u2500 -->\r\n <div class=\"iv2-header\">\r\n\r\n <div class=\"iv2-icon-dot\"></div>\r\n\r\n <div class=\"iv2-title-wrap\">\r\n <h5 class=\"iv2-title\" [ngClass]=\"textClass()\">{{ titulo() }}</h5>\r\n\r\n @if (!isLoading() && totalItems() > 0) {\r\n <span class=\"iv2-total-badge\">{{ totalItems() }}</span>\r\n }\r\n </div>\r\n\r\n @if (isDesplegable()) {\r\n <button class=\"iv2-toggle-btn\" [ngClass]=\"textClass()\" (click)=\"toggleMostrar()\"\r\n [attr.aria-expanded]=\"showContent()\">\r\n <svg class=\"iv2-chevron\" [class.iv2-chevron--open]=\"showContent()\"\r\n viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"6 9 12 15 18 9\"></polyline>\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- \u2500\u2500 CONTENIDO (expandible) \u2500\u2500 -->\r\n <div class=\"iv2-content\" [class.iv2-content--expanded]=\"showContent() || !isDesplegable()\">\r\n <div class=\"iv2-inner\">\r\n\r\n <!-- SKELETON -->\r\n @if (isLoading()) {\r\n <div class=\"iv2-skeleton\">\r\n <div class=\"iv2-sk-row\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n </div>\r\n\r\n } @else {\r\n\r\n <!-- \u2550\u2550 CARDS \u2550\u2550 -->\r\n @if (viewMode() === 'cards') {\r\n @if (filteredData().length > 0) {\r\n <ul class=\"iv2-list\">\r\n @for (item of filteredData(); track $index) {\r\n <li class=\"iv2-item\" [class.iv2-item--clickable]=\"item[keyValue()] > 0\"\r\n (click)=\"mover(item)\">\r\n <div class=\"iv2-item-info\">\r\n <span class=\"iv2-item-label\" [ngClass]=\"textClass()\">{{ item[keyDescri()] }}</span>\r\n <div class=\"iv2-bar-track\">\r\n <div class=\"iv2-bar-fill\" [style.width.%]=\"getPercent(item)\"></div>\r\n </div>\r\n </div>\r\n <div class=\"iv2-item-right\">\r\n <span class=\"iv2-value-badge\">{{ complemento() }}{{ item[keyValue()] }}</span>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 BARRAS \u2550\u2550 -->\r\n @if (viewMode() === 'bars') {\r\n @if (filteredData().length > 0) {\r\n <app-dashboard-chart-bars\r\n [data]=\"filteredData()\"\r\n [complemento]=\"complemento()\"\r\n [keyValue]=\"keyValue()\"\r\n [keyDescri]=\"keyDescri()\"\r\n [palette]=\"palette\"\r\n [maxValue]=\"maxValue()\"\r\n (clicked)=\"mover($event)\" />\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 DONA \u2550\u2550 -->\r\n @if (viewMode() === 'donut') {\r\n @if (filteredData().length > 0) {\r\n <app-dashboard-chart-donut\r\n [data]=\"filteredData()\"\r\n [textClass]=\"textClass()\"\r\n [complemento]=\"complemento()\"\r\n [keyValue]=\"keyValue()\"\r\n [keyDescri]=\"keyDescri()\"\r\n [palette]=\"palette\"\r\n (clicked)=\"mover($event)\" />\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".iv2-card{border-radius:16px;border:1px solid rgba(255,255,255,.18);overflow:hidden;transition:transform .2s ease,box-shadow .2s ease}.iv2-card:hover{transform:translateY(-2px)}.bg-danger{background:linear-gradient(145deg,#ff4b2b,#dc3545)!important;box-shadow:0 8px 24px #dc354559;border-color:#ffffff26}.bg-success{background:linear-gradient(135deg,#2ecc71,#00cc6a)!important;box-shadow:0 8px 24px #15734759;border-color:#ffffff26}.bg-warning{background:linear-gradient(135deg,#f60,#fa9600)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.bg-info{background:linear-gradient(135deg,#4b84ff,#1b6ad8)!important;box-shadow:0 8px 24px #1b6ad859;border-color:#ffffff26}.bg-alert{background:linear-gradient(135deg,#ffc400,#fa0)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.iv2-header{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}.iv2-icon-dot{width:8px;height:8px;border-radius:50%;background:#ffffff80;flex-shrink:0;animation:pulse-dot 2s ease-in-out infinite}@keyframes pulse-dot{0%,to{opacity:.5;transform:scale(1)}50%{opacity:1;transform:scale(1.3)}}.iv2-title-wrap{flex:1;display:flex;align-items:center;gap:8px;min-width:0}.iv2-title{font-size:.82rem;font-weight:700;letter-spacing:.02em;margin:0;line-height:1.3;flex:1;min-width:0}.iv2-total-badge{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 7px;border-radius:999px;background:#ffffff40;color:#fff;font-size:.72rem;font-weight:700;letter-spacing:.01em;backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.35);flex-shrink:0;animation:badge-pop .3s cubic-bezier(.34,1.56,.64,1)}@keyframes badge-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.iv2-toggle-btn{background:#ffffff26;border:1px solid rgba(255,255,255,.25);border-radius:8px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .2s ease;padding:0}.iv2-toggle-btn:hover{background:#ffffff47}.iv2-chevron{width:16px;height:16px;transition:transform .3s cubic-bezier(.4,0,.2,1)}.iv2-chevron--open{transform:rotate(180deg)}.iv2-content{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1),opacity .25s ease;opacity:0}.iv2-content--expanded{max-height:600px;opacity:1}.iv2-inner{background:#0000001f;backdrop-filter:blur(6px);border-top:1px solid rgba(255,255,255,.15);padding:4px 0 6px}.iv2-list{list-style:none;margin:0;padding:0}.iv2-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid rgba(255,255,255,.1);transition:background .18s ease}.iv2-item--clickable{cursor:pointer}.iv2-item--clickable:hover{background:#ffffff1f}.iv2-item--clickable:hover .iv2-arrow{opacity:1;transform:translate(3px)}.iv2-item:first-child{border-top:none}.iv2-item-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.iv2-item-label{font-size:.78rem;font-weight:600;line-height:1.3;white-space:normal;word-break:break-word}.iv2-bar-track{height:3px;border-radius:99px;background:#fff3;overflow:hidden}.iv2-bar-fill{height:100%;border-radius:99px;background:#fff9;transition:width .6s cubic-bezier(.4,0,.2,1)}.iv2-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.iv2-value-badge{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:26px;padding:0 9px;border-radius:999px;background:#ffffffe6;color:#333;font-size:.78rem;font-weight:700;letter-spacing:.01em;box-shadow:0 2px 6px #00000026}.iv2-arrow{width:14px;height:14px;opacity:.5;transition:opacity .18s ease,transform .18s ease}.iv2-empty{display:flex;flex-direction:column;align-items:center;padding:20px 16px 18px;gap:4px}.iv2-empty-icon{width:40px;height:40px;border-radius:50%;background:#fff3;border:1.5px solid rgba(255,255,255,.4);display:flex;align-items:center;justify-content:center;margin-bottom:6px}.iv2-empty-icon svg{width:20px;height:20px;color:#fff}.iv2-empty-title{font-size:.82rem;font-weight:700;margin:0;opacity:.95}.iv2-empty-sub{font-size:.72rem;margin:0;opacity:.65}.iv2-skeleton{padding:10px 14px 8px}.iv2-sk-row{display:flex;gap:12px;align-items:center}.iv2-sk-line{height:12px;border-radius:6px;background-size:200% 100%;animation:shimmer 1.5s infinite}.iv2-sk-line--long{flex:1}.iv2-sk-line--short{width:36px;flex-shrink:0}.bg-warning-line,.bg-alert-line{background:linear-gradient(90deg,#f9a825 25%,#fff59d,#f9a825 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-danger-line{background:linear-gradient(90deg,#c62828 25%,#ffcdd2,#c62828 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-info-line{background:linear-gradient(90deg,#1e88e5 25%,#90caf9,#1e88e5 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-success-line{background:linear-gradient(90deg,#2e7d32 25%,#a5d6a7,#2e7d32 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: DashboardChartDonutComponent, selector: "app-dashboard-chart-donut", inputs: ["textClass", "complemento", "data", "keyValue", "keyDescri", "palette"], outputs: ["clicked"] }, { kind: "component", type: DashboardChartBarsComponent, selector: "app-dashboard-chart-bars", inputs: ["data", "maxValue", "keyValue", "keyDescri", "palette", "textClass", "complemento"], outputs: ["clicked"] }] });
|
|
1614
|
+
}
|
|
1615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ItemDashboardComponent, decorators: [{
|
|
1616
|
+
type: Component,
|
|
1617
|
+
args: [{ selector: 'app-item-dashboard', imports: [NgClass, DashboardChartDonutComponent, DashboardChartBarsComponent], template: "<div class=\"iv2-card mb-2\" [ngClass]=\"colorClass() ? colorClass() : 'bg-danger'\">\r\n\r\n <!-- \u2500\u2500 HEADER \u2500\u2500 -->\r\n <div class=\"iv2-header\">\r\n\r\n <div class=\"iv2-icon-dot\"></div>\r\n\r\n <div class=\"iv2-title-wrap\">\r\n <h5 class=\"iv2-title\" [ngClass]=\"textClass()\">{{ titulo() }}</h5>\r\n\r\n @if (!isLoading() && totalItems() > 0) {\r\n <span class=\"iv2-total-badge\">{{ totalItems() }}</span>\r\n }\r\n </div>\r\n\r\n @if (isDesplegable()) {\r\n <button class=\"iv2-toggle-btn\" [ngClass]=\"textClass()\" (click)=\"toggleMostrar()\"\r\n [attr.aria-expanded]=\"showContent()\">\r\n <svg class=\"iv2-chevron\" [class.iv2-chevron--open]=\"showContent()\"\r\n viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"6 9 12 15 18 9\"></polyline>\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- \u2500\u2500 CONTENIDO (expandible) \u2500\u2500 -->\r\n <div class=\"iv2-content\" [class.iv2-content--expanded]=\"showContent() || !isDesplegable()\">\r\n <div class=\"iv2-inner\">\r\n\r\n <!-- SKELETON -->\r\n @if (isLoading()) {\r\n <div class=\"iv2-skeleton\">\r\n <div class=\"iv2-sk-row\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n </div>\r\n\r\n } @else {\r\n\r\n <!-- \u2550\u2550 CARDS \u2550\u2550 -->\r\n @if (viewMode() === 'cards') {\r\n @if (filteredData().length > 0) {\r\n <ul class=\"iv2-list\">\r\n @for (item of filteredData(); track $index) {\r\n <li class=\"iv2-item\" [class.iv2-item--clickable]=\"item[keyValue()] > 0\"\r\n (click)=\"mover(item)\">\r\n <div class=\"iv2-item-info\">\r\n <span class=\"iv2-item-label\" [ngClass]=\"textClass()\">{{ item[keyDescri()] }}</span>\r\n <div class=\"iv2-bar-track\">\r\n <div class=\"iv2-bar-fill\" [style.width.%]=\"getPercent(item)\"></div>\r\n </div>\r\n </div>\r\n <div class=\"iv2-item-right\">\r\n <span class=\"iv2-value-badge\">{{ complemento() }}{{ item[keyValue()] }}</span>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 BARRAS \u2550\u2550 -->\r\n @if (viewMode() === 'bars') {\r\n @if (filteredData().length > 0) {\r\n <app-dashboard-chart-bars\r\n [data]=\"filteredData()\"\r\n [complemento]=\"complemento()\"\r\n [keyValue]=\"keyValue()\"\r\n [keyDescri]=\"keyDescri()\"\r\n [palette]=\"palette\"\r\n [maxValue]=\"maxValue()\"\r\n (clicked)=\"mover($event)\" />\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 DONA \u2550\u2550 -->\r\n @if (viewMode() === 'donut') {\r\n @if (filteredData().length > 0) {\r\n <app-dashboard-chart-donut\r\n [data]=\"filteredData()\"\r\n [textClass]=\"textClass()\"\r\n [complemento]=\"complemento()\"\r\n [keyValue]=\"keyValue()\"\r\n [keyDescri]=\"keyDescri()\"\r\n [palette]=\"palette\"\r\n (clicked)=\"mover($event)\" />\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".iv2-card{border-radius:16px;border:1px solid rgba(255,255,255,.18);overflow:hidden;transition:transform .2s ease,box-shadow .2s ease}.iv2-card:hover{transform:translateY(-2px)}.bg-danger{background:linear-gradient(145deg,#ff4b2b,#dc3545)!important;box-shadow:0 8px 24px #dc354559;border-color:#ffffff26}.bg-success{background:linear-gradient(135deg,#2ecc71,#00cc6a)!important;box-shadow:0 8px 24px #15734759;border-color:#ffffff26}.bg-warning{background:linear-gradient(135deg,#f60,#fa9600)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.bg-info{background:linear-gradient(135deg,#4b84ff,#1b6ad8)!important;box-shadow:0 8px 24px #1b6ad859;border-color:#ffffff26}.bg-alert{background:linear-gradient(135deg,#ffc400,#fa0)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.iv2-header{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}.iv2-icon-dot{width:8px;height:8px;border-radius:50%;background:#ffffff80;flex-shrink:0;animation:pulse-dot 2s ease-in-out infinite}@keyframes pulse-dot{0%,to{opacity:.5;transform:scale(1)}50%{opacity:1;transform:scale(1.3)}}.iv2-title-wrap{flex:1;display:flex;align-items:center;gap:8px;min-width:0}.iv2-title{font-size:.82rem;font-weight:700;letter-spacing:.02em;margin:0;line-height:1.3;flex:1;min-width:0}.iv2-total-badge{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 7px;border-radius:999px;background:#ffffff40;color:#fff;font-size:.72rem;font-weight:700;letter-spacing:.01em;backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.35);flex-shrink:0;animation:badge-pop .3s cubic-bezier(.34,1.56,.64,1)}@keyframes badge-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.iv2-toggle-btn{background:#ffffff26;border:1px solid rgba(255,255,255,.25);border-radius:8px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .2s ease;padding:0}.iv2-toggle-btn:hover{background:#ffffff47}.iv2-chevron{width:16px;height:16px;transition:transform .3s cubic-bezier(.4,0,.2,1)}.iv2-chevron--open{transform:rotate(180deg)}.iv2-content{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1),opacity .25s ease;opacity:0}.iv2-content--expanded{max-height:600px;opacity:1}.iv2-inner{background:#0000001f;backdrop-filter:blur(6px);border-top:1px solid rgba(255,255,255,.15);padding:4px 0 6px}.iv2-list{list-style:none;margin:0;padding:0}.iv2-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid rgba(255,255,255,.1);transition:background .18s ease}.iv2-item--clickable{cursor:pointer}.iv2-item--clickable:hover{background:#ffffff1f}.iv2-item--clickable:hover .iv2-arrow{opacity:1;transform:translate(3px)}.iv2-item:first-child{border-top:none}.iv2-item-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.iv2-item-label{font-size:.78rem;font-weight:600;line-height:1.3;white-space:normal;word-break:break-word}.iv2-bar-track{height:3px;border-radius:99px;background:#fff3;overflow:hidden}.iv2-bar-fill{height:100%;border-radius:99px;background:#fff9;transition:width .6s cubic-bezier(.4,0,.2,1)}.iv2-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.iv2-value-badge{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:26px;padding:0 9px;border-radius:999px;background:#ffffffe6;color:#333;font-size:.78rem;font-weight:700;letter-spacing:.01em;box-shadow:0 2px 6px #00000026}.iv2-arrow{width:14px;height:14px;opacity:.5;transition:opacity .18s ease,transform .18s ease}.iv2-empty{display:flex;flex-direction:column;align-items:center;padding:20px 16px 18px;gap:4px}.iv2-empty-icon{width:40px;height:40px;border-radius:50%;background:#fff3;border:1.5px solid rgba(255,255,255,.4);display:flex;align-items:center;justify-content:center;margin-bottom:6px}.iv2-empty-icon svg{width:20px;height:20px;color:#fff}.iv2-empty-title{font-size:.82rem;font-weight:700;margin:0;opacity:.95}.iv2-empty-sub{font-size:.72rem;margin:0;opacity:.65}.iv2-skeleton{padding:10px 14px 8px}.iv2-sk-row{display:flex;gap:12px;align-items:center}.iv2-sk-line{height:12px;border-radius:6px;background-size:200% 100%;animation:shimmer 1.5s infinite}.iv2-sk-line--long{flex:1}.iv2-sk-line--short{width:36px;flex-shrink:0}.bg-warning-line,.bg-alert-line{background:linear-gradient(90deg,#f9a825 25%,#fff59d,#f9a825 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-danger-line{background:linear-gradient(90deg,#c62828 25%,#ffcdd2,#c62828 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-info-line{background:linear-gradient(90deg,#1e88e5 25%,#90caf9,#1e88e5 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-success-line{background:linear-gradient(90deg,#2e7d32 25%,#a5d6a7,#2e7d32 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] }]
|
|
1618
|
+
}] });
|
|
1619
|
+
|
|
1620
|
+
class ItemDashboardGroupComponent {
|
|
1621
|
+
data = input([]);
|
|
1622
|
+
titulo = input('');
|
|
1623
|
+
textClass = input('text-white');
|
|
1624
|
+
colorClass = input('');
|
|
1625
|
+
keyValue = input('value');
|
|
1626
|
+
keyDescri = input('descri');
|
|
1627
|
+
complemento = input('');
|
|
1628
|
+
isDesplegable = input(false);
|
|
1629
|
+
isLoading = input(false);
|
|
1630
|
+
viewMode = input('cards');
|
|
1631
|
+
showContent = signal(false);
|
|
1632
|
+
emit = output();
|
|
1633
|
+
emitContent = output();
|
|
1634
|
+
dataGroup = computed(() => this.groupBy(this.data(), 'GROUP'));
|
|
1635
|
+
filteredDataGroup = computed(() => {
|
|
1636
|
+
const grouped = this.dataGroup();
|
|
1637
|
+
const result = {};
|
|
1638
|
+
for (const key of Object.keys(grouped)) {
|
|
1639
|
+
const items = grouped[key].filter((item) => item[this.keyValue()] > 0);
|
|
1640
|
+
if (items.length > 0)
|
|
1641
|
+
result[key] = items;
|
|
1642
|
+
}
|
|
1643
|
+
return result;
|
|
1644
|
+
});
|
|
1645
|
+
totalItems = computed(() => this.data().reduce((sum, item) => sum + (item[this.keyValue()] || 0), 0));
|
|
1646
|
+
maxValue = computed(() => {
|
|
1647
|
+
const vals = this.data()
|
|
1648
|
+
.filter((item) => item[this.keyValue()] > 0)
|
|
1649
|
+
.map((item) => item[this.keyValue()] || 0);
|
|
1650
|
+
return vals.length > 0 ? Math.max(...vals) : 1;
|
|
1651
|
+
});
|
|
1652
|
+
hasData = computed(() => Object.keys(this.filteredDataGroup()).length > 0);
|
|
1653
|
+
getPercent(item) {
|
|
1654
|
+
const max = this.maxValue();
|
|
1655
|
+
return max === 0 ? 0 : Math.round((item[this.keyValue()] / max) * 100);
|
|
1656
|
+
}
|
|
1657
|
+
toggleMostrar() {
|
|
1658
|
+
const before = this.showContent();
|
|
1659
|
+
this.showContent.update(v => !v);
|
|
1660
|
+
if (before)
|
|
1661
|
+
return;
|
|
1662
|
+
this.emitContent.emit(this.titulo());
|
|
1663
|
+
}
|
|
1664
|
+
mover(item) {
|
|
1665
|
+
this.emit.emit(item);
|
|
1666
|
+
}
|
|
1667
|
+
groupBy(array, key) {
|
|
1668
|
+
return array.reduce((acc, item) => {
|
|
1669
|
+
const groupKey = String(item[key]);
|
|
1670
|
+
if (!acc[groupKey])
|
|
1671
|
+
acc[groupKey] = [];
|
|
1672
|
+
acc[groupKey].push(item);
|
|
1673
|
+
return acc;
|
|
1674
|
+
}, {});
|
|
1675
|
+
}
|
|
1676
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ItemDashboardGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1677
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: ItemDashboardGroupComponent, isStandalone: true, selector: "app-item-dashboard-group", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, titulo: { classPropertyName: "titulo", publicName: "titulo", isSignal: true, isRequired: false, transformFunction: null }, textClass: { classPropertyName: "textClass", publicName: "textClass", isSignal: true, isRequired: false, transformFunction: null }, colorClass: { classPropertyName: "colorClass", publicName: "colorClass", isSignal: true, isRequired: false, transformFunction: null }, keyValue: { classPropertyName: "keyValue", publicName: "keyValue", isSignal: true, isRequired: false, transformFunction: null }, keyDescri: { classPropertyName: "keyDescri", publicName: "keyDescri", isSignal: true, isRequired: false, transformFunction: null }, complemento: { classPropertyName: "complemento", publicName: "complemento", isSignal: true, isRequired: false, transformFunction: null }, isDesplegable: { classPropertyName: "isDesplegable", publicName: "isDesplegable", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { emit: "emit", emitContent: "emitContent" }, ngImport: i0, template: "<div class=\"iv2-card mb-2\" [ngClass]=\"colorClass() ? colorClass() : 'bg-danger'\">\r\n\r\n <!-- \u2500\u2500 HEADER \u2500\u2500 -->\r\n <div class=\"iv2-header\">\r\n\r\n <div class=\"iv2-icon-dot\"></div>\r\n\r\n <div class=\"iv2-title-wrap\">\r\n <h5 class=\"iv2-title\" [ngClass]=\"textClass()\">{{ titulo() }}</h5>\r\n </div>\r\n\r\n @if (isDesplegable()) {\r\n <button class=\"iv2-toggle-btn\" [ngClass]=\"textClass()\" (click)=\"toggleMostrar()\"\r\n [attr.aria-expanded]=\"showContent()\">\r\n <svg class=\"iv2-chevron\" [class.iv2-chevron--open]=\"showContent()\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"6 9 12 15 18 9\"></polyline>\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- \u2500\u2500 CONTENIDO (expandible) \u2500\u2500 -->\r\n <div class=\"iv2-content\" [class.iv2-content--expanded]=\"showContent() || !isDesplegable()\">\r\n <div class=\"iv2-inner\">\r\n\r\n <!-- SKELETON -->\r\n @if (isLoading()) {\r\n <div class=\"iv2-skeleton\">\r\n <div class=\"iv2-sk-row\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n </div>\r\n\r\n } @else {\r\n\r\n <!-- \u2550\u2550 CARDS \u2550\u2550 -->\r\n @if (viewMode() === 'cards') {\r\n @if (hasData()) {\r\n <ul class=\"iv2-list\">\r\n @for (group of filteredDataGroup() | keyvalue; track group.key) {\r\n\r\n <li class=\"iv2-group-header\">\r\n <span class=\"iv2-group-label\" [ngClass]=\"textClass()\">{{ group.key }}</span>\r\n <div class=\"iv2-group-divider\"></div>\r\n </li>\r\n\r\n @for (item of group.value; track $index) {\r\n <li class=\"iv2-item\" [class.iv2-item--clickable]=\"item[keyValue()] > 0\"\r\n (click)=\"item[keyValue()] > 0 && mover(item)\">\r\n <div class=\"iv2-item-info\">\r\n <span class=\"iv2-item-label\" [ngClass]=\"textClass()\">{{ item[keyDescri()] }}</span>\r\n <div class=\"iv2-bar-track\">\r\n <div class=\"iv2-bar-fill\" [style.width.%]=\"getPercent(item)\"></div>\r\n </div>\r\n </div>\r\n <div class=\"iv2-item-right\">\r\n <span class=\"iv2-value-badge\">{{ complemento() }}{{ item[keyValue()] | number: '1.2-2' }}</span>\r\n </div>\r\n </li>\r\n }\r\n\r\n }\r\n </ul>\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 BARRAS \u2550\u2550 -->\r\n @if (viewMode() === 'bars') {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">En implementaci\u00F3n</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Muy pronto</p>\r\n </div>\r\n }\r\n\r\n <!-- \u2550\u2550 DONA \u2550\u2550 -->\r\n @if (viewMode() === 'donut') {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">En implementaci\u00F3n</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Muy pronto</p>\r\n </div>\r\n }\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".iv2-card{border-radius:16px;border:1px solid rgba(255,255,255,.18);overflow:hidden;transition:transform .2s ease,box-shadow .2s ease;animation:iv2CardSlideIn .22s cubic-bezier(.25,.46,.45,.94) both}.iv2-card:hover{transform:translateY(-2px)}@keyframes iv2CardSlideIn{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}.bg-danger{background:linear-gradient(145deg,#ff4b2b,#dc3545)!important;box-shadow:0 8px 24px #dc354559;border-color:#ffffff26}.bg-success{background:linear-gradient(135deg,#2ecc71,#00cc6a)!important;box-shadow:0 8px 24px #15734759;border-color:#ffffff26}.bg-warning{background:linear-gradient(135deg,#f60,#fa9600)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.bg-info{background:linear-gradient(135deg,#4b84ff,#1b6ad8)!important;box-shadow:0 8px 24px #1b6ad859;border-color:#ffffff26}.bg-alert{background:linear-gradient(135deg,#ffc400,#fa0)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.iv2-header{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}.iv2-icon-dot{width:8px;height:8px;border-radius:50%;background:#ffffff80;flex-shrink:0;animation:pulse-dot 2s ease-in-out infinite}@keyframes pulse-dot{0%,to{opacity:.5;transform:scale(1)}50%{opacity:1;transform:scale(1.3)}}.iv2-title-wrap{flex:1;display:flex;align-items:center;gap:8px;min-width:0}.iv2-title{font-size:.82rem;font-weight:700;letter-spacing:.02em;margin:0;line-height:1.3;flex:1;min-width:0}.iv2-total-badge{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 7px;border-radius:999px;background:#ffffff40;color:#fff;font-size:.72rem;font-weight:700;letter-spacing:.01em;backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.35);flex-shrink:0;animation:badge-pop .3s cubic-bezier(.34,1.56,.64,1)}@keyframes badge-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.iv2-toggle-btn{background:#ffffff26;border:1px solid rgba(255,255,255,.25);border-radius:8px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .2s ease;padding:0}.iv2-toggle-btn:hover{background:#ffffff47}.iv2-chevron{width:16px;height:16px;transition:transform .3s cubic-bezier(.4,0,.2,1)}.iv2-chevron--open{transform:rotate(180deg)}.iv2-content{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1),opacity .25s ease;opacity:0}.iv2-content--expanded{max-height:1000px;opacity:1}.iv2-inner{background:#0000001f;backdrop-filter:blur(6px);border-top:1px solid rgba(255,255,255,.15);padding:4px 0 6px}.iv2-list{list-style:none;margin:0;padding:0}.iv2-group-header{display:flex;align-items:center;gap:8px;padding:10px 14px 6px}.iv2-group-label{font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;flex-shrink:0}.iv2-group-divider{flex:1;height:1px;background:#ffffff40}.iv2-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid rgba(255,255,255,.08);transition:background .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1)}.iv2-item--clickable{cursor:pointer}.iv2-item--clickable:hover{background:#ffffff1f}.iv2-item--clickable:active{transform:scale(.985);background:#ffffff2e}.iv2-item-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.iv2-item-label{font-size:.78rem;font-weight:600;line-height:1.3;white-space:normal;word-break:break-word}.iv2-bar-track{height:3px;border-radius:99px;background:#fff3;overflow:hidden}.iv2-bar-fill{height:100%;border-radius:99px;background:#fff9;transition:width .6s cubic-bezier(.4,0,.2,1)}.iv2-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.iv2-value-badge{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:26px;padding:0 9px;border-radius:999px;background:#ffffffe6;color:#333;font-size:.78rem;font-weight:700;letter-spacing:.01em;box-shadow:0 2px 6px #00000026}.iv2-empty{display:flex;flex-direction:column;align-items:center;padding:20px 16px 18px;gap:4px}.iv2-empty-icon{width:40px;height:40px;border-radius:50%;background:#fff3;border:1.5px solid rgba(255,255,255,.4);display:flex;align-items:center;justify-content:center;margin-bottom:6px}.iv2-empty-icon svg{width:20px;height:20px;color:#fff}.iv2-empty-title{font-size:.82rem;font-weight:700;margin:0;opacity:.95}.iv2-empty-sub{font-size:.72rem;margin:0;opacity:.65}.iv2-skeleton{padding:10px 14px 8px}.iv2-sk-row{display:flex;gap:12px;align-items:center}.iv2-sk-line{height:12px;border-radius:6px;background-size:200% 100%;animation:shimmer 1.5s infinite}.iv2-sk-line--long{flex:1}.iv2-sk-line--short{width:36px;flex-shrink:0}.bg-warning-line,.bg-alert-line{background:linear-gradient(90deg,#f9a825 25%,#fff59d,#f9a825 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-danger-line{background:linear-gradient(90deg,#c62828 25%,#ffcdd2,#c62828 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-info-line{background:linear-gradient(90deg,#1e88e5 25%,#90caf9,#1e88e5 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-success-line{background:linear-gradient(90deg,#2e7d32 25%,#a5d6a7,#2e7d32 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: DecimalPipe, name: "number" }] });
|
|
1678
|
+
}
|
|
1679
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: ItemDashboardGroupComponent, decorators: [{
|
|
1680
|
+
type: Component,
|
|
1681
|
+
args: [{ selector: 'app-item-dashboard-group', imports: [NgClass, KeyValuePipe, DecimalPipe], template: "<div class=\"iv2-card mb-2\" [ngClass]=\"colorClass() ? colorClass() : 'bg-danger'\">\r\n\r\n <!-- \u2500\u2500 HEADER \u2500\u2500 -->\r\n <div class=\"iv2-header\">\r\n\r\n <div class=\"iv2-icon-dot\"></div>\r\n\r\n <div class=\"iv2-title-wrap\">\r\n <h5 class=\"iv2-title\" [ngClass]=\"textClass()\">{{ titulo() }}</h5>\r\n </div>\r\n\r\n @if (isDesplegable()) {\r\n <button class=\"iv2-toggle-btn\" [ngClass]=\"textClass()\" (click)=\"toggleMostrar()\"\r\n [attr.aria-expanded]=\"showContent()\">\r\n <svg class=\"iv2-chevron\" [class.iv2-chevron--open]=\"showContent()\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"6 9 12 15 18 9\"></polyline>\r\n </svg>\r\n </button>\r\n }\r\n </div>\r\n\r\n <!-- \u2500\u2500 CONTENIDO (expandible) \u2500\u2500 -->\r\n <div class=\"iv2-content\" [class.iv2-content--expanded]=\"showContent() || !isDesplegable()\">\r\n <div class=\"iv2-inner\">\r\n\r\n <!-- SKELETON -->\r\n @if (isLoading()) {\r\n <div class=\"iv2-skeleton\">\r\n <div class=\"iv2-sk-row\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n <div class=\"iv2-sk-row mt-2\">\r\n <div class=\"iv2-sk-line iv2-sk-line--long\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n <div class=\"iv2-sk-line iv2-sk-line--short\" [ngClass]=\"colorClass() + '-line'\"></div>\r\n </div>\r\n </div>\r\n\r\n } @else {\r\n\r\n <!-- \u2550\u2550 CARDS \u2550\u2550 -->\r\n @if (viewMode() === 'cards') {\r\n @if (hasData()) {\r\n <ul class=\"iv2-list\">\r\n @for (group of filteredDataGroup() | keyvalue; track group.key) {\r\n\r\n <li class=\"iv2-group-header\">\r\n <span class=\"iv2-group-label\" [ngClass]=\"textClass()\">{{ group.key }}</span>\r\n <div class=\"iv2-group-divider\"></div>\r\n </li>\r\n\r\n @for (item of group.value; track $index) {\r\n <li class=\"iv2-item\" [class.iv2-item--clickable]=\"item[keyValue()] > 0\"\r\n (click)=\"item[keyValue()] > 0 && mover(item)\">\r\n <div class=\"iv2-item-info\">\r\n <span class=\"iv2-item-label\" [ngClass]=\"textClass()\">{{ item[keyDescri()] }}</span>\r\n <div class=\"iv2-bar-track\">\r\n <div class=\"iv2-bar-fill\" [style.width.%]=\"getPercent(item)\"></div>\r\n </div>\r\n </div>\r\n <div class=\"iv2-item-right\">\r\n <span class=\"iv2-value-badge\">{{ complemento() }}{{ item[keyValue()] | number: '1.2-2' }}</span>\r\n </div>\r\n </li>\r\n }\r\n\r\n }\r\n </ul>\r\n } @else {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">Todo al d\u00EDa</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Sin pendientes por el momento</p>\r\n </div>\r\n }\r\n }\r\n\r\n <!-- \u2550\u2550 BARRAS \u2550\u2550 -->\r\n @if (viewMode() === 'bars') {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">En implementaci\u00F3n</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Muy pronto</p>\r\n </div>\r\n }\r\n\r\n <!-- \u2550\u2550 DONA \u2550\u2550 -->\r\n @if (viewMode() === 'donut') {\r\n <div class=\"iv2-empty\">\r\n <div class=\"iv2-empty-icon\"><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <polyline points=\"20 6 9 17 4 12\"></polyline>\r\n </svg></div>\r\n <p class=\"iv2-empty-title\" [ngClass]=\"textClass()\">En implementaci\u00F3n</p>\r\n <p class=\"iv2-empty-sub\" [ngClass]=\"textClass()\">Muy pronto</p>\r\n </div>\r\n }\r\n\r\n }\r\n\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".iv2-card{border-radius:16px;border:1px solid rgba(255,255,255,.18);overflow:hidden;transition:transform .2s ease,box-shadow .2s ease;animation:iv2CardSlideIn .22s cubic-bezier(.25,.46,.45,.94) both}.iv2-card:hover{transform:translateY(-2px)}@keyframes iv2CardSlideIn{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}.bg-danger{background:linear-gradient(145deg,#ff4b2b,#dc3545)!important;box-shadow:0 8px 24px #dc354559;border-color:#ffffff26}.bg-success{background:linear-gradient(135deg,#2ecc71,#00cc6a)!important;box-shadow:0 8px 24px #15734759;border-color:#ffffff26}.bg-warning{background:linear-gradient(135deg,#f60,#fa9600)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.bg-info{background:linear-gradient(135deg,#4b84ff,#1b6ad8)!important;box-shadow:0 8px 24px #1b6ad859;border-color:#ffffff26}.bg-alert{background:linear-gradient(135deg,#ffc400,#fa0)!important;box-shadow:0 8px 24px #ed8f0359;border-color:#ffffff26}.iv2-header{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}.iv2-icon-dot{width:8px;height:8px;border-radius:50%;background:#ffffff80;flex-shrink:0;animation:pulse-dot 2s ease-in-out infinite}@keyframes pulse-dot{0%,to{opacity:.5;transform:scale(1)}50%{opacity:1;transform:scale(1.3)}}.iv2-title-wrap{flex:1;display:flex;align-items:center;gap:8px;min-width:0}.iv2-title{font-size:.82rem;font-weight:700;letter-spacing:.02em;margin:0;line-height:1.3;flex:1;min-width:0}.iv2-total-badge{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:22px;padding:0 7px;border-radius:999px;background:#ffffff40;color:#fff;font-size:.72rem;font-weight:700;letter-spacing:.01em;backdrop-filter:blur(4px);border:1px solid rgba(255,255,255,.35);flex-shrink:0;animation:badge-pop .3s cubic-bezier(.34,1.56,.64,1)}@keyframes badge-pop{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.iv2-toggle-btn{background:#ffffff26;border:1px solid rgba(255,255,255,.25);border-radius:8px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:background .2s ease;padding:0}.iv2-toggle-btn:hover{background:#ffffff47}.iv2-chevron{width:16px;height:16px;transition:transform .3s cubic-bezier(.4,0,.2,1)}.iv2-chevron--open{transform:rotate(180deg)}.iv2-content{max-height:0;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1),opacity .25s ease;opacity:0}.iv2-content--expanded{max-height:1000px;opacity:1}.iv2-inner{background:#0000001f;backdrop-filter:blur(6px);border-top:1px solid rgba(255,255,255,.15);padding:4px 0 6px}.iv2-list{list-style:none;margin:0;padding:0}.iv2-group-header{display:flex;align-items:center;gap:8px;padding:10px 14px 6px}.iv2-group-label{font-size:.7rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;flex-shrink:0}.iv2-group-divider{flex:1;height:1px;background:#ffffff40}.iv2-item{display:flex;align-items:center;gap:10px;padding:9px 14px;border-top:1px solid rgba(255,255,255,.08);transition:background .2s cubic-bezier(.4,0,.2,1),transform .2s cubic-bezier(.4,0,.2,1)}.iv2-item--clickable{cursor:pointer}.iv2-item--clickable:hover{background:#ffffff1f}.iv2-item--clickable:active{transform:scale(.985);background:#ffffff2e}.iv2-item-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}.iv2-item-label{font-size:.78rem;font-weight:600;line-height:1.3;white-space:normal;word-break:break-word}.iv2-bar-track{height:3px;border-radius:99px;background:#fff3;overflow:hidden}.iv2-bar-fill{height:100%;border-radius:99px;background:#fff9;transition:width .6s cubic-bezier(.4,0,.2,1)}.iv2-item-right{display:flex;align-items:center;gap:6px;flex-shrink:0}.iv2-value-badge{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:26px;padding:0 9px;border-radius:999px;background:#ffffffe6;color:#333;font-size:.78rem;font-weight:700;letter-spacing:.01em;box-shadow:0 2px 6px #00000026}.iv2-empty{display:flex;flex-direction:column;align-items:center;padding:20px 16px 18px;gap:4px}.iv2-empty-icon{width:40px;height:40px;border-radius:50%;background:#fff3;border:1.5px solid rgba(255,255,255,.4);display:flex;align-items:center;justify-content:center;margin-bottom:6px}.iv2-empty-icon svg{width:20px;height:20px;color:#fff}.iv2-empty-title{font-size:.82rem;font-weight:700;margin:0;opacity:.95}.iv2-empty-sub{font-size:.72rem;margin:0;opacity:.65}.iv2-skeleton{padding:10px 14px 8px}.iv2-sk-row{display:flex;gap:12px;align-items:center}.iv2-sk-line{height:12px;border-radius:6px;background-size:200% 100%;animation:shimmer 1.5s infinite}.iv2-sk-line--long{flex:1}.iv2-sk-line--short{width:36px;flex-shrink:0}.bg-warning-line,.bg-alert-line{background:linear-gradient(90deg,#f9a825 25%,#fff59d,#f9a825 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-danger-line{background:linear-gradient(90deg,#c62828 25%,#ffcdd2,#c62828 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-info-line{background:linear-gradient(90deg,#1e88e5 25%,#90caf9,#1e88e5 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.bg-success-line{background:linear-gradient(90deg,#2e7d32 25%,#a5d6a7,#2e7d32 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}\n"] }]
|
|
1682
|
+
}] });
|
|
1683
|
+
|
|
1684
|
+
// Duración de la animación de salida (@keyframes fabMiniOut en el scss): se
|
|
1685
|
+
// mantiene montado este tiempo antes de desmontarlo de verdad.
|
|
1686
|
+
const LEAVE_DURATION_MS = 150;
|
|
1687
|
+
class DashboardViewSwitcherComponent {
|
|
1688
|
+
viewMode = input('cards');
|
|
1689
|
+
accentColor = input('#398bf7');
|
|
1690
|
+
viewModeChange = output();
|
|
1691
|
+
fabOpen = signal(false);
|
|
1692
|
+
// Reemplaza a @fabMenu (query + stagger, sin @angular/animations): el
|
|
1693
|
+
// stagger se logra con animation-delay por :nth-child en el scss, y la
|
|
1694
|
+
// salida se maneja igual que en tab-bar (mantener montado + clase "--closing").
|
|
1695
|
+
fabRendered = signal(false);
|
|
1696
|
+
closeTimer = null;
|
|
1697
|
+
constructor() {
|
|
1698
|
+
effect(() => {
|
|
1699
|
+
if (this.fabOpen()) {
|
|
1700
|
+
if (this.closeTimer) {
|
|
1701
|
+
clearTimeout(this.closeTimer);
|
|
1702
|
+
this.closeTimer = null;
|
|
1703
|
+
}
|
|
1704
|
+
this.fabRendered.set(true);
|
|
1705
|
+
}
|
|
1706
|
+
else if (this.fabRendered()) {
|
|
1707
|
+
this.closeTimer = setTimeout(() => this.fabRendered.set(false), LEAVE_DURATION_MS);
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
setView(mode) {
|
|
1712
|
+
this.viewModeChange.emit(mode);
|
|
1713
|
+
this.fabOpen.set(false);
|
|
1714
|
+
}
|
|
1715
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardViewSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1716
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: DashboardViewSwitcherComponent, isStandalone: true, selector: "app-dashboard-view-switcher", inputs: { viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null }, accentColor: { classPropertyName: "accentColor", publicName: "accentColor", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { viewModeChange: "viewModeChange" }, ngImport: i0, template: "<div class=\"view-fab\" [style.--fab-main-from]=\"accentColor()\" [style.--fab-main-to]=\"accentColor()\"\r\n [style.--fab-active-bg]=\"accentColor()\" [style.--fab-mini-hover-border]=\"accentColor()\"\r\n [style.--fab-mini-hover-color]=\"accentColor()\" (mouseenter)=\"fabOpen.set(true)\" (mouseleave)=\"fabOpen.set(false)\">\r\n @if (fabRendered()) {\r\n <div class=\"fab-menu\" [class.fab-menu--closing]=\"!fabOpen()\">\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Dona</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'donut'\" (click)=\"setView('donut')\"\r\n title=\"Vista de dona\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\r\n <circle cx=\"12\" cy=\"12\" r=\"4\"></circle>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Barras</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'bars'\" (click)=\"setView('bars')\"\r\n title=\"Vista de barras\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <rect x=\"2\" y=\"13\" width=\"5\" height=\"9\" rx=\"1\"></rect>\r\n <rect x=\"9\" y=\"7\" width=\"5\" height=\"15\" rx=\"1\"></rect>\r\n <rect x=\"16\" y=\"3\" width=\"5\" height=\"19\" rx=\"1\"></rect>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Tarjetas</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'cards'\" (click)=\"setView('cards')\"\r\n title=\"Vista de tarjetas\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n }\r\n\r\n <button class=\"fab-main\" [class.is-open]=\"fabOpen()\" (click)=\"fabOpen.set(!fabOpen())\" title=\"Cambiar vista\">\r\n @switch (viewMode()) {\r\n @case ('cards') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n </svg>\r\n }\r\n @case ('bars') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <rect x=\"2\" y=\"13\" width=\"5\" height=\"9\" rx=\"1\"></rect>\r\n <rect x=\"9\" y=\"7\" width=\"5\" height=\"15\" rx=\"1\"></rect>\r\n <rect x=\"16\" y=\"3\" width=\"5\" height=\"19\" rx=\"1\"></rect>\r\n </svg>\r\n }\r\n @case ('donut') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\r\n <circle cx=\"12\" cy=\"12\" r=\"4\"></circle>\r\n </svg>\r\n }\r\n }\r\n </button>\r\n</div>\r\n", styles: [":host{--fab-mini-bg: #ffffff;--fab-mini-border: #e2e8f0;--fab-mini-color: #64748b;--fab-mini-shadow: rgba(0, 0, 0, .12);--fab-mini-hover-border: #4678e5;--fab-mini-hover-color: #4678e5;--fab-tooltip-bg: rgba(15, 23, 42, .82);--fab-tooltip-color: #ffffff;--fab-main-from: #002fff;--fab-main-to: #3a88ed;--fab-main-shadow: rgba(70, 134, 229, .55);--fab-main-hover-shadow: rgba(70, 139, 229, .7);--fab-active-bg: #0957ff;--fab-active-shadow: rgba(70, 152, 229, .45)}:host-context([data-bs-theme=dark]),:host-context(.dark-mode),:host-context(.theme-dark){--fab-mini-bg: #1e293b;--fab-mini-border: #334155;--fab-mini-color: #94a3b8;--fab-mini-shadow: rgba(0, 0, 0, .35);--fab-mini-hover-border: #60a5fa;--fab-mini-hover-color: #60a5fa;--fab-tooltip-bg: rgba(248, 250, 252, .92);--fab-tooltip-color: #0f172a}.view-fab{position:fixed;bottom:24px;right:24px;z-index:999;display:flex;flex-direction:column-reverse;align-items:center;gap:.55rem}.fab-main{width:54px;height:54px;border-radius:50%;border:none;background:linear-gradient(135deg,var(--fab-main-from) 0%,var(--fab-main-to) 100%);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 18px var(--fab-main-shadow);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1),box-shadow .25s ease}.fab-main svg{transition:transform .35s ease}.fab-main:hover{transform:scale(1.1);box-shadow:0 6px 24px var(--fab-main-hover-shadow)}.fab-main.is-open{box-shadow:0 6px 24px var(--fab-main-hover-shadow)}.fab-mini{width:44px;height:44px;border-radius:50%;border:2px solid var(--fab-mini-border);background:var(--fab-mini-bg);color:var(--fab-mini-color);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 10px var(--fab-mini-shadow);cursor:pointer;transition:background .2s ease,border-color .2s ease,color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.fab-mini:hover{transform:scale(1.12);border-color:var(--fab-mini-hover-border);color:var(--fab-mini-hover-color)}.fab-mini.active{background:var(--fab-active-bg);border-color:var(--fab-active-bg);color:#fff;box-shadow:0 3px 12px var(--fab-active-shadow);transform:scale(1.08)}.fab-tooltip{position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%);font-size:.7rem;font-weight:600;background:var(--fab-tooltip-bg);backdrop-filter:blur(4px);color:var(--fab-tooltip-color);padding:3px 8px;border-radius:6px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s ease}.fab-menu{display:flex;flex-direction:column;align-items:center;gap:.55rem}.fab-mini-wrap{position:relative;display:flex;align-items:center;animation:fabMiniIn .22s cubic-bezier(.34,1.56,.64,1) both}.fab-mini-wrap:nth-child(1){animation-delay:0ms}.fab-mini-wrap:nth-child(2){animation-delay:55ms}.fab-mini-wrap:nth-child(3){animation-delay:.11s}.fab-mini-wrap:hover .fab-tooltip{opacity:1}.fab-menu--closing .fab-mini-wrap{animation:fabMiniOut .15s ease-in both;animation-delay:0ms}@keyframes fabMiniIn{0%{opacity:0;transform:translateY(12px) scale(.75)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fabMiniOut{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(10px) scale(.8)}}\n"] });
|
|
1717
|
+
}
|
|
1718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: DashboardViewSwitcherComponent, decorators: [{
|
|
1719
|
+
type: Component,
|
|
1720
|
+
args: [{ selector: 'app-dashboard-view-switcher', imports: [], template: "<div class=\"view-fab\" [style.--fab-main-from]=\"accentColor()\" [style.--fab-main-to]=\"accentColor()\"\r\n [style.--fab-active-bg]=\"accentColor()\" [style.--fab-mini-hover-border]=\"accentColor()\"\r\n [style.--fab-mini-hover-color]=\"accentColor()\" (mouseenter)=\"fabOpen.set(true)\" (mouseleave)=\"fabOpen.set(false)\">\r\n @if (fabRendered()) {\r\n <div class=\"fab-menu\" [class.fab-menu--closing]=\"!fabOpen()\">\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Dona</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'donut'\" (click)=\"setView('donut')\"\r\n title=\"Vista de dona\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\r\n <circle cx=\"12\" cy=\"12\" r=\"4\"></circle>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Barras</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'bars'\" (click)=\"setView('bars')\"\r\n title=\"Vista de barras\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <rect x=\"2\" y=\"13\" width=\"5\" height=\"9\" rx=\"1\"></rect>\r\n <rect x=\"9\" y=\"7\" width=\"5\" height=\"15\" rx=\"1\"></rect>\r\n <rect x=\"16\" y=\"3\" width=\"5\" height=\"19\" rx=\"1\"></rect>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n <div class=\"fab-mini-wrap\">\r\n <span class=\"fab-tooltip\">Tarjetas</span>\r\n <button class=\"fab-mini\" [class.active]=\"viewMode() === 'cards'\" (click)=\"setView('cards')\"\r\n title=\"Vista de tarjetas\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n </svg>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n }\r\n\r\n <button class=\"fab-main\" [class.is-open]=\"fabOpen()\" (click)=\"fabOpen.set(!fabOpen())\" title=\"Cambiar vista\">\r\n @switch (viewMode()) {\r\n @case ('cards') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <rect x=\"3\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"3\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"3\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n <rect x=\"14\" y=\"14\" width=\"7\" height=\"7\"></rect>\r\n </svg>\r\n }\r\n @case ('bars') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\r\n <rect x=\"2\" y=\"13\" width=\"5\" height=\"9\" rx=\"1\"></rect>\r\n <rect x=\"9\" y=\"7\" width=\"5\" height=\"15\" rx=\"1\"></rect>\r\n <rect x=\"16\" y=\"3\" width=\"5\" height=\"19\" rx=\"1\"></rect>\r\n </svg>\r\n }\r\n @case ('donut') {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"\r\n stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\r\n <circle cx=\"12\" cy=\"12\" r=\"4\"></circle>\r\n </svg>\r\n }\r\n }\r\n </button>\r\n</div>\r\n", styles: [":host{--fab-mini-bg: #ffffff;--fab-mini-border: #e2e8f0;--fab-mini-color: #64748b;--fab-mini-shadow: rgba(0, 0, 0, .12);--fab-mini-hover-border: #4678e5;--fab-mini-hover-color: #4678e5;--fab-tooltip-bg: rgba(15, 23, 42, .82);--fab-tooltip-color: #ffffff;--fab-main-from: #002fff;--fab-main-to: #3a88ed;--fab-main-shadow: rgba(70, 134, 229, .55);--fab-main-hover-shadow: rgba(70, 139, 229, .7);--fab-active-bg: #0957ff;--fab-active-shadow: rgba(70, 152, 229, .45)}:host-context([data-bs-theme=dark]),:host-context(.dark-mode),:host-context(.theme-dark){--fab-mini-bg: #1e293b;--fab-mini-border: #334155;--fab-mini-color: #94a3b8;--fab-mini-shadow: rgba(0, 0, 0, .35);--fab-mini-hover-border: #60a5fa;--fab-mini-hover-color: #60a5fa;--fab-tooltip-bg: rgba(248, 250, 252, .92);--fab-tooltip-color: #0f172a}.view-fab{position:fixed;bottom:24px;right:24px;z-index:999;display:flex;flex-direction:column-reverse;align-items:center;gap:.55rem}.fab-main{width:54px;height:54px;border-radius:50%;border:none;background:linear-gradient(135deg,var(--fab-main-from) 0%,var(--fab-main-to) 100%);color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 18px var(--fab-main-shadow);cursor:pointer;transition:transform .25s cubic-bezier(.34,1.56,.64,1),box-shadow .25s ease}.fab-main svg{transition:transform .35s ease}.fab-main:hover{transform:scale(1.1);box-shadow:0 6px 24px var(--fab-main-hover-shadow)}.fab-main.is-open{box-shadow:0 6px 24px var(--fab-main-hover-shadow)}.fab-mini{width:44px;height:44px;border-radius:50%;border:2px solid var(--fab-mini-border);background:var(--fab-mini-bg);color:var(--fab-mini-color);display:flex;align-items:center;justify-content:center;box-shadow:0 2px 10px var(--fab-mini-shadow);cursor:pointer;transition:background .2s ease,border-color .2s ease,color .2s ease,transform .2s cubic-bezier(.34,1.56,.64,1),box-shadow .2s ease}.fab-mini:hover{transform:scale(1.12);border-color:var(--fab-mini-hover-border);color:var(--fab-mini-hover-color)}.fab-mini.active{background:var(--fab-active-bg);border-color:var(--fab-active-bg);color:#fff;box-shadow:0 3px 12px var(--fab-active-shadow);transform:scale(1.08)}.fab-tooltip{position:absolute;right:calc(100% + 10px);top:50%;transform:translateY(-50%);font-size:.7rem;font-weight:600;background:var(--fab-tooltip-bg);backdrop-filter:blur(4px);color:var(--fab-tooltip-color);padding:3px 8px;border-radius:6px;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .15s ease}.fab-menu{display:flex;flex-direction:column;align-items:center;gap:.55rem}.fab-mini-wrap{position:relative;display:flex;align-items:center;animation:fabMiniIn .22s cubic-bezier(.34,1.56,.64,1) both}.fab-mini-wrap:nth-child(1){animation-delay:0ms}.fab-mini-wrap:nth-child(2){animation-delay:55ms}.fab-mini-wrap:nth-child(3){animation-delay:.11s}.fab-mini-wrap:hover .fab-tooltip{opacity:1}.fab-menu--closing .fab-mini-wrap{animation:fabMiniOut .15s ease-in both;animation-delay:0ms}@keyframes fabMiniIn{0%{opacity:0;transform:translateY(12px) scale(.75)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes fabMiniOut{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(10px) scale(.8)}}\n"] }]
|
|
1721
|
+
}], ctorParameters: () => [] });
|
|
1722
|
+
|
|
1723
|
+
/*
|
|
1724
|
+
* Public API Surface of layout-tsi
|
|
1725
|
+
*/
|
|
1726
|
+
// SHELL (layout genérico: sidebar + header + menú)
|
|
1727
|
+
|
|
1728
|
+
/**
|
|
1729
|
+
* Generated bundle index. Do not edit.
|
|
1730
|
+
*/
|
|
1731
|
+
|
|
1732
|
+
export { BottomNavigationComponent, CHATBOT_CONFIG, ChatbotComponent, DashboardChartBarsComponent, DashboardChartDonutComponent, DashboardViewSwitcherComponent, DetectorService, EXTRALINK_OPENER, FullComponent, HeaderUiService, ItemDashboardComponent, ItemDashboardGroupComponent, MenuItemComponent, MenuService, NotFoundComponent, TABS_SYNC_PROVIDER, TabBarComponent, TabsService, VerticalHeaderComponent };
|
|
1733
|
+
//# sourceMappingURL=layout-tsi.mjs.map
|