@kaufmann-lab/ui 0.1.31 → 0.1.33
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/fesm2022/kaufmann-lab-ui-business.mjs +58 -5
- package/fesm2022/kaufmann-lab-ui-business.mjs.map +1 -1
- package/fesm2022/kaufmann-lab-ui-core.mjs +485 -101
- package/fesm2022/kaufmann-lab-ui-core.mjs.map +1 -1
- package/package.json +1 -1
- package/types/kaufmann-lab-ui-business.d.ts +53 -3
- package/types/kaufmann-lab-ui-core.d.ts +178 -15
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, booleanAttribute, inject, computed, effect, Component, viewChild, model, afterRenderEffect, untracked, isDevMode,
|
|
3
|
+
import { input, booleanAttribute, inject, computed, effect, Component, viewChild, ViewContainerRef, Injector, DestroyRef, afterNextRender, model, afterRenderEffect, untracked, isDevMode, HostListener, TemplateRef, contentChild, ElementRef, output, signal as signal$1, ChangeDetectionStrategy, numberAttribute, Directive, contentChildren, forwardRef, viewChildren, Input as Input$1, Injectable } from '@angular/core';
|
|
4
4
|
import { FocusTrapFactory } from '@angular/cdk/a11y';
|
|
5
|
-
import {
|
|
5
|
+
import { Overlay, OverlayContainer } from '@angular/cdk/overlay';
|
|
6
6
|
import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal';
|
|
7
7
|
import { Subscription } from 'rxjs';
|
|
8
8
|
import * as i1 from '@angular/forms';
|
|
@@ -1473,6 +1473,48 @@ function installModalAwareOverlayContainer(container) {
|
|
|
1473
1473
|
});
|
|
1474
1474
|
}
|
|
1475
1475
|
|
|
1476
|
+
/**
|
|
1477
|
+
* Monta una plantilla (típicamente un `kf-drawer side="bottom"`) en el contenedor
|
|
1478
|
+
* de overlays de CDK, fuera del DOM del componente que la declara. Un
|
|
1479
|
+
* `position: fixed` dentro de un ancestro con `container-type`, `transform` o
|
|
1480
|
+
* `contain` se mide contra ese ancestro y no contra la ventana; en el contenedor
|
|
1481
|
+
* de overlays no.
|
|
1482
|
+
*
|
|
1483
|
+
* La plantilla se monta una sola vez, la primera vez que se pide (`mount`), y
|
|
1484
|
+
* queda montada hasta que el componente se destruye o se pide `unmount`. `afterMount` corre tras el
|
|
1485
|
+
* siguiente render, cuando la hoja ya existe cerrada: abrirla ahí hace que entre
|
|
1486
|
+
* con su deslizamiento en vez de aparecer ya abierta.
|
|
1487
|
+
*
|
|
1488
|
+
* Debe construirse en un contexto de inyección (campo de un componente).
|
|
1489
|
+
*/
|
|
1490
|
+
class SheetPortal {
|
|
1491
|
+
overlay = inject(Overlay);
|
|
1492
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
1493
|
+
injector = inject(Injector);
|
|
1494
|
+
overlayRef = null;
|
|
1495
|
+
constructor() {
|
|
1496
|
+
inject(DestroyRef).onDestroy(() => this.overlayRef?.dispose());
|
|
1497
|
+
}
|
|
1498
|
+
/** `true` si la plantilla ya estaba montada; si no, la monta y llama `afterMount` más tarde. */
|
|
1499
|
+
mount(template, afterMount) {
|
|
1500
|
+
if (this.overlayRef) {
|
|
1501
|
+
return true;
|
|
1502
|
+
}
|
|
1503
|
+
this.overlayRef = this.overlay.create({
|
|
1504
|
+
positionStrategy: this.overlay.position().global(),
|
|
1505
|
+
scrollStrategy: this.overlay.scrollStrategies.noop(),
|
|
1506
|
+
});
|
|
1507
|
+
this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));
|
|
1508
|
+
afterNextRender(afterMount, { injector: this.injector });
|
|
1509
|
+
return false;
|
|
1510
|
+
}
|
|
1511
|
+
/** Retira la plantilla del contenedor de overlays; un `mount` posterior la monta de nuevo. */
|
|
1512
|
+
unmount() {
|
|
1513
|
+
this.overlayRef?.dispose();
|
|
1514
|
+
this.overlayRef = null;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1476
1518
|
let nextId$6 = 0;
|
|
1477
1519
|
/** Controles que, al recibir el `pointerdown`, no deben iniciar el arrastre de la hoja. */
|
|
1478
1520
|
const DRAG_IGNORED_TARGETS = 'button, a[href], input, select, textarea, [role="button"], [contenteditable="true"]';
|
|
@@ -1568,9 +1610,34 @@ const DRAG_IGNORED_TARGETS = 'button, a[href], input, select, textarea, [role="b
|
|
|
1568
1610
|
* El panel y el telón son `position: fixed` dentro del propio componente. Un
|
|
1569
1611
|
* ancestro con `container-type`, `transform`, `filter` o `contain` pasa a ser
|
|
1570
1612
|
* su bloque contenedor: el drawer se mide contra ese ancestro y no contra la
|
|
1571
|
-
* ventana. Hay
|
|
1572
|
-
* `kf-date-field` y `kf-time-field` no tienen
|
|
1573
|
-
* en el contenedor de overlays de CDK.
|
|
1613
|
+
* ventana. Hay dos salidas: colocarlo fuera de esos contenedores o activar
|
|
1614
|
+
* `mountInOverlay`. `kf-action-menu`, `kf-date-field` y `kf-time-field` no tienen
|
|
1615
|
+
* esta limitación: montan su hoja en el contenedor de overlays de CDK.
|
|
1616
|
+
*
|
|
1617
|
+
* ## `mountInOverlay`
|
|
1618
|
+
*
|
|
1619
|
+
* Con `mountInOverlay`, el telón y el panel se montan en el contenedor de
|
|
1620
|
+
* overlays de CDK (hijo de `<body>`) en vez de dentro del componente, así un
|
|
1621
|
+
* ancestro con `container-type`, `transform`, `filter` o `contain` ya no
|
|
1622
|
+
* captura su posicionamiento `fixed`: el panel se ancla a la ventana. Foco
|
|
1623
|
+
* atrapado, Escape, telón, devolución de foco, `size`, `sheetSize`, arrastre de
|
|
1624
|
+
* la hoja y áreas seguras funcionan igual; `[(open)]` y el contenido proyectado
|
|
1625
|
+
* siguen declarándose donde se escribe `<kf-drawer>`. Sin el input el drawer
|
|
1626
|
+
* queda inline, como siempre.
|
|
1627
|
+
*
|
|
1628
|
+
* <section class="tarjeta" style="container-type: inline-size">
|
|
1629
|
+
* <kf-drawer [(open)]="open" role="dialog" side="right" title="Detalle" mountInOverlay>
|
|
1630
|
+
* ...
|
|
1631
|
+
* </kf-drawer>
|
|
1632
|
+
* </section>
|
|
1633
|
+
*
|
|
1634
|
+
* Qué cambia al montarlo así: el DOM del panel deja de ser descendiente del
|
|
1635
|
+
* `<kf-drawer>` (no le llegan variables CSS, atributos de tema ni estilos heredados de un
|
|
1636
|
+
* ancestro: usa `size`/`sheetSize`, o declara la variable en `:root`; la
|
|
1637
|
+
* tipografía del panel es `--kf-font-body`); y un panel
|
|
1638
|
+
* flotante abierto desde dentro (`kf-select`, `kf-dropdown`) queda en el
|
|
1639
|
+
* contenedor de overlays, junto al panel y no dentro de él. Se puede cambiar en
|
|
1640
|
+
* vida: al volver a `false` el drawer regresa al flujo del componente.
|
|
1574
1641
|
*/
|
|
1575
1642
|
class Drawer {
|
|
1576
1643
|
/** Visibilidad del panel, two-way: `[(open)]="menuOpen"`. */
|
|
@@ -1624,6 +1691,13 @@ class Drawer {
|
|
|
1624
1691
|
*/
|
|
1625
1692
|
closeOnBack = input(false, /* @ts-ignore */
|
|
1626
1693
|
...(ngDevMode ? [{ debugName: "closeOnBack" }] : /* istanbul ignore next */ []));
|
|
1694
|
+
/**
|
|
1695
|
+
* Monta el telón y el panel en el contenedor de overlays de CDK en vez de dentro del
|
|
1696
|
+
* componente, para que un ancestro con `container-type`, `transform`, `filter` o
|
|
1697
|
+
* `contain` no capture su posicionamiento `fixed`. Default `false` (inline). Ver el
|
|
1698
|
+
* JSDoc de la clase.
|
|
1699
|
+
*/
|
|
1700
|
+
mountInOverlay = input(false, { ...(ngDevMode ? { debugName: "mountInOverlay" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1627
1701
|
/** `ariaLabel` o, sin él, el default según el rol. */
|
|
1628
1702
|
resolvedAriaLabel = computed(() => this.ariaLabel() ?? (this.role() === 'dialog' ? 'Diálogo' : 'Menú'), /* @ts-ignore */
|
|
1629
1703
|
...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -1631,8 +1705,12 @@ class Drawer {
|
|
|
1631
1705
|
resolvedCloseLabel = computed(() => this.closeLabel() ?? (this.role() === 'dialog' ? 'Cerrar' : 'Cerrar menú'), /* @ts-ignore */
|
|
1632
1706
|
...(ngDevMode ? [{ debugName: "resolvedCloseLabel" }] : /* istanbul ignore next */ []));
|
|
1633
1707
|
titleId = `kf-drawer-title-${nextId$6++}`;
|
|
1634
|
-
|
|
1708
|
+
/** Ausente solo un instante: con `mountInOverlay` la plantilla se monta tras el primer render. */
|
|
1709
|
+
panelRef = viewChild('panel', /* @ts-ignore */
|
|
1635
1710
|
...(ngDevMode ? [{ debugName: "panelRef" }] : /* istanbul ignore next */ []));
|
|
1711
|
+
contentTemplate = viewChild('content', /* @ts-ignore */
|
|
1712
|
+
...(ngDevMode ? [{ debugName: "contentTemplate" }] : /* istanbul ignore next */ []));
|
|
1713
|
+
portal = new SheetPortal();
|
|
1636
1714
|
focusTrapFactory = inject(FocusTrapFactory);
|
|
1637
1715
|
document = inject(DOCUMENT);
|
|
1638
1716
|
overlayContainer = inject(OverlayContainer);
|
|
@@ -1641,13 +1719,35 @@ class Drawer {
|
|
|
1641
1719
|
drag = null;
|
|
1642
1720
|
registeredPanel = null;
|
|
1643
1721
|
focusTrap = null;
|
|
1722
|
+
focusTrapPanel = null;
|
|
1644
1723
|
lastFocusedElement = null;
|
|
1645
1724
|
constructor() {
|
|
1646
1725
|
// Ver `modal-overlay-container.ts`: con `role="dialog"` los paneles
|
|
1647
1726
|
// flotantes (select, dropdown) deben vivir dentro del diálogo.
|
|
1648
1727
|
installModalAwareOverlayContainer(this.overlayContainer);
|
|
1649
1728
|
afterRenderEffect(() => {
|
|
1650
|
-
const
|
|
1729
|
+
const template = this.contentTemplate();
|
|
1730
|
+
const inOverlay = this.mountInOverlay();
|
|
1731
|
+
untracked(() => {
|
|
1732
|
+
if (!template) {
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
if (inOverlay) {
|
|
1736
|
+
this.portal.mount(template, () => undefined);
|
|
1737
|
+
}
|
|
1738
|
+
else {
|
|
1739
|
+
this.portal.unmount();
|
|
1740
|
+
}
|
|
1741
|
+
});
|
|
1742
|
+
});
|
|
1743
|
+
afterRenderEffect(() => {
|
|
1744
|
+
const panel = this.panelRef()?.nativeElement;
|
|
1745
|
+
if (!panel) {
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1748
|
+
if (this.registeredPanel && this.registeredPanel !== panel) {
|
|
1749
|
+
unregisterOpenModalDialog(this.registeredPanel);
|
|
1750
|
+
}
|
|
1651
1751
|
this.registeredPanel = panel;
|
|
1652
1752
|
if (this.open() && this.role() === 'dialog') {
|
|
1653
1753
|
registerOpenModalDialog(panel);
|
|
@@ -1657,12 +1757,13 @@ class Drawer {
|
|
|
1657
1757
|
}
|
|
1658
1758
|
});
|
|
1659
1759
|
afterRenderEffect(() => {
|
|
1660
|
-
|
|
1760
|
+
const panel = this.panelRef()?.nativeElement;
|
|
1761
|
+
if (this.open() && panel) {
|
|
1661
1762
|
this.lastFocusedElement = this.document.activeElement;
|
|
1662
|
-
const trap = this.getOrCreateFocusTrap();
|
|
1763
|
+
const trap = this.getOrCreateFocusTrap(panel);
|
|
1663
1764
|
void trap.focusInitialElement();
|
|
1664
1765
|
}
|
|
1665
|
-
else {
|
|
1766
|
+
else if (!this.open()) {
|
|
1666
1767
|
this.focusTrap?.destroy();
|
|
1667
1768
|
this.focusTrap = null;
|
|
1668
1769
|
if (this.lastFocusedElement?.isConnected) {
|
|
@@ -1738,14 +1839,14 @@ class Drawer {
|
|
|
1738
1839
|
catch {
|
|
1739
1840
|
// Un puntero sintético no se puede capturar: el arrastre sigue por los eventos del propio elemento.
|
|
1740
1841
|
}
|
|
1741
|
-
this.panelRef()
|
|
1842
|
+
this.panelRef()?.nativeElement.style.setProperty('transition', 'none');
|
|
1742
1843
|
}
|
|
1743
1844
|
onDragMove(event) {
|
|
1744
1845
|
if (!this.drag || event.pointerId !== this.drag.pointerId) {
|
|
1745
1846
|
return;
|
|
1746
1847
|
}
|
|
1747
1848
|
this.drag.dy = Math.max(0, event.clientY - this.drag.startY);
|
|
1748
|
-
this.panelRef()
|
|
1849
|
+
this.panelRef()?.nativeElement.style.setProperty('transform', `translateY(${this.drag.dy}px)`);
|
|
1749
1850
|
}
|
|
1750
1851
|
onDragEnd(event) {
|
|
1751
1852
|
const drag = this.drag;
|
|
@@ -1753,7 +1854,10 @@ class Drawer {
|
|
|
1753
1854
|
return;
|
|
1754
1855
|
}
|
|
1755
1856
|
this.drag = null;
|
|
1756
|
-
const panel = this.panelRef()
|
|
1857
|
+
const panel = this.panelRef()?.nativeElement;
|
|
1858
|
+
if (!panel) {
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1757
1861
|
const elapsed = Math.max(1, performance.now() - drag.startTime);
|
|
1758
1862
|
const threshold = Math.min(80, panel.getBoundingClientRect().height * 0.25);
|
|
1759
1863
|
const shouldClose = drag.dy > threshold || (drag.dy > 24 && drag.dy / elapsed > 0.5);
|
|
@@ -1768,22 +1872,27 @@ class Drawer {
|
|
|
1768
1872
|
return;
|
|
1769
1873
|
}
|
|
1770
1874
|
this.drag = null;
|
|
1771
|
-
const panel = this.panelRef()
|
|
1772
|
-
panel
|
|
1773
|
-
panel
|
|
1875
|
+
const panel = this.panelRef()?.nativeElement;
|
|
1876
|
+
panel?.style.removeProperty('transition');
|
|
1877
|
+
panel?.style.removeProperty('transform');
|
|
1774
1878
|
}
|
|
1775
|
-
getOrCreateFocusTrap() {
|
|
1879
|
+
getOrCreateFocusTrap(panel) {
|
|
1880
|
+
if (this.focusTrap && this.focusTrapPanel !== panel) {
|
|
1881
|
+
this.focusTrap.destroy();
|
|
1882
|
+
this.focusTrap = null;
|
|
1883
|
+
}
|
|
1776
1884
|
if (!this.focusTrap) {
|
|
1777
|
-
this.focusTrap = this.focusTrapFactory.create(
|
|
1885
|
+
this.focusTrap = this.focusTrapFactory.create(panel);
|
|
1886
|
+
this.focusTrapPanel = panel;
|
|
1778
1887
|
}
|
|
1779
1888
|
return this.focusTrap;
|
|
1780
1889
|
}
|
|
1781
1890
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Drawer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1782
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Drawer, isStandalone: true, selector: "kf-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, sheetSize: { classPropertyName: "sheetSize", publicName: "sheetSize", isSignal: true, isRequired: false, transformFunction: null }, swipeToClose: { classPropertyName: "swipeToClose", publicName: "swipeToClose", isSignal: true, isRequired: false, transformFunction: null }, closeOnBack: { classPropertyName: "closeOnBack", publicName: "closeOnBack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { listeners: { "window:popstate": "onPopState()", "document:keydown.escape": "onEscape($event)" }, properties: { "attr.role": "null", "attr.title": "null" } }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (open()) {\n
|
|
1891
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Drawer, isStandalone: true, selector: "kf-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, sheetSize: { classPropertyName: "sheetSize", publicName: "sheetSize", isSignal: true, isRequired: false, transformFunction: null }, swipeToClose: { classPropertyName: "swipeToClose", publicName: "swipeToClose", isSignal: true, isRequired: false, transformFunction: null }, closeOnBack: { classPropertyName: "closeOnBack", publicName: "closeOnBack", isSignal: true, isRequired: false, transformFunction: null }, mountInOverlay: { classPropertyName: "mountInOverlay", publicName: "mountInOverlay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { listeners: { "window:popstate": "onPopState()", "document:keydown.escape": "onEscape($event)" }, properties: { "attr.role": "null", "attr.title": "null" } }, viewQueries: [{ propertyName: "panelRef", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "contentTemplate", first: true, predicate: ["content"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Backdrop y panel van en una plantilla: inline dentro del propio componente\n (default) o, con `mountInOverlay`, montados en el contenedor de overlays de\n CDK para escapar de un ancestro con `container-type`, `transform` o `contain`. -->\n<ng-template #content>\n @if (open()) {\n <button\n type=\"button\"\n class=\"kf-drawer__overlay\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n [attr.tabindex]=\"role() === 'dialog' ? -1 : null\"\n (click)=\"open.set(false)\"\n ></button>\n }\n\n <!-- Un <div> con rol expl\u00EDcito (no <nav>): un mismo panel puede ser\n navegaci\u00F3n o di\u00E1logo, y <nav> no admite role=\"dialog\". -->\n <div\n #panel\n class=\"kf-drawer__panel\"\n [class.kf-drawer__panel--open]=\"open()\"\n [class.kf-drawer__panel--right]=\"side() === 'right'\"\n [class.kf-drawer__panel--bottom]=\"side() === 'bottom'\"\n [class.kf-drawer__panel--size-md]=\"side() !== 'bottom' && size() === 'md'\"\n [class.kf-drawer__panel--size-lg]=\"side() !== 'bottom' && size() === 'lg'\"\n [class.kf-drawer__panel--sheet-full]=\"side() === 'bottom' && sheetSize() === 'full'\"\n [class.kf-drawer__panel--dialog]=\"role() === 'dialog'\"\n [class.kf-drawer__panel--overlay]=\"mountInOverlay()\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"role() === 'dialog' ? 'true' : null\"\n [attr.aria-label]=\"title() ? null : resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [attr.aria-hidden]=\"!open()\"\n >\n @if (side() === 'bottom') {\n <div\n class=\"kf-drawer__grip\"\n aria-hidden=\"true\"\n (pointerdown)=\"onDragStart($event)\"\n (pointermove)=\"onDragMove($event)\"\n (pointerup)=\"onDragEnd($event)\"\n (pointercancel)=\"onDragCancel()\"\n ></div>\n }\n @if (title(); as titleText) {\n <div\n class=\"kf-drawer__titlebar\"\n (pointerdown)=\"onDragStart($event)\"\n (pointermove)=\"onDragMove($event)\"\n (pointerup)=\"onDragEnd($event)\"\n (pointercancel)=\"onDragCancel()\"\n >\n <h2 class=\"kf-drawer__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <kf-button\n class=\"kf-drawer__close\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n icon=\"x\"\n [ariaLabel]=\"resolvedCloseLabel()\"\n (click)=\"open.set(false)\"\n />\n </div>\n }\n <div class=\"kf-drawer__header\"><ng-content select=\"[kf-drawer-header]\" /></div>\n <div class=\"kf-drawer__body\"><ng-content /></div>\n <div class=\"kf-drawer__footer\"><ng-content select=\"[kf-drawer-footer]\" /></div>\n </div>\n</ng-template>\n\n@if (!mountInOverlay()) {\n <ng-container [ngTemplateOutlet]=\"content\" />\n}\n", styles: [".kf-drawer__overlay{position:fixed;inset:0;border:none;padding:0;cursor:pointer;background:#171d2566;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:39}.kf-drawer__panel{position:fixed;top:0;left:0;bottom:0;z-index:40;display:flex;flex-direction:column;width:82%;max-width:320px;background:var(--kf-color-white);box-shadow:8px 0 24px -8px #1018284d;transform:translate(-100%);visibility:hidden;transition:transform .24s cubic-bezier(.32,.72,0,1),visibility 0s linear .24s}.kf-drawer__panel--overlay{font-family:var(--kf-font-body)}.kf-drawer__panel--right{left:auto;right:0;box-shadow:-8px 0 24px -8px #1018284d;transform:translate(100%)}.kf-drawer__panel--dialog{width:min(var(--kf-drawer-width, 480px),100vw);max-width:none}@media(max-width:640px){.kf-drawer__panel--dialog{width:100vw}}.kf-drawer__panel--size-md{width:min(var(--kf-drawer-width-md, 640px),94vw);max-width:none}.kf-drawer__panel--size-lg{width:min(var(--kf-drawer-width-lg, 880px),70vw);max-width:none}@media(max-width:600px){.kf-drawer__panel--size-md,.kf-drawer__panel--size-lg{width:100vw}}.kf-drawer__panel--bottom{top:auto;right:0;width:100%;max-width:none;max-height:80vh;border-radius:var(--kf-radius-lg) var(--kf-radius-lg) 0 0;box-shadow:var(--kf-shadow-lg);padding-bottom:env(safe-area-inset-bottom,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);transform:translateY(100%)}.kf-drawer__panel--sheet-full{height:100vh;height:100dvh;max-height:none;border-radius:0}@media(orientation:landscape)and (max-height:500px){.kf-drawer__panel--bottom:not(.kf-drawer__panel--sheet-full){max-height:94vh}}.kf-drawer__panel--bottom .kf-drawer__grip,.kf-drawer__panel--bottom .kf-drawer__titlebar{touch-action:none}.kf-drawer__panel--open{transform:none;visibility:visible;transition:transform .24s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.kf-drawer__panel--bottom.kf-drawer__panel--open{transform:none}@media(prefers-reduced-motion:reduce){.kf-drawer__panel,.kf-drawer__panel--open{transition:none}}.kf-drawer__grip{position:relative;flex:none;align-self:center;width:36px;height:4px;margin-top:var(--kf-space-sm);border-radius:var(--kf-radius-pill);background:var(--kf-color-border-strong)}.kf-drawer__grip:before{content:\"\";position:absolute;inset:-12px -32px}.kf-drawer__titlebar{flex:none;display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-sm) var(--kf-space-sm) var(--kf-space-lg);border-bottom:1px solid var(--kf-color-border)}.kf-drawer__title{margin:0;min-width:0;font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-sm);font-weight:700;line-height:1.25;color:var(--kf-color-ink)}.kf-drawer__close{flex:none}@media(pointer:coarse),(max-width:760px){.kf-drawer__close{--kf-button-min-height: 44px;min-width:44px}}.kf-drawer__header:empty,.kf-drawer__footer:empty{display:none}.kf-drawer__header{padding:var(--kf-space-lg);background:var(--kf-color-tertiary-deep)}.kf-drawer__body{flex:1 1 auto;min-height:0;overscroll-behavior:contain;display:flex;flex-direction:column;gap:var(--kf-space-xs);padding:var(--kf-space-lg);overflow-y:auto}.kf-drawer__panel--dialog .kf-drawer__body{gap:var(--kf-space-lg)}.kf-drawer__footer{flex:none;padding:var(--kf-space-lg);border-top:1px solid var(--kf-color-border)}.kf-drawer__panel--dialog .kf-drawer__footer{padding:var(--kf-space-md) var(--kf-space-lg)}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
1783
1892
|
}
|
|
1784
1893
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Drawer, decorators: [{
|
|
1785
1894
|
type: Component,
|
|
1786
|
-
args: [{ selector: 'kf-drawer', imports: [Button], host: {
|
|
1895
|
+
args: [{ selector: 'kf-drawer', imports: [Button, NgTemplateOutlet], host: {
|
|
1787
1896
|
// `role` y `title` son inputs con nombre de atributo nativo: escritos
|
|
1788
1897
|
// como atributo estático (`role="dialog"`, `title="Filtros"`) Angular
|
|
1789
1898
|
// también los deja en el host, lo que anidaría dos diálogos y mostraría
|
|
@@ -1791,8 +1900,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
1791
1900
|
'[attr.role]': 'null',
|
|
1792
1901
|
'[attr.title]': 'null',
|
|
1793
1902
|
'(window:popstate)': 'onPopState()',
|
|
1794
|
-
}, template: "@if (open()) {\n
|
|
1795
|
-
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], sheetSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheetSize", required: false }] }], swipeToClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeToClose", required: false }] }], closeOnBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBack", required: false }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], onEscape: [{
|
|
1903
|
+
}, template: "<!-- Backdrop y panel van en una plantilla: inline dentro del propio componente\n (default) o, con `mountInOverlay`, montados en el contenedor de overlays de\n CDK para escapar de un ancestro con `container-type`, `transform` o `contain`. -->\n<ng-template #content>\n @if (open()) {\n <button\n type=\"button\"\n class=\"kf-drawer__overlay\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n [attr.tabindex]=\"role() === 'dialog' ? -1 : null\"\n (click)=\"open.set(false)\"\n ></button>\n }\n\n <!-- Un <div> con rol expl\u00EDcito (no <nav>): un mismo panel puede ser\n navegaci\u00F3n o di\u00E1logo, y <nav> no admite role=\"dialog\". -->\n <div\n #panel\n class=\"kf-drawer__panel\"\n [class.kf-drawer__panel--open]=\"open()\"\n [class.kf-drawer__panel--right]=\"side() === 'right'\"\n [class.kf-drawer__panel--bottom]=\"side() === 'bottom'\"\n [class.kf-drawer__panel--size-md]=\"side() !== 'bottom' && size() === 'md'\"\n [class.kf-drawer__panel--size-lg]=\"side() !== 'bottom' && size() === 'lg'\"\n [class.kf-drawer__panel--sheet-full]=\"side() === 'bottom' && sheetSize() === 'full'\"\n [class.kf-drawer__panel--dialog]=\"role() === 'dialog'\"\n [class.kf-drawer__panel--overlay]=\"mountInOverlay()\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"role() === 'dialog' ? 'true' : null\"\n [attr.aria-label]=\"title() ? null : resolvedAriaLabel()\"\n [attr.aria-labelledby]=\"title() ? titleId : null\"\n [attr.aria-hidden]=\"!open()\"\n >\n @if (side() === 'bottom') {\n <div\n class=\"kf-drawer__grip\"\n aria-hidden=\"true\"\n (pointerdown)=\"onDragStart($event)\"\n (pointermove)=\"onDragMove($event)\"\n (pointerup)=\"onDragEnd($event)\"\n (pointercancel)=\"onDragCancel()\"\n ></div>\n }\n @if (title(); as titleText) {\n <div\n class=\"kf-drawer__titlebar\"\n (pointerdown)=\"onDragStart($event)\"\n (pointermove)=\"onDragMove($event)\"\n (pointerup)=\"onDragEnd($event)\"\n (pointercancel)=\"onDragCancel()\"\n >\n <h2 class=\"kf-drawer__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <kf-button\n class=\"kf-drawer__close\"\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n icon=\"x\"\n [ariaLabel]=\"resolvedCloseLabel()\"\n (click)=\"open.set(false)\"\n />\n </div>\n }\n <div class=\"kf-drawer__header\"><ng-content select=\"[kf-drawer-header]\" /></div>\n <div class=\"kf-drawer__body\"><ng-content /></div>\n <div class=\"kf-drawer__footer\"><ng-content select=\"[kf-drawer-footer]\" /></div>\n </div>\n</ng-template>\n\n@if (!mountInOverlay()) {\n <ng-container [ngTemplateOutlet]=\"content\" />\n}\n", styles: [".kf-drawer__overlay{position:fixed;inset:0;border:none;padding:0;cursor:pointer;background:#171d2566;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:39}.kf-drawer__panel{position:fixed;top:0;left:0;bottom:0;z-index:40;display:flex;flex-direction:column;width:82%;max-width:320px;background:var(--kf-color-white);box-shadow:8px 0 24px -8px #1018284d;transform:translate(-100%);visibility:hidden;transition:transform .24s cubic-bezier(.32,.72,0,1),visibility 0s linear .24s}.kf-drawer__panel--overlay{font-family:var(--kf-font-body)}.kf-drawer__panel--right{left:auto;right:0;box-shadow:-8px 0 24px -8px #1018284d;transform:translate(100%)}.kf-drawer__panel--dialog{width:min(var(--kf-drawer-width, 480px),100vw);max-width:none}@media(max-width:640px){.kf-drawer__panel--dialog{width:100vw}}.kf-drawer__panel--size-md{width:min(var(--kf-drawer-width-md, 640px),94vw);max-width:none}.kf-drawer__panel--size-lg{width:min(var(--kf-drawer-width-lg, 880px),70vw);max-width:none}@media(max-width:600px){.kf-drawer__panel--size-md,.kf-drawer__panel--size-lg{width:100vw}}.kf-drawer__panel--bottom{top:auto;right:0;width:100%;max-width:none;max-height:80vh;border-radius:var(--kf-radius-lg) var(--kf-radius-lg) 0 0;box-shadow:var(--kf-shadow-lg);padding-bottom:env(safe-area-inset-bottom,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);transform:translateY(100%)}.kf-drawer__panel--sheet-full{height:100vh;height:100dvh;max-height:none;border-radius:0}@media(orientation:landscape)and (max-height:500px){.kf-drawer__panel--bottom:not(.kf-drawer__panel--sheet-full){max-height:94vh}}.kf-drawer__panel--bottom .kf-drawer__grip,.kf-drawer__panel--bottom .kf-drawer__titlebar{touch-action:none}.kf-drawer__panel--open{transform:none;visibility:visible;transition:transform .24s cubic-bezier(.32,.72,0,1),visibility 0s linear 0s}.kf-drawer__panel--bottom.kf-drawer__panel--open{transform:none}@media(prefers-reduced-motion:reduce){.kf-drawer__panel,.kf-drawer__panel--open{transition:none}}.kf-drawer__grip{position:relative;flex:none;align-self:center;width:36px;height:4px;margin-top:var(--kf-space-sm);border-radius:var(--kf-radius-pill);background:var(--kf-color-border-strong)}.kf-drawer__grip:before{content:\"\";position:absolute;inset:-12px -32px}.kf-drawer__titlebar{flex:none;display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-sm) var(--kf-space-sm) var(--kf-space-lg);border-bottom:1px solid var(--kf-color-border)}.kf-drawer__title{margin:0;min-width:0;font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-sm);font-weight:700;line-height:1.25;color:var(--kf-color-ink)}.kf-drawer__close{flex:none}@media(pointer:coarse),(max-width:760px){.kf-drawer__close{--kf-button-min-height: 44px;min-width:44px}}.kf-drawer__header:empty,.kf-drawer__footer:empty{display:none}.kf-drawer__header{padding:var(--kf-space-lg);background:var(--kf-color-tertiary-deep)}.kf-drawer__body{flex:1 1 auto;min-height:0;overscroll-behavior:contain;display:flex;flex-direction:column;gap:var(--kf-space-xs);padding:var(--kf-space-lg);overflow-y:auto}.kf-drawer__panel--dialog .kf-drawer__body{gap:var(--kf-space-lg)}.kf-drawer__footer{flex:none;padding:var(--kf-space-lg);border-top:1px solid var(--kf-color-border)}.kf-drawer__panel--dialog .kf-drawer__footer{padding:var(--kf-space-md) var(--kf-space-lg)}\n"] }]
|
|
1904
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], sheetSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheetSize", required: false }] }], swipeToClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "swipeToClose", required: false }] }], closeOnBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBack", required: false }] }], mountInOverlay: [{ type: i0.Input, args: [{ isSignal: true, alias: "mountInOverlay", required: false }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], contentTemplate: [{ type: i0.ViewChild, args: ['content', { isSignal: true }] }], onEscape: [{
|
|
1796
1905
|
type: HostListener,
|
|
1797
1906
|
args: ['document:keydown.escape', ['$event']]
|
|
1798
1907
|
}] } });
|
|
@@ -2327,43 +2436,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
2327
2436
|
args: [{ selector: 'kf-dropdown-item', imports: [Badge, Icon], template: "<button\n type=\"button\"\n class=\"kf-dropdown-item\"\n [class.kf-dropdown-item--error]=\"tone() === 'error'\"\n [class.kf-dropdown-item--current]=\"current() || checked() === true\"\n [class.kf-dropdown-item--blocked]=\"blocked()\"\n [disabled]=\"disabled()\"\n [attr.aria-disabled]=\"blocked() ? 'true' : null\"\n [attr.aria-current]=\"current() ? 'true' : null\"\n [attr.aria-describedby]=\"blocked() ? reasonId : null\"\n [attr.role]=\"checked() === undefined ? 'menuitem' : 'menuitemradio'\"\n [attr.aria-checked]=\"checked() === undefined ? null : checked()\"\n (click)=\"onClick($event)\"\n>\n <ng-content select=\"[kf-dropdown-item-leading]\" />\n @if (icon()) {\n <kf-icon [name]=\"icon()!\" size=\"sm\" />\n }\n <span class=\"kf-dropdown-item__label\">\n <ng-content />\n @if (description()) {\n <span class=\"kf-dropdown-item__description\">{{ description() }}</span>\n }\n @if (disabledReason()) {\n <!-- Fuera del nombre accesible: se anuncia como descripci\u00F3n, no dos veces. -->\n <span class=\"kf-dropdown-item__reason\" [id]=\"reasonId\" aria-hidden=\"true\">{{\n disabledReason()\n }}</span>\n }\n </span>\n @if (badge()) {\n <kf-badge class=\"kf-dropdown-item__badge\" [tone]=\"badgeTone()\">{{ badge() }}</kf-badge>\n }\n</button>\n", styles: [":host{display:block}.kf-dropdown-item{display:flex;align-items:center;gap:var(--kf-space-sm);width:100%;min-height:var(--kf-control-min-height, auto);padding:var(--kf-space-sm) var(--kf-space-md);border:none;background:transparent;font:inherit;text-align:left;color:var(--kf-color-text);cursor:pointer}.kf-dropdown-item kf-icon{flex:none;color:var(--kf-color-text-muted)}.kf-dropdown-item__label{flex:1 1 auto}.kf-dropdown-item:hover{background:var(--kf-color-surface)}.kf-dropdown-item:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus-inset)}.kf-dropdown-item:disabled{opacity:.55;cursor:not-allowed;pointer-events:none}.kf-dropdown-item--error{color:var(--kf-color-error-strong)}.kf-dropdown-item--error kf-icon{color:var(--kf-color-error-strong)}.kf-dropdown-item--error:hover{background:var(--kf-color-error-soft)}.kf-dropdown-item__description,.kf-dropdown-item__reason{display:block;font-size:var(--kf-font-size-caption);font-weight:400;color:var(--kf-color-text-muted)}.kf-dropdown-item__badge{flex:none}.kf-dropdown-item--current{background:var(--kf-color-primary-soft);font-weight:600}.kf-dropdown-item--current:hover{background:var(--kf-color-primary-soft)}.kf-dropdown-item--blocked{cursor:not-allowed}.kf-dropdown-item--blocked .kf-dropdown-item__label{opacity:.7}.kf-dropdown-item--blocked:hover{background:transparent}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item{color:#ffffffd9}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item kf-icon{color:#ffffff8c}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item:hover{background:#ffffff14}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item--error{color:var(--kf-color-error)}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item--error kf-icon{color:var(--kf-color-error)}:host-context(.kf-dropdown-panel--dark) .kf-dropdown-item--error:hover{background:#bc454529}\n"] }]
|
|
2328
2437
|
}], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], disabledReason: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledReason", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeTone: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeTone", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }] } });
|
|
2329
2438
|
|
|
2330
|
-
/**
|
|
2331
|
-
* Monta una plantilla (típicamente un `kf-drawer side="bottom"`) en el contenedor
|
|
2332
|
-
* de overlays de CDK, fuera del DOM del componente que la declara. Un
|
|
2333
|
-
* `position: fixed` dentro de un ancestro con `container-type`, `transform` o
|
|
2334
|
-
* `contain` se mide contra ese ancestro y no contra la ventana; en el contenedor
|
|
2335
|
-
* de overlays no.
|
|
2336
|
-
*
|
|
2337
|
-
* La plantilla se monta una sola vez, la primera vez que se pide (`mount`), y
|
|
2338
|
-
* queda montada hasta que el componente se destruye. `afterMount` corre tras el
|
|
2339
|
-
* siguiente render, cuando la hoja ya existe cerrada: abrirla ahí hace que entre
|
|
2340
|
-
* con su deslizamiento en vez de aparecer ya abierta.
|
|
2341
|
-
*
|
|
2342
|
-
* Debe construirse en un contexto de inyección (campo de un componente).
|
|
2343
|
-
*/
|
|
2344
|
-
class SheetPortal {
|
|
2345
|
-
overlay = inject(Overlay);
|
|
2346
|
-
viewContainerRef = inject(ViewContainerRef);
|
|
2347
|
-
injector = inject(Injector);
|
|
2348
|
-
overlayRef = null;
|
|
2349
|
-
constructor() {
|
|
2350
|
-
inject(DestroyRef).onDestroy(() => this.overlayRef?.dispose());
|
|
2351
|
-
}
|
|
2352
|
-
/** `true` si la plantilla ya estaba montada; si no, la monta y llama `afterMount` más tarde. */
|
|
2353
|
-
mount(template, afterMount) {
|
|
2354
|
-
if (this.overlayRef) {
|
|
2355
|
-
return true;
|
|
2356
|
-
}
|
|
2357
|
-
this.overlayRef = this.overlay.create({
|
|
2358
|
-
positionStrategy: this.overlay.position().global(),
|
|
2359
|
-
scrollStrategy: this.overlay.scrollStrategies.noop(),
|
|
2360
|
-
});
|
|
2361
|
-
this.overlayRef.attach(new TemplatePortal(template, this.viewContainerRef));
|
|
2362
|
-
afterNextRender(afterMount, { injector: this.injector });
|
|
2363
|
-
return false;
|
|
2364
|
-
}
|
|
2365
|
-
}
|
|
2366
|
-
|
|
2367
2439
|
const COMPACT_QUERY$1 = '(max-width: 639.98px)';
|
|
2368
2440
|
/**
|
|
2369
2441
|
* Botón «Acciones ▾» que abre un menú agrupado: panel flotante de 19rem con
|
|
@@ -2488,7 +2560,7 @@ class ActionMenu {
|
|
|
2488
2560
|
}
|
|
2489
2561
|
}
|
|
2490
2562
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ActionMenu, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2491
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: ActionMenu, isStandalone: true, selector: "kf-action-menu", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, sheetTitle: { classPropertyName: "sheetTitle", publicName: "sheetTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, viewQueries: [{ propertyName: "sheetTemplate", first: true, predicate: ["sheetTemplate"], descendants: true, isSignal: true }, { propertyName: "sheetBody", first: true, predicate: ["sheetBody"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #itemTemplate let-item>\n <kf-dropdown-item\n [icon]=\"item.icon\"\n [tone]=\"item.tone ?? 'neutral'\"\n [disabled]=\"item.disabled ?? false\"\n [description]=\"item.description\"\n [disabledReason]=\"item.disabledReason\"\n [badge]=\"item.badge\"\n [badgeTone]=\"item.badgeTone ?? 'neutral'\"\n [current]=\"item.current ?? false\"\n (click)=\"select(item)\"\n >\n {{ item.label }}\n </kf-dropdown-item>\n</ng-template>\n\n<ng-template #entriesTemplate>\n @for (entry of items(); track $index) {\n @if (asGroup(entry); as group) {\n <kf-dropdown-group [label]=\"group.group\">\n @for (item of group.items; track item.id) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n }\n </kf-dropdown-group>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: asItem(entry) }\"\n />\n }\n }\n</ng-template>\n\n<kf-dropdown [(open)]=\"menuOpen\">\n <kf-button\n class=\"kf-action-menu__trigger\"\n [variant]=\"variant()\"\n [size]=\"size()\"\n [shape]=\"iconOnly() ? 'circle' : 'rect'\"\n [icon]=\"iconOnly() ? (icon() ?? 'more-vertical') : icon()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"iconOnly() ? label() : undefined\"\n [ariaHaspopup]=\"asSheet() ? 'dialog' : 'menu'\"\n [ariaExpanded]=\"expanded()\"\n (click)=\"toggle()\"\n >\n @if (!iconOnly()) {\n {{ label() }}\n <kf-icon name=\"chevron-down\" size=\"sm\" [rotate]=\"expanded() ? 180 : 0\" />\n }\n </kf-button>\n <kf-dropdown-panel width=\"19rem\" [ariaLabel]=\"label()\">\n <ng-container [ngTemplateOutlet]=\"entriesTemplate\" />\n </kf-dropdown-panel>\n</kf-dropdown>\n\n<ng-template #sheetTemplate>\n <kf-drawer side=\"bottom\" role=\"dialog\" [title]=\"sheetTitle() || label()\" [(open)]=\"sheetOpen\">\n <div\n #sheetBody\n class=\"kf-action-menu__sheet\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"label()\"\n (keydown)=\"onSheetKeydown($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"entriesTemplate\" />\n </div>\n </kf-drawer>\n</ng-template>\n", styles: [":host{display:inline-flex}.kf-action-menu__sheet{--kf-control-min-height: 3rem;display:flex;flex-direction:column;outline:none}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack"], outputs: ["openChange"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownGroup, selector: "kf-dropdown-group", inputs: ["label"] }, { kind: "component", type: DropdownItem, selector: "kf-dropdown-item", inputs: ["tone", "icon", "disabled", "description", "disabledReason", "badge", "badgeTone", "current", "checked"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "maxHeight", "width", "ariaLabel"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2563
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: ActionMenu, isStandalone: true, selector: "kf-action-menu", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, sheetTitle: { classPropertyName: "sheetTitle", publicName: "sheetTitle", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemSelect: "itemSelect" }, viewQueries: [{ propertyName: "sheetTemplate", first: true, predicate: ["sheetTemplate"], descendants: true, isSignal: true }, { propertyName: "sheetBody", first: true, predicate: ["sheetBody"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #itemTemplate let-item>\n <kf-dropdown-item\n [icon]=\"item.icon\"\n [tone]=\"item.tone ?? 'neutral'\"\n [disabled]=\"item.disabled ?? false\"\n [description]=\"item.description\"\n [disabledReason]=\"item.disabledReason\"\n [badge]=\"item.badge\"\n [badgeTone]=\"item.badgeTone ?? 'neutral'\"\n [current]=\"item.current ?? false\"\n (click)=\"select(item)\"\n >\n {{ item.label }}\n </kf-dropdown-item>\n</ng-template>\n\n<ng-template #entriesTemplate>\n @for (entry of items(); track $index) {\n @if (asGroup(entry); as group) {\n <kf-dropdown-group [label]=\"group.group\">\n @for (item of group.items; track item.id) {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: item }\"\n />\n }\n </kf-dropdown-group>\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: asItem(entry) }\"\n />\n }\n }\n</ng-template>\n\n<kf-dropdown [(open)]=\"menuOpen\">\n <kf-button\n class=\"kf-action-menu__trigger\"\n [variant]=\"variant()\"\n [size]=\"size()\"\n [shape]=\"iconOnly() ? 'circle' : 'rect'\"\n [icon]=\"iconOnly() ? (icon() ?? 'more-vertical') : icon()\"\n [disabled]=\"disabled()\"\n [ariaLabel]=\"iconOnly() ? label() : undefined\"\n [ariaHaspopup]=\"asSheet() ? 'dialog' : 'menu'\"\n [ariaExpanded]=\"expanded()\"\n (click)=\"toggle()\"\n >\n @if (!iconOnly()) {\n {{ label() }}\n <kf-icon name=\"chevron-down\" size=\"sm\" [rotate]=\"expanded() ? 180 : 0\" />\n }\n </kf-button>\n <kf-dropdown-panel width=\"19rem\" [ariaLabel]=\"label()\">\n <ng-container [ngTemplateOutlet]=\"entriesTemplate\" />\n </kf-dropdown-panel>\n</kf-dropdown>\n\n<ng-template #sheetTemplate>\n <kf-drawer side=\"bottom\" role=\"dialog\" [title]=\"sheetTitle() || label()\" [(open)]=\"sheetOpen\">\n <div\n #sheetBody\n class=\"kf-action-menu__sheet\"\n role=\"menu\"\n tabindex=\"-1\"\n [attr.aria-label]=\"label()\"\n (keydown)=\"onSheetKeydown($event)\"\n >\n <ng-container [ngTemplateOutlet]=\"entriesTemplate\" />\n </div>\n </kf-drawer>\n</ng-template>\n", styles: [":host{display:inline-flex}.kf-action-menu__sheet{--kf-control-min-height: 3rem;display:flex;flex-direction:column;outline:none}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack", "mountInOverlay"], outputs: ["openChange"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownGroup, selector: "kf-dropdown-group", inputs: ["label"] }, { kind: "component", type: DropdownItem, selector: "kf-dropdown-item", inputs: ["tone", "icon", "disabled", "description", "disabledReason", "badge", "badgeTone", "current", "checked"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "maxHeight", "width", "ariaLabel"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2492
2564
|
}
|
|
2493
2565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ActionMenu, decorators: [{
|
|
2494
2566
|
type: Component,
|
|
@@ -2631,6 +2703,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
2631
2703
|
* Accesibilidad: mientras está abierto, el elemento que recibe el foco
|
|
2632
2704
|
* referencia el panel con `aria-describedby` (se conserva cualquier valor
|
|
2633
2705
|
* previo).
|
|
2706
|
+
*
|
|
2707
|
+
* Apertura por clic (`kfPopoverTrigger="click"`): el popover se abre y se
|
|
2708
|
+
* cierra con un clic o toque sobre el anfitrión (Enter y Espacio sobre un
|
|
2709
|
+
* `<button>` ya generan ese clic) y no responde al puntero ni al foco. Se
|
|
2710
|
+
* cierra con Escape, con un `pointerdown` fuera del anfitrión y del panel, al
|
|
2711
|
+
* volver a pulsar el anfitrión y cuando el foco pasa a un elemento fuera de
|
|
2712
|
+
* ambos (por ejemplo, Tab desde el último control del panel, que además deja el
|
|
2713
|
+
* foco en el anfitrión para que Tab continúe con el siguiente elemento). Con
|
|
2714
|
+
* scroll y redimensionado el panel se reposiciona en vez de cerrarse. Con
|
|
2715
|
+
* `kfPopoverInteractive`, al abrir el foco pasa al primer control del panel y
|
|
2716
|
+
* al cerrar con Escape (o con `close()`) vuelve al anfitrión, solo si estaba
|
|
2717
|
+
* dentro del panel. El panel es un `dialog` no modal: ponle nombre con
|
|
2718
|
+
* `kfPopoverLabel`.
|
|
2719
|
+
*
|
|
2720
|
+
* <button [kfPopover]="detail" kfPopoverTrigger="click" kfPopoverInteractive
|
|
2721
|
+
* kfPopoverLabel="Detalle del total">Ver detalle</button>
|
|
2722
|
+
*
|
|
2723
|
+
* En modo `click` la directiva mantiene `aria-expanded` y `aria-controls` (id
|
|
2724
|
+
* del panel) y, con `kfPopoverInteractive`, `aria-haspopup="dialog"` en el
|
|
2725
|
+
* control real: el propio anfitrión si es enfocable o, si no, su primer
|
|
2726
|
+
* descendiente enfocable. Por eso funciona directamente sobre un componente que
|
|
2727
|
+
* envuelve un `<button>`, como `kf-stat-card` con `clickable`. Si el
|
|
2728
|
+
* anfitrión se desactiva (`kfPopoverDisabled`), la directiva retira esos
|
|
2729
|
+
* atributos para que otra vía de apertura (una hoja inferior en móvil) los
|
|
2730
|
+
* gobierne. No agrega `aria-describedby`.
|
|
2731
|
+
*
|
|
2732
|
+
* Control externo: `kfPopoverOpen` (con `kfPopoverOpenChange`, o
|
|
2733
|
+
* `[(kfPopoverOpen)]`) abre y cierra el panel desde el consumidor en cualquier
|
|
2734
|
+
* modo. Cuando el consumidor lo abre desde el código y el panel es interactivo,
|
|
2735
|
+
* el foco también pasa al panel.
|
|
2634
2736
|
*/
|
|
2635
2737
|
class PopoverDirective {
|
|
2636
2738
|
/** Contenido del popover (un `ng-template`). `null`/`undefined` = no se abre. */
|
|
@@ -2655,8 +2757,15 @@ class PopoverDirective {
|
|
|
2655
2757
|
* `false` el anfitrión ya trae su propia descripción permanente con el mismo texto.
|
|
2656
2758
|
*/
|
|
2657
2759
|
kfPopoverDescribe = input(true, { ...(ngDevMode ? { debugName: "kfPopoverDescribe" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
2658
|
-
/**
|
|
2659
|
-
|
|
2760
|
+
/** Disparador: `'hover'` (default, puntero y foco de teclado) o `'click'` (clic o toque). */
|
|
2761
|
+
kfPopoverTrigger = input('hover', /* @ts-ignore */
|
|
2762
|
+
...(ngDevMode ? [{ debugName: "kfPopoverTrigger" }] : /* istanbul ignore next */ []));
|
|
2763
|
+
/**
|
|
2764
|
+
* Estado abierto/cerrado. Léelo con `[(kfPopoverOpen)]` o `(kfPopoverOpenChange)`
|
|
2765
|
+
* (emite `true` al abrirse y `false` al cerrarse); escribirlo abre o cierra el panel.
|
|
2766
|
+
*/
|
|
2767
|
+
kfPopoverOpen = model(false, /* @ts-ignore */
|
|
2768
|
+
...(ngDevMode ? [{ debugName: "kfPopoverOpen" }] : /* istanbul ignore next */ []));
|
|
2660
2769
|
host = inject(ElementRef);
|
|
2661
2770
|
overlayService = inject(Overlay);
|
|
2662
2771
|
viewContainerRef = inject(ViewContainerRef);
|
|
@@ -2681,6 +2790,11 @@ class PopoverDirective {
|
|
|
2681
2790
|
openedAt = 0;
|
|
2682
2791
|
teardownGlobalListeners = null;
|
|
2683
2792
|
destroyed = false;
|
|
2793
|
+
/** `true` tras el primer render: antes no hay anfitrión resuelto ni DOM que medir. */
|
|
2794
|
+
ready = false;
|
|
2795
|
+
/** Elemento en el que se escribieron los atributos ARIA del modo `click`. */
|
|
2796
|
+
ariaElement = null;
|
|
2797
|
+
ariaHaspopupWritten = false;
|
|
2684
2798
|
pointerOnHost = false;
|
|
2685
2799
|
pointerOnPanel = false;
|
|
2686
2800
|
focusOnHost = false;
|
|
@@ -2693,6 +2807,42 @@ class PopoverDirective {
|
|
|
2693
2807
|
untracked(() => this.close());
|
|
2694
2808
|
}
|
|
2695
2809
|
});
|
|
2810
|
+
// Cambiar de disparador con el panel abierto lo cierra: el estado de puntero
|
|
2811
|
+
// y foco del modo anterior no aplica al nuevo.
|
|
2812
|
+
effect(() => {
|
|
2813
|
+
this.kfPopoverTrigger();
|
|
2814
|
+
untracked(() => {
|
|
2815
|
+
if (this.overlayRef) {
|
|
2816
|
+
this.close();
|
|
2817
|
+
}
|
|
2818
|
+
});
|
|
2819
|
+
});
|
|
2820
|
+
effect(() => {
|
|
2821
|
+
this.kfPopoverTrigger();
|
|
2822
|
+
this.kfPopoverDisabled();
|
|
2823
|
+
this.kfPopoverInteractive();
|
|
2824
|
+
this.openState();
|
|
2825
|
+
untracked(() => this.syncAria());
|
|
2826
|
+
});
|
|
2827
|
+
// Control externo: `kfPopoverOpen` abre o cierra el panel.
|
|
2828
|
+
effect(() => {
|
|
2829
|
+
const wanted = this.kfPopoverOpen();
|
|
2830
|
+
untracked(() => {
|
|
2831
|
+
if (!this.ready) {
|
|
2832
|
+
return;
|
|
2833
|
+
}
|
|
2834
|
+
if (wanted && !this.overlayRef) {
|
|
2835
|
+
this.open();
|
|
2836
|
+
if (!this.overlayRef) {
|
|
2837
|
+
// No pudo abrirse (sin plantilla o desactivado): se informa al consumidor.
|
|
2838
|
+
this.kfPopoverOpen.set(false);
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
else if (!wanted && this.overlayRef) {
|
|
2842
|
+
this.closeNow();
|
|
2843
|
+
}
|
|
2844
|
+
});
|
|
2845
|
+
});
|
|
2696
2846
|
// El elemento que recibe los eventos se resuelve tras el primer render: en
|
|
2697
2847
|
// una vista embebida (ej. dentro de la celda de un `kf-data-table`) el
|
|
2698
2848
|
// anfitrión aún no tiene a su ancestro interactivo en el DOM al construirse.
|
|
@@ -2708,6 +2858,7 @@ class PopoverDirective {
|
|
|
2708
2858
|
['focusin', this.onHostFocusIn],
|
|
2709
2859
|
['focusout', this.onHostFocusOut],
|
|
2710
2860
|
['keydown', this.onHostKeydown],
|
|
2861
|
+
['click', this.onHostClick],
|
|
2711
2862
|
];
|
|
2712
2863
|
for (const [type, listener] of listeners) {
|
|
2713
2864
|
target.addEventListener(type, listener);
|
|
@@ -2717,6 +2868,14 @@ class PopoverDirective {
|
|
|
2717
2868
|
target.removeEventListener(type, listener);
|
|
2718
2869
|
}
|
|
2719
2870
|
});
|
|
2871
|
+
this.ready = true;
|
|
2872
|
+
this.syncAria();
|
|
2873
|
+
if (this.kfPopoverOpen()) {
|
|
2874
|
+
this.open();
|
|
2875
|
+
if (!this.overlayRef) {
|
|
2876
|
+
this.kfPopoverOpen.set(false);
|
|
2877
|
+
}
|
|
2878
|
+
}
|
|
2720
2879
|
});
|
|
2721
2880
|
}
|
|
2722
2881
|
ngOnDestroy() {
|
|
@@ -2724,20 +2883,47 @@ class PopoverDirective {
|
|
|
2724
2883
|
this.clearTimers();
|
|
2725
2884
|
this.dispose();
|
|
2726
2885
|
}
|
|
2727
|
-
/**
|
|
2886
|
+
/**
|
|
2887
|
+
* Cierra el panel de inmediato, sin retardo. En modo `click`, si el foco
|
|
2888
|
+
* estaba dentro del panel, vuelve al anfitrión.
|
|
2889
|
+
*/
|
|
2728
2890
|
close() {
|
|
2891
|
+
const restoreFocus = this.isClick && this.focusIsInPanel();
|
|
2892
|
+
this.closeNow();
|
|
2893
|
+
if (restoreFocus) {
|
|
2894
|
+
this.focusHost();
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
get isClick() {
|
|
2898
|
+
return this.kfPopoverTrigger() === 'click';
|
|
2899
|
+
}
|
|
2900
|
+
closeNow() {
|
|
2729
2901
|
this.clearTimers();
|
|
2730
2902
|
this.dispose();
|
|
2731
2903
|
}
|
|
2904
|
+
focusIsInPanel() {
|
|
2905
|
+
return this.panelElement?.contains(this.document.activeElement) ?? false;
|
|
2906
|
+
}
|
|
2907
|
+
onHostClick = () => {
|
|
2908
|
+
if (!this.isClick || this.kfPopoverDisabled()) {
|
|
2909
|
+
return;
|
|
2910
|
+
}
|
|
2911
|
+
if (this.overlayRef) {
|
|
2912
|
+
this.close();
|
|
2913
|
+
}
|
|
2914
|
+
else {
|
|
2915
|
+
this.open();
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2732
2918
|
onHostPointerEnter = (event) => {
|
|
2733
|
-
if (event.pointerType === 'touch') {
|
|
2919
|
+
if (this.isClick || event.pointerType === 'touch') {
|
|
2734
2920
|
return;
|
|
2735
2921
|
}
|
|
2736
2922
|
this.pointerOnHost = true;
|
|
2737
2923
|
this.reevaluate(this.kfPopoverShowDelay());
|
|
2738
2924
|
};
|
|
2739
2925
|
onHostPointerLeave = (event) => {
|
|
2740
|
-
if (event.pointerType === 'touch') {
|
|
2926
|
+
if (this.isClick || event.pointerType === 'touch') {
|
|
2741
2927
|
return;
|
|
2742
2928
|
}
|
|
2743
2929
|
this.pointerOnHost = false;
|
|
@@ -2746,7 +2932,7 @@ class PopoverDirective {
|
|
|
2746
2932
|
onHostFocusIn = (event) => {
|
|
2747
2933
|
// Solo foco de teclado: un clic o un toque enfocan el botón pero no
|
|
2748
2934
|
// deben abrir el panel (el clic tiene su propia acción).
|
|
2749
|
-
if (!this.isKeyboardFocus(event.target)) {
|
|
2935
|
+
if (this.isClick || !this.isKeyboardFocus(event.target)) {
|
|
2750
2936
|
return;
|
|
2751
2937
|
}
|
|
2752
2938
|
this.focusOnHost = true;
|
|
@@ -2757,6 +2943,13 @@ class PopoverDirective {
|
|
|
2757
2943
|
if (next && this.trigger.contains(next)) {
|
|
2758
2944
|
return;
|
|
2759
2945
|
}
|
|
2946
|
+
if (this.isClick) {
|
|
2947
|
+
// El foco pasa al panel o a otro elemento: solo en el segundo caso se cierra.
|
|
2948
|
+
if (next && this.overlayRef && !this.panelElement?.contains(next)) {
|
|
2949
|
+
this.closeNow();
|
|
2950
|
+
}
|
|
2951
|
+
return;
|
|
2952
|
+
}
|
|
2760
2953
|
this.focusOnHost = false;
|
|
2761
2954
|
if (next && this.kfPopoverInteractive() && this.panelElement?.contains(next)) {
|
|
2762
2955
|
// El foco pasa al panel: su propio `focusin` lo registra.
|
|
@@ -2789,6 +2982,9 @@ class PopoverDirective {
|
|
|
2789
2982
|
}
|
|
2790
2983
|
/** Abre o cierra según los cuatro orígenes (puntero/foco × anfitrión/panel). */
|
|
2791
2984
|
reevaluate(delay) {
|
|
2985
|
+
if (this.isClick) {
|
|
2986
|
+
return;
|
|
2987
|
+
}
|
|
2792
2988
|
if (this.wanted) {
|
|
2793
2989
|
this.clearHideTimer();
|
|
2794
2990
|
if (!this.dismissed) {
|
|
@@ -2877,7 +3073,10 @@ class PopoverDirective {
|
|
|
2877
3073
|
this.listenGlobal();
|
|
2878
3074
|
this.openedAt = Date.now();
|
|
2879
3075
|
this.openState.set(true);
|
|
2880
|
-
this.
|
|
3076
|
+
this.kfPopoverOpen.set(true);
|
|
3077
|
+
if (this.isClick && this.kfPopoverInteractive()) {
|
|
3078
|
+
this.focusFirstInPanel();
|
|
3079
|
+
}
|
|
2881
3080
|
}
|
|
2882
3081
|
dispose() {
|
|
2883
3082
|
const overlayRef = this.overlayRef;
|
|
@@ -2896,7 +3095,7 @@ class PopoverDirective {
|
|
|
2896
3095
|
this.removeDescribedBy();
|
|
2897
3096
|
if (wasOpen && !this.destroyed) {
|
|
2898
3097
|
this.openState.set(false);
|
|
2899
|
-
this.
|
|
3098
|
+
this.kfPopoverOpen.set(false);
|
|
2900
3099
|
}
|
|
2901
3100
|
}
|
|
2902
3101
|
onPanelFocusOut(event) {
|
|
@@ -2909,25 +3108,96 @@ class PopoverDirective {
|
|
|
2909
3108
|
if (next && (this.panelElement?.contains(next) || this.trigger.contains(next))) {
|
|
2910
3109
|
return;
|
|
2911
3110
|
}
|
|
3111
|
+
if (this.isClick) {
|
|
3112
|
+
// Sin destino (`null`) el foco no salió a otro elemento: lo cierran Escape o `pointerdown`.
|
|
3113
|
+
if (next) {
|
|
3114
|
+
this.closeNow();
|
|
3115
|
+
}
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
2912
3118
|
this.reevaluate(0);
|
|
2913
3119
|
}
|
|
2914
|
-
/**
|
|
3120
|
+
/**
|
|
3121
|
+
* Mayús+Tab desde el primer control del panel devuelve el foco al anfitrión.
|
|
3122
|
+
* En modo `click`, Tab desde el último control cierra el panel y deja el foco
|
|
3123
|
+
* en el anfitrión, de modo que Tab continúa con el elemento siguiente a él.
|
|
3124
|
+
*/
|
|
2915
3125
|
onPanelKeydown = (event) => {
|
|
2916
|
-
if (event.key !== 'Tab' || !
|
|
3126
|
+
if (event.key !== 'Tab' || !this.panelElement) {
|
|
2917
3127
|
return;
|
|
2918
3128
|
}
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
3129
|
+
if (event.shiftKey) {
|
|
3130
|
+
const first = this.panelElement.querySelector(FOCUSABLE_SELECTOR);
|
|
3131
|
+
if (first && this.document.activeElement === first) {
|
|
3132
|
+
event.preventDefault();
|
|
3133
|
+
this.focusHost();
|
|
3134
|
+
}
|
|
3135
|
+
return;
|
|
3136
|
+
}
|
|
3137
|
+
if (!this.isClick) {
|
|
3138
|
+
return;
|
|
3139
|
+
}
|
|
3140
|
+
const focusable = this.panelElement.querySelectorAll(FOCUSABLE_SELECTOR);
|
|
3141
|
+
if (focusable.length > 0 && this.document.activeElement === focusable[focusable.length - 1]) {
|
|
3142
|
+
this.closeNow();
|
|
2922
3143
|
this.focusHost();
|
|
2923
3144
|
}
|
|
2924
3145
|
};
|
|
2925
|
-
|
|
3146
|
+
/** Control real del anfitrión: él mismo si es enfocable o su primer descendiente enfocable. */
|
|
3147
|
+
controlElement() {
|
|
2926
3148
|
const host = this.trigger;
|
|
2927
|
-
|
|
3149
|
+
return host.matches(FOCUSABLE_SELECTOR)
|
|
2928
3150
|
? host
|
|
2929
3151
|
: host.querySelector(FOCUSABLE_SELECTOR);
|
|
2930
|
-
|
|
3152
|
+
}
|
|
3153
|
+
focusHost() {
|
|
3154
|
+
this.controlElement()?.focus({ preventScroll: true });
|
|
3155
|
+
}
|
|
3156
|
+
focusFirstInPanel() {
|
|
3157
|
+
this.panelElement?.querySelector(FOCUSABLE_SELECTOR)?.focus({
|
|
3158
|
+
preventScroll: true,
|
|
3159
|
+
});
|
|
3160
|
+
}
|
|
3161
|
+
/**
|
|
3162
|
+
* Mantiene `aria-expanded`, `aria-controls` y (si el panel es interactivo)
|
|
3163
|
+
* `aria-haspopup` en el control real mientras el modo es `click` y la
|
|
3164
|
+
* directiva está activa; los retira en cualquier otro caso. Un
|
|
3165
|
+
* `aria-haspopup` que ya traía el control se respeta y no se toca.
|
|
3166
|
+
*/
|
|
3167
|
+
syncAria() {
|
|
3168
|
+
if (!this.ready) {
|
|
3169
|
+
return;
|
|
3170
|
+
}
|
|
3171
|
+
const active = this.isClick && !this.kfPopoverDisabled();
|
|
3172
|
+
const target = active ? this.controlElement() : null;
|
|
3173
|
+
if (this.ariaElement && this.ariaElement !== target) {
|
|
3174
|
+
this.clearAria(this.ariaElement);
|
|
3175
|
+
}
|
|
3176
|
+
if (!target) {
|
|
3177
|
+
return;
|
|
3178
|
+
}
|
|
3179
|
+
target.setAttribute('aria-expanded', String(this.openState()));
|
|
3180
|
+
target.setAttribute('aria-controls', this.panelId);
|
|
3181
|
+
if (this.kfPopoverInteractive()) {
|
|
3182
|
+
if (!target.hasAttribute('aria-haspopup')) {
|
|
3183
|
+
target.setAttribute('aria-haspopup', 'dialog');
|
|
3184
|
+
this.ariaHaspopupWritten = true;
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
else if (this.ariaHaspopupWritten) {
|
|
3188
|
+
target.removeAttribute('aria-haspopup');
|
|
3189
|
+
this.ariaHaspopupWritten = false;
|
|
3190
|
+
}
|
|
3191
|
+
this.ariaElement = target;
|
|
3192
|
+
}
|
|
3193
|
+
clearAria(element) {
|
|
3194
|
+
element.removeAttribute('aria-expanded');
|
|
3195
|
+
element.removeAttribute('aria-controls');
|
|
3196
|
+
if (this.ariaHaspopupWritten) {
|
|
3197
|
+
element.removeAttribute('aria-haspopup');
|
|
3198
|
+
this.ariaHaspopupWritten = false;
|
|
3199
|
+
}
|
|
3200
|
+
this.ariaElement = null;
|
|
2931
3201
|
}
|
|
2932
3202
|
/**
|
|
2933
3203
|
* Escape, scroll y resize mientras el panel está abierto. En fase de captura
|
|
@@ -2942,30 +3212,58 @@ class PopoverDirective {
|
|
|
2942
3212
|
return;
|
|
2943
3213
|
}
|
|
2944
3214
|
event.stopPropagation();
|
|
2945
|
-
const focusInPanel = this.
|
|
3215
|
+
const focusInPanel = this.focusIsInPanel();
|
|
2946
3216
|
this.dismissed = true;
|
|
2947
|
-
this.
|
|
3217
|
+
this.closeNow();
|
|
2948
3218
|
if (focusInPanel) {
|
|
2949
3219
|
this.focusHost();
|
|
2950
3220
|
}
|
|
2951
3221
|
};
|
|
2952
3222
|
const onScroll = (event) => {
|
|
2953
3223
|
const target = event.target;
|
|
3224
|
+
if (target && this.panelElement?.contains(target)) {
|
|
3225
|
+
return;
|
|
3226
|
+
}
|
|
3227
|
+
if (this.isClick) {
|
|
3228
|
+
// El panel acompaña al anfitrión en vez de cerrarse.
|
|
3229
|
+
this.overlayRef?.updatePosition();
|
|
3230
|
+
return;
|
|
3231
|
+
}
|
|
2954
3232
|
if (Date.now() - this.openedAt < SCROLL_GRACE_MS) {
|
|
2955
3233
|
return;
|
|
2956
3234
|
}
|
|
2957
|
-
|
|
3235
|
+
this.closeNow();
|
|
3236
|
+
};
|
|
3237
|
+
const onResize = () => {
|
|
3238
|
+
if (this.isClick) {
|
|
3239
|
+
this.overlayRef?.updatePosition();
|
|
3240
|
+
}
|
|
3241
|
+
else {
|
|
3242
|
+
this.closeNow();
|
|
3243
|
+
}
|
|
3244
|
+
};
|
|
3245
|
+
// Solo en modo `click`: un `pointerdown` fuera del anfitrión y del panel lo cierra.
|
|
3246
|
+
const onPointerDown = (event) => {
|
|
3247
|
+
if (!this.isClick) {
|
|
2958
3248
|
return;
|
|
2959
3249
|
}
|
|
2960
|
-
|
|
3250
|
+
const target = event.target;
|
|
3251
|
+
if (!target ||
|
|
3252
|
+
this.panelElement?.contains(target) ||
|
|
3253
|
+
this.trigger.contains(target) ||
|
|
3254
|
+
this.host.nativeElement.contains(target)) {
|
|
3255
|
+
return;
|
|
3256
|
+
}
|
|
3257
|
+
this.closeNow();
|
|
2961
3258
|
};
|
|
2962
|
-
const onResize = () => this.close();
|
|
2963
3259
|
this.document.addEventListener('keydown', onKeydown, true);
|
|
2964
3260
|
this.document.addEventListener('scroll', onScroll, true);
|
|
3261
|
+
this.document.addEventListener('pointerdown', onPointerDown, true);
|
|
2965
3262
|
view?.addEventListener('resize', onResize);
|
|
2966
3263
|
this.teardownGlobalListeners = () => {
|
|
2967
3264
|
this.document.removeEventListener('keydown', onKeydown, true);
|
|
2968
3265
|
this.document.removeEventListener('scroll', onScroll, true);
|
|
3266
|
+
this.document.removeEventListener('pointerdown', onPointerDown, true);
|
|
2969
3267
|
view?.removeEventListener('resize', onResize);
|
|
2970
3268
|
};
|
|
2971
3269
|
}
|
|
@@ -2986,7 +3284,7 @@ class PopoverDirective {
|
|
|
2986
3284
|
}
|
|
2987
3285
|
}
|
|
2988
3286
|
addDescribedBy() {
|
|
2989
|
-
if (!this.kfPopoverDescribe()) {
|
|
3287
|
+
if (!this.kfPopoverDescribe() || this.isClick) {
|
|
2990
3288
|
return;
|
|
2991
3289
|
}
|
|
2992
3290
|
const tokens = this.describedByTokens();
|
|
@@ -3063,7 +3361,7 @@ class PopoverDirective {
|
|
|
3063
3361
|
};
|
|
3064
3362
|
}
|
|
3065
3363
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: PopoverDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3066
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: PopoverDirective, isStandalone: true, selector: "[kfPopover]", inputs: { kfPopover: { classPropertyName: "kfPopover", publicName: "kfPopover", isSignal: true, isRequired: true, transformFunction: null }, kfPopoverPlacement: { classPropertyName: "kfPopoverPlacement", publicName: "kfPopoverPlacement", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverShowDelay: { classPropertyName: "kfPopoverShowDelay", publicName: "kfPopoverShowDelay", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverHideDelay: { classPropertyName: "kfPopoverHideDelay", publicName: "kfPopoverHideDelay", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverDisabled: { classPropertyName: "kfPopoverDisabled", publicName: "kfPopoverDisabled", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverInteractive: { classPropertyName: "kfPopoverInteractive", publicName: "kfPopoverInteractive", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverLabel: { classPropertyName: "kfPopoverLabel", publicName: "kfPopoverLabel", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverDescribe: { classPropertyName: "kfPopoverDescribe", publicName: "kfPopoverDescribe", isSignal: true, isRequired: false, transformFunction: null } }, outputs: {
|
|
3364
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.0", type: PopoverDirective, isStandalone: true, selector: "[kfPopover]", inputs: { kfPopover: { classPropertyName: "kfPopover", publicName: "kfPopover", isSignal: true, isRequired: true, transformFunction: null }, kfPopoverPlacement: { classPropertyName: "kfPopoverPlacement", publicName: "kfPopoverPlacement", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverShowDelay: { classPropertyName: "kfPopoverShowDelay", publicName: "kfPopoverShowDelay", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverHideDelay: { classPropertyName: "kfPopoverHideDelay", publicName: "kfPopoverHideDelay", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverDisabled: { classPropertyName: "kfPopoverDisabled", publicName: "kfPopoverDisabled", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverInteractive: { classPropertyName: "kfPopoverInteractive", publicName: "kfPopoverInteractive", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverLabel: { classPropertyName: "kfPopoverLabel", publicName: "kfPopoverLabel", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverDescribe: { classPropertyName: "kfPopoverDescribe", publicName: "kfPopoverDescribe", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverTrigger: { classPropertyName: "kfPopoverTrigger", publicName: "kfPopoverTrigger", isSignal: true, isRequired: false, transformFunction: null }, kfPopoverOpen: { classPropertyName: "kfPopoverOpen", publicName: "kfPopoverOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { kfPopoverOpen: "kfPopoverOpenChange" }, exportAs: ["kfPopover"], ngImport: i0 });
|
|
3067
3365
|
}
|
|
3068
3366
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: PopoverDirective, decorators: [{
|
|
3069
3367
|
type: Directive,
|
|
@@ -3071,7 +3369,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
3071
3369
|
selector: '[kfPopover]',
|
|
3072
3370
|
exportAs: 'kfPopover',
|
|
3073
3371
|
}]
|
|
3074
|
-
}], ctorParameters: () => [], propDecorators: { kfPopover: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopover", required: true }] }], kfPopoverPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverPlacement", required: false }] }], kfPopoverShowDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverShowDelay", required: false }] }], kfPopoverHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverHideDelay", required: false }] }], kfPopoverDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverDisabled", required: false }] }], kfPopoverInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverInteractive", required: false }] }], kfPopoverLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverLabel", required: false }] }], kfPopoverDescribe: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverDescribe", required: false }] }],
|
|
3372
|
+
}], ctorParameters: () => [], propDecorators: { kfPopover: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopover", required: true }] }], kfPopoverPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverPlacement", required: false }] }], kfPopoverShowDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverShowDelay", required: false }] }], kfPopoverHideDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverHideDelay", required: false }] }], kfPopoverDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverDisabled", required: false }] }], kfPopoverInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverInteractive", required: false }] }], kfPopoverLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverLabel", required: false }] }], kfPopoverDescribe: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverDescribe", required: false }] }], kfPopoverTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverTrigger", required: false }] }], kfPopoverOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "kfPopoverOpen", required: false }] }, { type: i0.Output, args: ["kfPopoverOpenChange"] }] } });
|
|
3075
3373
|
|
|
3076
3374
|
let nextId$5 = 0;
|
|
3077
3375
|
/**
|
|
@@ -3099,7 +3397,7 @@ class AiMark {
|
|
|
3099
3397
|
still = input(false, { ...(ngDevMode ? { debugName: "still" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3100
3398
|
tipId = `kf-ai-mark-tip-${nextId$5++}`;
|
|
3101
3399
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AiMark, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3102
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.0", type: AiMark, isStandalone: true, selector: "kf-ai-mark", inputs: { tip: { classPropertyName: "tip", publicName: "tip", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, still: { classPropertyName: "still", publicName: "still", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"kf-ai-mark\"\n kfPopoverPlacement=\"top\"\n [kfPopover]=\"tipTemplate\"\n [kfPopoverDescribe]=\"false\"\n [attr.aria-label]=\"label()\"\n [attr.aria-describedby]=\"tipId\"\n [attr.tabindex]=\"still() ? -1 : null\"\n>\n <kf-icon class=\"kf-ai-mark__icon\" name=\"sparkle\" size=\"sm\" />\n</button>\n<span class=\"kf-sr-only\" [id]=\"tipId\">{{ tip() }}</span>\n<ng-template #tipTemplate>{{ tip() }}</ng-template>\n", styles: [".kf-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}:host{position:relative;display:inline-flex;flex:none;vertical-align:-3px}.kf-ai-mark{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:24px;margin:-4px;padding:0;border:0;background:transparent;border-radius:var(--kf-radius-pill);color:var(--kf-color-ai);font:inherit;cursor:help}.kf-ai-mark:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-ai-mark__icon{--kf-icon-size: 14px !important}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: PopoverDirective, selector: "[kfPopover]", inputs: ["kfPopover", "kfPopoverPlacement", "kfPopoverShowDelay", "kfPopoverHideDelay", "kfPopoverDisabled", "kfPopoverInteractive", "kfPopoverLabel", "kfPopoverDescribe"], outputs: ["kfPopoverOpenChange"], exportAs: ["kfPopover"] }] });
|
|
3400
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.0", type: AiMark, isStandalone: true, selector: "kf-ai-mark", inputs: { tip: { classPropertyName: "tip", publicName: "tip", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, still: { classPropertyName: "still", publicName: "still", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<button\n type=\"button\"\n class=\"kf-ai-mark\"\n kfPopoverPlacement=\"top\"\n [kfPopover]=\"tipTemplate\"\n [kfPopoverDescribe]=\"false\"\n [attr.aria-label]=\"label()\"\n [attr.aria-describedby]=\"tipId\"\n [attr.tabindex]=\"still() ? -1 : null\"\n>\n <kf-icon class=\"kf-ai-mark__icon\" name=\"sparkle\" size=\"sm\" />\n</button>\n<span class=\"kf-sr-only\" [id]=\"tipId\">{{ tip() }}</span>\n<ng-template #tipTemplate>{{ tip() }}</ng-template>\n", styles: [".kf-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}:host{position:relative;display:inline-flex;flex:none;vertical-align:-3px}.kf-ai-mark{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:24px;height:24px;margin:-4px;padding:0;border:0;background:transparent;border-radius:var(--kf-radius-pill);color:var(--kf-color-ai);font:inherit;cursor:help}.kf-ai-mark:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-ai-mark__icon{--kf-icon-size: 14px !important}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: PopoverDirective, selector: "[kfPopover]", inputs: ["kfPopover", "kfPopoverPlacement", "kfPopoverShowDelay", "kfPopoverHideDelay", "kfPopoverDisabled", "kfPopoverInteractive", "kfPopoverLabel", "kfPopoverDescribe", "kfPopoverTrigger", "kfPopoverOpen"], outputs: ["kfPopoverOpenChange"], exportAs: ["kfPopover"] }] });
|
|
3103
3401
|
}
|
|
3104
3402
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: AiMark, decorators: [{
|
|
3105
3403
|
type: Component,
|
|
@@ -3335,7 +3633,9 @@ const TONE_ICON$1 = {
|
|
|
3335
3633
|
* <kf-alert variant="bar" tone="warn" title="Modo suplantación">Viendo como Ana Pérez.</kf-alert>
|
|
3336
3634
|
*
|
|
3337
3635
|
* Los elementos con el atributo `kfAlertActions` se proyectan bajo el mensaje, en
|
|
3338
|
-
* una fila propia apilados y alineados al inicio.
|
|
3636
|
+
* una fila propia apilados y alineados al inicio. En `variant="bar"`, `actionsInline`
|
|
3637
|
+
* los deja en la MISMA fila que el mensaje, a la derecha; si no caben, bajan a una fila
|
|
3638
|
+
* propia (ver más abajo). Si los envuelves en un solo
|
|
3339
3639
|
* `<div kfAlertActions>`, el aviso separa a sus hijos. Sin ellos la zona no
|
|
3340
3640
|
* existe y el aviso queda igual.
|
|
3341
3641
|
*
|
|
@@ -3343,6 +3643,17 @@ const TONE_ICON$1 = {
|
|
|
3343
3643
|
* Vence el 15/08.
|
|
3344
3644
|
* <div kfAlertActions><kf-button size="sm">Renovar</kf-button></div>
|
|
3345
3645
|
* </kf-alert>
|
|
3646
|
+
*
|
|
3647
|
+
* `actionsInline` (solo `variant="bar"`, default `false`) mantiene las acciones de
|
|
3648
|
+
* `kfAlertActions` en la misma fila que el ícono y el mensaje, empujadas al borde
|
|
3649
|
+
* derecho. El mensaje cede el espacio y envuelve; cuando ni así caben juntos (pantallas
|
|
3650
|
+
* angostas) las acciones bajan a su propia fila, alineadas al inicio, como sin el input.
|
|
3651
|
+
* Con `false` la barra no cambia: las acciones van siempre en una fila propia.
|
|
3652
|
+
*
|
|
3653
|
+
* <kf-alert variant="bar" tone="info" actionsInline>
|
|
3654
|
+
* Estás viendo la cuenta de Ana Pérez.
|
|
3655
|
+
* <div kfAlertActions><kf-button size="sm" variant="outline">Volver a mi cuenta</kf-button></div>
|
|
3656
|
+
* </kf-alert>
|
|
3346
3657
|
*/
|
|
3347
3658
|
class Alert {
|
|
3348
3659
|
tone = input('info', /* @ts-ignore */
|
|
@@ -3370,6 +3681,12 @@ class Alert {
|
|
|
3370
3681
|
title = input('', /* @ts-ignore */
|
|
3371
3682
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
3372
3683
|
dismissible = input(false, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3684
|
+
/**
|
|
3685
|
+
* Solo `variant="bar"`: con `true`, las acciones (`kfAlertActions`) van en la misma fila
|
|
3686
|
+
* que el mensaje, a la derecha, y bajan a su propia fila si no caben. Default `false`:
|
|
3687
|
+
* siempre en una fila propia. `card` lo ignora.
|
|
3688
|
+
*/
|
|
3689
|
+
actionsInline = input(false, { ...(ngDevMode ? { debugName: "actionsInline" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
3373
3690
|
/** Visibilidad, two-way: `[(open)]="hasError"`. */
|
|
3374
3691
|
open = model(true, /* @ts-ignore */
|
|
3375
3692
|
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
@@ -3384,12 +3701,16 @@ class Alert {
|
|
|
3384
3701
|
...(ngDevMode ? [{ debugName: "toneIcon" }] : /* istanbul ignore next */ []));
|
|
3385
3702
|
/**
|
|
3386
3703
|
* Clases del contenedor: tono, forma (`bar` o `card` + apariencia), si lleva título y,
|
|
3387
|
-
* solo en `card` con `iconAlign="center"`, `kf-alert--icon-center
|
|
3704
|
+
* solo en `card` con `iconAlign="center"`, `kf-alert--icon-center`; solo en `bar` con
|
|
3705
|
+
* `actionsInline`, `kf-alert--actions-inline`.
|
|
3388
3706
|
*/
|
|
3389
3707
|
rootClass = computed(() => {
|
|
3390
3708
|
const classes = [`kf-alert--${this.tone()}`];
|
|
3391
3709
|
if (this.variant() === 'bar') {
|
|
3392
3710
|
classes.push('kf-alert--bar');
|
|
3711
|
+
if (this.actionsInline()) {
|
|
3712
|
+
classes.push('kf-alert--actions-inline');
|
|
3713
|
+
}
|
|
3393
3714
|
}
|
|
3394
3715
|
else {
|
|
3395
3716
|
classes.push('kf-alert--card', `kf-alert--${this.appearance()}`);
|
|
@@ -3404,15 +3725,15 @@ class Alert {
|
|
|
3404
3725
|
}, /* @ts-ignore */
|
|
3405
3726
|
...(ngDevMode ? [{ debugName: "rootClass" }] : /* istanbul ignore next */ []));
|
|
3406
3727
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Alert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3407
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Alert, isStandalone: true, selector: "kf-alert", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, iconAlign: { classPropertyName: "iconAlign", publicName: "iconAlign", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "attr.data-appearance": "appearance()", "attr.data-icon-align": "iconAlign()" } }, ngImport: i0, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }] });
|
|
3728
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: Alert, isStandalone: true, selector: "kf-alert", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, iconAlign: { classPropertyName: "iconAlign", publicName: "iconAlign", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, actionsInline: { classPropertyName: "actionsInline", publicName: "actionsInline", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange" }, host: { properties: { "attr.data-appearance": "appearance()", "attr.data-icon-align": "iconAlign()" } }, ngImport: i0, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar.kf-alert--actions-inline .kf-alert__actions{flex-basis:auto}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"], dependencies: [{ kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }] });
|
|
3408
3729
|
}
|
|
3409
3730
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: Alert, decorators: [{
|
|
3410
3731
|
type: Component,
|
|
3411
3732
|
args: [{ selector: 'kf-alert', imports: [Icon], host: {
|
|
3412
3733
|
'[attr.data-appearance]': 'appearance()',
|
|
3413
3734
|
'[attr.data-icon-align]': 'iconAlign()',
|
|
3414
|
-
}, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"] }]
|
|
3415
|
-
}], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], iconAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAlign", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
|
|
3735
|
+
}, template: "@if (open()) {\n <div class=\"kf-alert\" [class]=\"rootClass()\" [attr.role]=\"ariaRole()\">\n <!--\n `bar` y `solid` usan el glifo de trazo de `kf-icon`. `surface` y `elevated`\n dibujan un glifo relleno propio: `kf-icon` solo tiene trazo y una marca\n blanca sobre un relleno exige dos colores en el mismo glifo.\n -->\n @if (variant() === 'bar') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"sm\" />\n } @else if (appearance() === 'solid') {\n <kf-icon class=\"kf-alert__icon\" [name]=\"toneIcon()\" size=\"md\" />\n } @else {\n <span class=\"kf-alert__icon\">\n <svg class=\"kf-alert__glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">\n @switch (tone()) {\n @case ('ok') {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"m7.8 12.4 2.8 2.8 5.6-5.8\" />\n }\n @case ('warn') {\n <path\n class=\"kf-alert__shape\"\n d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 9.2v4.2\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 17h.01\" />\n }\n @case ('error') {\n <polygon\n class=\"kf-alert__shape\"\n points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"\n />\n <path class=\"kf-alert__mark\" d=\"M12 7.8v4.6\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 16h.01\" />\n }\n @default {\n <circle class=\"kf-alert__shape\" cx=\"12\" cy=\"12\" r=\"9.5\" />\n <path class=\"kf-alert__mark\" d=\"M12 11v5\" />\n <path class=\"kf-alert__mark kf-alert__mark--dot\" d=\"M12 7.6h.01\" />\n }\n }\n </svg>\n </span>\n }\n <div class=\"kf-alert__body\">\n <div class=\"kf-alert__content\">\n @if (title()) {\n <p class=\"kf-alert__title\">{{ title() }}</p>\n }\n <div class=\"kf-alert__message\"><ng-content /></div>\n </div>\n <div class=\"kf-alert__actions\"><ng-content select=\"[kfAlertActions]\" /></div>\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"kf-alert__close\"\n aria-label=\"Cerrar aviso\"\n (click)=\"open.set(false)\"\n >\n <kf-icon name=\"x\" size=\"sm\" />\n </button>\n }\n </div>\n}\n", styles: [":host{display:block;font-family:var(--kf-font-body)}.kf-alert{--_mark: var(--kf-color-white);--_actions-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));display:flex;color:var(--kf-color-text);font-size:var(--kf-font-size-body-sm);line-height:1.5}.kf-alert--info{--_tone: var(--kf-color-info);--_soft: var(--kf-color-info-soft);--_strong: var(--kf-color-info-strong);--_icon: var(--kf-color-info)}.kf-alert--ok{--_tone: var(--kf-color-success);--_soft: var(--kf-color-success-soft);--_strong: var(--kf-color-success-strong);--_icon: color-mix(in srgb, var(--kf-color-success) 60%, var(--kf-color-success-strong))}.kf-alert--warn{--_tone: var(--kf-color-warning);--_soft: var(--kf-color-warning-soft);--_strong: var(--kf-color-warning-strong);--_icon: color-mix(in srgb, var(--kf-color-warning) 35%, var(--kf-color-warning-strong));--_mark: var(--kf-color-ink)}.kf-alert--error{--_tone: var(--kf-color-error);--_soft: var(--kf-color-error-soft);--_strong: var(--kf-color-error-strong);--_icon: var(--kf-color-error)}.kf-alert__body{display:flex;min-width:0}.kf-alert__content{display:flex;flex-direction:column;min-width:0}.kf-alert__title{margin:0;color:var(--kf-color-ink);font-family:var(--kf-font-body);font-size:var(--kf-font-size-body);font-weight:var(--kf-font-weight-medium);line-height:1.5}.kf-alert__message{max-inline-size:72ch;color:var(--kf-color-text);overflow-wrap:anywhere}.kf-alert__message:has(>div,>section,>form,>table){max-inline-size:none}.kf-alert__message:empty{display:none}.kf-alert__actions{display:flex;flex:0 1 auto;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);min-width:0;max-width:100%}.kf-alert__actions:empty{display:none}.kf-alert__actions>*{max-width:100%;min-width:0}.kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--_actions-gap);margin:0;padding:0;list-style:none}.kf-alert__close{position:relative;flex:none;display:inline-flex;align-self:center;margin-inline-start:var(--kf-space-sm);padding:2px;border:none;background:transparent;color:var(--kf-color-text-muted);border-radius:var(--kf-radius-xs);cursor:pointer;transition:background-color .14s ease,color .14s ease}.kf-alert__close:after{content:\"\";position:absolute;top:50%;left:calc(-1 * var(--kf-space-sm));width:44px;height:44px;transform:translateY(-50%)}.kf-alert__close:hover{background:var(--kf-color-gray-100);color:var(--kf-color-ink)}.kf-alert__close:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}@media(prefers-reduced-motion:reduce){.kf-alert__close{transition:none}}.kf-alert--bar{align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-md);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-width:1px 0;border-radius:0;background:var(--_soft)}.kf-alert--bar .kf-alert__icon{align-items:center;justify-content:center;color:var(--_strong)}.kf-alert--bar .kf-alert__body{flex:1 1 0;flex-wrap:wrap;align-items:center;gap:var(--kf-space-sm) var(--kf-space-lg)}.kf-alert--bar .kf-alert__content{flex:1 1 20rem;flex-flow:row wrap;align-items:baseline;gap:2px var(--kf-space-xs)}.kf-alert--bar .kf-alert__title{font-size:inherit}.kf-alert--bar .kf-alert__message{max-inline-size:none}.kf-alert--bar .kf-alert__actions{flex-basis:100%}.kf-alert--bar.kf-alert--actions-inline .kf-alert__actions{flex-basis:auto}.kf-alert--bar .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--card{--_line: calc(var(--kf-font-size-body-sm) * 1.5);--_content-gap: 0px;align-items:flex-start}.kf-alert--card.kf-alert--titled{--_line: var(--_title-line)}.kf-alert--card .kf-alert__icon{display:flex;flex:none;align-items:center;justify-content:center;inline-size:var(--_glyph);block-size:var(--_line);color:var(--_icon)}.kf-alert--card .kf-alert__body{flex:1 1 0;flex-direction:column;gap:var(--_body-gap)}.kf-alert--card .kf-alert__content{gap:var(--_content-gap)}.kf-alert--card .kf-alert__title{color:inherit;font-size:var(--_title-size);font-weight:var(--_title-weight);line-height:var(--_title-line)}.kf-alert--card .kf-alert__message{color:inherit}.kf-alert--card.kf-alert--titled .kf-alert__message{color:var(--_desc)}.kf-alert--card .kf-alert__close{align-self:flex-start;margin-inline-start:0;margin-inline-end:calc(var(--kf-space-md) - var(--_pad-end));margin-block-start:calc((var(--_line) - 20px) / 2)}.kf-alert__glyph{display:block;flex:none;inline-size:var(--_glyph);block-size:var(--_glyph);fill:none;stroke:none}.kf-alert__shape{fill:currentColor;stroke:currentColor;stroke-width:1;stroke-linejoin:round}.kf-alert__mark{fill:none;stroke:var(--_mark);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.kf-alert__mark--dot{stroke-width:2.6}.kf-alert--surface{--_glyph: 16px;--_title-line: calc(var(--kf-font-size-body) * 1.5);--_title-size: var(--kf-font-size-body);--_title-weight: 500;--_body-gap: calc(var(--kf-space-sm) + var(--kf-space-xs));--_desc: var(--kf-color-text);--_pad-end: calc(var(--kf-space-sm) + var(--kf-space-xs));gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--_pad-end);border:1px solid color-mix(in srgb,var(--_tone) 40%,var(--_soft));border-radius:var(--kf-radius-sm);background:var(--_soft);color:var(--kf-color-ink)}.kf-alert--surface.kf-alert--titled{--_glyph: 24px;--_content-gap: var(--kf-space-sm);--_pad-end: var(--kf-space-lg);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-md) + var(--kf-space-xs)) var(--_pad-end)}.kf-alert--surface .kf-alert__close:hover{background:color-mix(in srgb,var(--_strong) 12%,transparent)}.kf-alert--elevated{--_glyph: 24px;--_title-line: var(--kf-space-lg);--_title-size: var(--kf-font-size-body-sm);--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: 0px;--_desc: var(--kf-color-text-muted);--_pad-end: var(--kf-space-md);gap:var(--kf-space-md);padding:var(--kf-space-md) var(--_pad-end);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm);background:var(--kf-color-white);box-shadow:var(--kf-shadow-md);color:var(--kf-color-ink)}.kf-alert--elevated .kf-alert__actions{margin-inline-start:calc(-1 * var(--kf-space-sm))}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>*{position:relative}.kf-alert--elevated .kf-alert__actions ::ng-deep>:is(div,span,ul)[kfAlertActions]>:not(:last-child):after{content:\"\\b7\";content:\"\\b7\" / \"\";position:absolute;inset-block:0;inset-inline-start:100%;display:grid;place-items:center;inline-size:0;color:var(--kf-color-text-muted);pointer-events:none}.kf-alert--solid{--_glyph: 20px;--_title-line: calc(var(--kf-space-md) + var(--kf-space-xs));--_title-size: .9375rem;--_title-weight: var(--kf-font-weight-medium);--_body-gap: var(--kf-space-sm);--_actions-gap: var(--kf-space-sm);--_solid: var(--_strong);--_on: var(--kf-color-white);--_btn-fg: var(--_solid);--_desc: var(--_on);--_pad-end: var(--kf-space-sm);gap:calc(var(--kf-space-sm) + var(--kf-space-xs));padding:calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--_pad-end) calc(var(--kf-space-sm) + var(--kf-space-xs)) var(--kf-space-md);border-radius:var(--kf-radius-sm);background:var(--_solid);color:var(--_on)}.kf-alert--solid.kf-alert--warn{--_solid: var(--kf-color-warning);--_on: var(--kf-color-ink);--_btn-fg: var(--kf-color-white)}.kf-alert--solid .kf-alert__icon{color:var(--_on)}.kf-alert--solid:not(.kf-alert--titled) .kf-alert__message{font-weight:500}.kf-alert--solid .kf-alert__close{color:var(--_on)}.kf-alert--solid .kf-alert__close:hover{background:color-mix(in srgb,var(--_on) 16%,transparent);color:var(--_on)}.kf-alert--solid .kf-alert__close:focus-visible{box-shadow:0 0 0 2px var(--_solid),0 0 0 4px var(--_on)}.kf-alert--solid .kf-alert__actions{--kf-color-primary: var(--_on);--kf-color-primary-hover: color-mix(in srgb, var(--_on) 88%, var(--_solid));--kf-color-primary-soft: color-mix(in srgb, var(--_on) 16%, transparent);--kf-color-white: var(--_btn-fg);--kf-color-text: var(--_on);--kf-color-text-muted: var(--_on);--kf-color-border-strong: color-mix(in srgb, var(--_on) 55%, transparent);--kf-color-surface: color-mix(in srgb, var(--_on) 16%, transparent);--kf-shadow-focus: 0 0 0 2px var(--_solid), 0 0 0 4px var(--_on)}.kf-alert--card.kf-alert--icon-center{display:grid;grid-template-columns:auto minmax(0,1fr);row-gap:var(--_body-gap)}.kf-alert--icon-center .kf-alert__body{display:contents}.kf-alert--icon-center .kf-alert__icon{grid-area:1 / 1;align-self:center}.kf-alert--icon-center .kf-alert__content{grid-area:1 / 2}.kf-alert--icon-center .kf-alert__actions{grid-area:2 / 2}.kf-alert--icon-center .kf-alert__close{grid-area:1 / 3;align-self:center;margin-block-start:0}\n"] }]
|
|
3736
|
+
}], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], iconAlign: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAlign", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], actionsInline: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsInline", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }] } });
|
|
3416
3737
|
|
|
3417
3738
|
/**
|
|
3418
3739
|
* Fila clickeable de una lista de pendientes/alertas: ícono circular con
|
|
@@ -7126,6 +7447,26 @@ const BAR_TONE = {
|
|
|
7126
7447
|
* <kf-stat-card icon="clock" tone="warn" value="7" label="Por vencer" [bar]="35" hint="7 de 20"
|
|
7127
7448
|
* clickable [pressed]="filter() === 'due'" (cardClick)="toggle('due')" />
|
|
7128
7449
|
*
|
|
7450
|
+
* - `ariaExpanded`, `ariaHaspopup` y `ariaControls`: con `clickable`, se reenvían al
|
|
7451
|
+
* `<button>` interno solo cuando están definidos (el host no los propaga). Sirven
|
|
7452
|
+
* para una card que abre un panel o una hoja: `ariaExpanded` indica si está abierto,
|
|
7453
|
+
* `ariaHaspopup` qué tipo de panel es (`'dialog'`, `'menu'`, `'listbox'`, `'true'`) y
|
|
7454
|
+
* `ariaControls` el id del panel. Sin `clickable` no tienen efecto. Mismos nombres
|
|
7455
|
+
* y valores que en `kf-button`.
|
|
7456
|
+
*
|
|
7457
|
+
* <kf-stat-card icon="receipt" value="US$ 48,990.01" label="Total a pagar"
|
|
7458
|
+
* clickable [ariaExpanded]="sheetOpen()" ariaHaspopup="dialog" ariaControls="detail-sheet"
|
|
7459
|
+
* (cardClick)="sheetOpen.set(true)" />
|
|
7460
|
+
*
|
|
7461
|
+
* Con `[kfPopover]` en modo `click` sobre la card no hace falta pasarlos: la directiva
|
|
7462
|
+
* mantiene `aria-expanded`, `aria-controls` y `aria-haspopup` en el `<button>` interno
|
|
7463
|
+
* (ver `PopoverDirective`). Usa estos inputs cuando el panel lo abres tú (una hoja
|
|
7464
|
+
* `kf-drawer`, por ejemplo) o cuando la directiva está desactivada.
|
|
7465
|
+
*
|
|
7466
|
+
* <kf-stat-card icon="receipt" value="US$ 48,990.01" label="Total a pagar" clickable
|
|
7467
|
+
* [kfPopover]="detail" kfPopoverTrigger="click" kfPopoverInteractive
|
|
7468
|
+
* kfPopoverLabel="Detalle del total" />
|
|
7469
|
+
*
|
|
7129
7470
|
* - `badge` (+ `badgeTone`, default `'neutral'`): insignia (`kf-badge`) a la
|
|
7130
7471
|
* derecha de la etiqueta, para un estado puntual ("Urgente", "Nuevo"). Es
|
|
7131
7472
|
* texto real en el DOM, así que un lector de pantalla lo lee tras la
|
|
@@ -7192,6 +7533,15 @@ class StatCard {
|
|
|
7192
7533
|
*/
|
|
7193
7534
|
pressed = input(null, /* @ts-ignore */
|
|
7194
7535
|
...(ngDevMode ? [{ debugName: "pressed" }] : /* istanbul ignore next */ []));
|
|
7536
|
+
/** `aria-expanded` del botón cuando la card es `clickable`; `undefined` = no se emite. */
|
|
7537
|
+
ariaExpanded = input(/* @ts-ignore */
|
|
7538
|
+
...(ngDevMode ? [undefined, { debugName: "ariaExpanded" }] : /* istanbul ignore next */ []));
|
|
7539
|
+
/** `aria-haspopup` del botón cuando la card es `clickable`; `undefined` = no se emite. */
|
|
7540
|
+
ariaHaspopup = input(/* @ts-ignore */
|
|
7541
|
+
...(ngDevMode ? [undefined, { debugName: "ariaHaspopup" }] : /* istanbul ignore next */ []));
|
|
7542
|
+
/** `aria-controls` (id del panel que abre) del botón cuando la card es `clickable`. */
|
|
7543
|
+
ariaControls = input(/* @ts-ignore */
|
|
7544
|
+
...(ngDevMode ? [undefined, { debugName: "ariaControls" }] : /* istanbul ignore next */ []));
|
|
7195
7545
|
/** `'compact'`: variante para pantallas angostas; `'default'` no cambia la card. */
|
|
7196
7546
|
density = input('default', /* @ts-ignore */
|
|
7197
7547
|
...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
|
|
@@ -7208,14 +7558,14 @@ class StatCard {
|
|
|
7208
7558
|
}, /* @ts-ignore */
|
|
7209
7559
|
...(ngDevMode ? [{ debugName: "hasBar" }] : /* istanbul ignore next */ []));
|
|
7210
7560
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: StatCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7211
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: StatCard, isStandalone: true, selector: "kf-stat-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, note: { classPropertyName: "note", publicName: "note", isSignal: true, isRequired: false, transformFunction: null }, bar: { classPropertyName: "bar", publicName: "bar", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeTone: { classPropertyName: "badgeTone", publicName: "badgeTone", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardClick: "cardClick" }, host: { properties: { "class.kf-stat-card-host--compact": "density() === 'compact'" } }, ngImport: i0, template: "@if (loading()) {\n <div\n class=\"kf-stat-card\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n aria-busy=\"true\"\n >\n <span\n class=\"kf-stat-card__icon kf-stat-card__icon--bone kf-bone-fill\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"kf-stat-card__body\" aria-hidden=\"true\">\n <span class=\"kf-stat-card__value kf-bone\" style=\"--kf-bone-width: 40%\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading kf-stat-card__heading--bone\">\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{\n label()\n }}</span>\n <span class=\"kf-stat-card__badge-bone kf-bone\" style=\"--kf-bone-width: auto\">{{\n badge()\n }}</span>\n </span>\n } @else {\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note kf-bone\" style=\"--kf-bone-width: 55%\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <span class=\"kf-stat-card__bar\">\n <span class=\"kf-stat-card__bar-bone kf-bone-fill\"></span>\n </span>\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint kf-bone\" style=\"--kf-bone-width: 45%\">{{ hint() }}</span>\n }\n </span>\n </div>\n} @else if (clickable()) {\n <button\n type=\"button\"\n class=\"kf-stat-card kf-stat-card--clickable\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n [class.kf-stat-card--pressed]=\"pressed() === true\"\n [attr.aria-pressed]=\"pressed()\"\n (click)=\"cardClick.emit()\"\n >\n <ng-container *ngTemplateOutlet=\"content\" />\n <kf-icon class=\"kf-stat-card__chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n} @else {\n <div class=\"kf-stat-card\" [class.kf-stat-card--compact]=\"density() === 'compact'\">\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n}\n\n<ng-template #content>\n <span class=\"kf-stat-card__icon\" [class]=\"'kf-stat-card__icon--' + tone()\">\n <kf-icon [name]=\"icon()\" size=\"md\" />\n </span>\n <span class=\"kf-stat-card__body\">\n <span class=\"kf-stat-card__value\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading\">\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n <kf-badge class=\"kf-stat-card__badge\" [tone]=\"badgeTone()\">{{ badge() }}</kf-badge>\n </span>\n } @else {\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <kf-progress\n class=\"kf-stat-card__bar\"\n [value]=\"bar()!\"\n [tone]=\"barTone()\"\n [ariaLabel]=\"label()\"\n />\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint\">{{ hint() }}</span>\n }\n </span>\n</ng-template>\n", styles: [".kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}:host{display:block}.kf-stat-card{display:flex;align-items:center;gap:var(--kf-space-md);width:100%;height:100%;box-sizing:border-box;padding:var(--kf-space-lg);border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-md);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);font:inherit;text-align:left}.kf-stat-card--clickable{cursor:pointer;transition:box-shadow .14s,transform .14s}.kf-stat-card--clickable:hover{box-shadow:var(--kf-shadow-md);transform:translateY(-2px)}.kf-stat-card--clickable:focus-visible{outline:2px solid transparent;box-shadow:var(--kf-shadow-focus)}.kf-stat-card--pressed{border-color:var(--kf-color-primary);background:var(--kf-color-primary-soft);box-shadow:inset 0 0 0 1px var(--kf-color-primary)}.kf-stat-card--pressed:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-primary),var(--kf-shadow-focus)}.kf-stat-card__icon{display:grid;place-items:center;width:50px;height:50px;flex:none;border-radius:var(--kf-radius-md)}.kf-stat-card__icon--primary{background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-stat-card__icon--success{background:var(--kf-color-success-soft);color:var(--kf-color-success-strong)}.kf-stat-card__icon--error{background:var(--kf-color-error-soft);color:var(--kf-color-error)}.kf-stat-card__icon--purple{background:var(--kf-color-purple-soft);color:var(--kf-color-purple)}.kf-stat-card__icon--warn{background:var(--kf-color-warning-soft);color:var(--kf-color-warning-strong)}.kf-stat-card__icon--info{background:var(--kf-color-info-soft);color:var(--kf-color-info-strong)}.kf-stat-card__icon--neutral{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-stat-card__body{display:flex;flex-direction:column;gap:2px;min-width:0}.kf-stat-card__value{font-family:var(--kf-font-title);font-weight:700;font-size:var(--kf-font-size-title-md);color:var(--kf-color-ink)}.kf-stat-card__label{font-size:.875rem;font-weight:700;color:var(--kf-color-ink)}.kf-stat-card__heading{display:flex;flex-wrap:wrap;align-items:center;gap:2px var(--kf-space-sm);min-width:0}.kf-stat-card__heading--bone{flex-wrap:nowrap}.kf-stat-card__note{font-size:.78rem;color:var(--kf-color-text-muted)}.kf-stat-card__bar{padding-block-start:var(--kf-space-xs)}.kf-stat-card__hint{font-size:.78rem;color:var(--kf-color-text)}.kf-stat-card__chevron{margin-left:auto;flex:none;color:var(--kf-color-gray-400)}.kf-stat-card__icon--bone{border-radius:var(--kf-radius-md)}.kf-stat-card__badge-bone{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-pill);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1}.kf-stat-card__bar-bone{display:block;height:4px;border-radius:var(--kf-radius-pill)}.kf-stat-card--compact{gap:var(--kf-space-sm) 12px;padding:var(--kf-space-md)}.kf-stat-card--compact .kf-stat-card__icon{width:40px;height:40px}.kf-stat-card--compact .kf-stat-card__value{font-size:var(--kf-font-size-title-sm)}:host(.kf-stat-card-host--compact){container-type:inline-size}@container (max-width: 210px){.kf-stat-card--compact{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:center;gap:2px 10px;padding:12px}.kf-stat-card--compact .kf-stat-card__body{display:contents}.kf-stat-card--compact .kf-stat-card__icon{grid-row:1;grid-column:1;width:36px;height:36px}.kf-stat-card--compact .kf-stat-card__value{grid-row:1;grid-column:2}.kf-stat-card--compact .kf-stat-card__heading,.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__note,.kf-stat-card--compact .kf-stat-card__bar,.kf-stat-card--compact .kf-stat-card__hint{grid-column:1 / -1}.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__heading{margin-top:6px}.kf-stat-card--compact .kf-stat-card__heading .kf-stat-card__label{margin-top:0}.kf-stat-card--compact .kf-stat-card__chevron{display:none}}\n"], dependencies: [{ kind: "component", type: Badge, selector: "kf-badge", inputs: ["tone", "variant", "dot", "truncate", "wrap"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Progress, selector: "kf-progress", inputs: ["value", "tone", "size", "label", "ariaLabel"] }] });
|
|
7561
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: StatCard, isStandalone: true, selector: "kf-stat-card", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, note: { classPropertyName: "note", publicName: "note", isSignal: true, isRequired: false, transformFunction: null }, bar: { classPropertyName: "bar", publicName: "bar", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, badgeTone: { classPropertyName: "badgeTone", publicName: "badgeTone", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaHaspopup: { classPropertyName: "ariaHaspopup", publicName: "ariaHaspopup", isSignal: true, isRequired: false, transformFunction: null }, ariaControls: { classPropertyName: "ariaControls", publicName: "ariaControls", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardClick: "cardClick" }, host: { properties: { "class.kf-stat-card-host--compact": "density() === 'compact'" } }, ngImport: i0, template: "@if (loading()) {\n <div\n class=\"kf-stat-card\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n aria-busy=\"true\"\n >\n <span\n class=\"kf-stat-card__icon kf-stat-card__icon--bone kf-bone-fill\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"kf-stat-card__body\" aria-hidden=\"true\">\n <span class=\"kf-stat-card__value kf-bone\" style=\"--kf-bone-width: 40%\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading kf-stat-card__heading--bone\">\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{\n label()\n }}</span>\n <span class=\"kf-stat-card__badge-bone kf-bone\" style=\"--kf-bone-width: auto\">{{\n badge()\n }}</span>\n </span>\n } @else {\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note kf-bone\" style=\"--kf-bone-width: 55%\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <span class=\"kf-stat-card__bar\">\n <span class=\"kf-stat-card__bar-bone kf-bone-fill\"></span>\n </span>\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint kf-bone\" style=\"--kf-bone-width: 45%\">{{ hint() }}</span>\n }\n </span>\n </div>\n} @else if (clickable()) {\n <button\n type=\"button\"\n class=\"kf-stat-card kf-stat-card--clickable\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n [class.kf-stat-card--pressed]=\"pressed() === true\"\n [attr.aria-pressed]=\"pressed()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n (click)=\"cardClick.emit()\"\n >\n <ng-container *ngTemplateOutlet=\"content\" />\n <kf-icon class=\"kf-stat-card__chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n} @else {\n <div class=\"kf-stat-card\" [class.kf-stat-card--compact]=\"density() === 'compact'\">\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n}\n\n<ng-template #content>\n <span class=\"kf-stat-card__icon\" [class]=\"'kf-stat-card__icon--' + tone()\">\n <kf-icon [name]=\"icon()\" size=\"md\" />\n </span>\n <span class=\"kf-stat-card__body\">\n <span class=\"kf-stat-card__value\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading\">\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n <kf-badge class=\"kf-stat-card__badge\" [tone]=\"badgeTone()\">{{ badge() }}</kf-badge>\n </span>\n } @else {\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <kf-progress\n class=\"kf-stat-card__bar\"\n [value]=\"bar()!\"\n [tone]=\"barTone()\"\n [ariaLabel]=\"label()\"\n />\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint\">{{ hint() }}</span>\n }\n </span>\n</ng-template>\n", styles: [".kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}:host{display:block}.kf-stat-card{display:flex;align-items:center;gap:var(--kf-space-md);width:100%;height:100%;box-sizing:border-box;padding:var(--kf-space-lg);border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-md);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);font:inherit;text-align:left}.kf-stat-card--clickable{cursor:pointer;transition:box-shadow .14s,transform .14s}.kf-stat-card--clickable:hover{box-shadow:var(--kf-shadow-md);transform:translateY(-2px)}.kf-stat-card--clickable:focus-visible{outline:2px solid transparent;box-shadow:var(--kf-shadow-focus)}.kf-stat-card--pressed{border-color:var(--kf-color-primary);background:var(--kf-color-primary-soft);box-shadow:inset 0 0 0 1px var(--kf-color-primary)}.kf-stat-card--pressed:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-primary),var(--kf-shadow-focus)}.kf-stat-card__icon{display:grid;place-items:center;width:50px;height:50px;flex:none;border-radius:var(--kf-radius-md)}.kf-stat-card__icon--primary{background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-stat-card__icon--success{background:var(--kf-color-success-soft);color:var(--kf-color-success-strong)}.kf-stat-card__icon--error{background:var(--kf-color-error-soft);color:var(--kf-color-error)}.kf-stat-card__icon--purple{background:var(--kf-color-purple-soft);color:var(--kf-color-purple)}.kf-stat-card__icon--warn{background:var(--kf-color-warning-soft);color:var(--kf-color-warning-strong)}.kf-stat-card__icon--info{background:var(--kf-color-info-soft);color:var(--kf-color-info-strong)}.kf-stat-card__icon--neutral{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-stat-card__body{display:flex;flex-direction:column;gap:2px;min-width:0}.kf-stat-card__value{font-family:var(--kf-font-title);font-weight:700;font-size:var(--kf-font-size-title-md);color:var(--kf-color-ink)}.kf-stat-card__label{font-size:.875rem;font-weight:700;color:var(--kf-color-ink)}.kf-stat-card__heading{display:flex;flex-wrap:wrap;align-items:center;gap:2px var(--kf-space-sm);min-width:0}.kf-stat-card__heading--bone{flex-wrap:nowrap}.kf-stat-card__note{font-size:.78rem;color:var(--kf-color-text-muted)}.kf-stat-card__bar{padding-block-start:var(--kf-space-xs)}.kf-stat-card__hint{font-size:.78rem;color:var(--kf-color-text)}.kf-stat-card__chevron{margin-left:auto;flex:none;color:var(--kf-color-gray-400)}.kf-stat-card__icon--bone{border-radius:var(--kf-radius-md)}.kf-stat-card__badge-bone{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-pill);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1}.kf-stat-card__bar-bone{display:block;height:4px;border-radius:var(--kf-radius-pill)}.kf-stat-card--compact{gap:var(--kf-space-sm) 12px;padding:var(--kf-space-md)}.kf-stat-card--compact .kf-stat-card__icon{width:40px;height:40px}.kf-stat-card--compact .kf-stat-card__value{font-size:var(--kf-font-size-title-sm)}:host(.kf-stat-card-host--compact){container-type:inline-size}@container (max-width: 210px){.kf-stat-card--compact{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:center;gap:2px 10px;padding:12px}.kf-stat-card--compact .kf-stat-card__body{display:contents}.kf-stat-card--compact .kf-stat-card__icon{grid-row:1;grid-column:1;width:36px;height:36px}.kf-stat-card--compact .kf-stat-card__value{grid-row:1;grid-column:2}.kf-stat-card--compact .kf-stat-card__heading,.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__note,.kf-stat-card--compact .kf-stat-card__bar,.kf-stat-card--compact .kf-stat-card__hint{grid-column:1 / -1}.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__heading{margin-top:6px}.kf-stat-card--compact .kf-stat-card__heading .kf-stat-card__label{margin-top:0}.kf-stat-card--compact .kf-stat-card__chevron{display:none}}\n"], dependencies: [{ kind: "component", type: Badge, selector: "kf-badge", inputs: ["tone", "variant", "dot", "truncate", "wrap"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: Progress, selector: "kf-progress", inputs: ["value", "tone", "size", "label", "ariaLabel"] }] });
|
|
7212
7562
|
}
|
|
7213
7563
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: StatCard, decorators: [{
|
|
7214
7564
|
type: Component,
|
|
7215
7565
|
args: [{ selector: 'kf-stat-card', imports: [Badge, Icon, NgTemplateOutlet, Progress], host: {
|
|
7216
7566
|
'[class.kf-stat-card-host--compact]': "density() === 'compact'",
|
|
7217
|
-
}, template: "@if (loading()) {\n <div\n class=\"kf-stat-card\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n aria-busy=\"true\"\n >\n <span\n class=\"kf-stat-card__icon kf-stat-card__icon--bone kf-bone-fill\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"kf-stat-card__body\" aria-hidden=\"true\">\n <span class=\"kf-stat-card__value kf-bone\" style=\"--kf-bone-width: 40%\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading kf-stat-card__heading--bone\">\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{\n label()\n }}</span>\n <span class=\"kf-stat-card__badge-bone kf-bone\" style=\"--kf-bone-width: auto\">{{\n badge()\n }}</span>\n </span>\n } @else {\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note kf-bone\" style=\"--kf-bone-width: 55%\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <span class=\"kf-stat-card__bar\">\n <span class=\"kf-stat-card__bar-bone kf-bone-fill\"></span>\n </span>\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint kf-bone\" style=\"--kf-bone-width: 45%\">{{ hint() }}</span>\n }\n </span>\n </div>\n} @else if (clickable()) {\n <button\n type=\"button\"\n class=\"kf-stat-card kf-stat-card--clickable\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n [class.kf-stat-card--pressed]=\"pressed() === true\"\n [attr.aria-pressed]=\"pressed()\"\n (click)=\"cardClick.emit()\"\n >\n <ng-container *ngTemplateOutlet=\"content\" />\n <kf-icon class=\"kf-stat-card__chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n} @else {\n <div class=\"kf-stat-card\" [class.kf-stat-card--compact]=\"density() === 'compact'\">\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n}\n\n<ng-template #content>\n <span class=\"kf-stat-card__icon\" [class]=\"'kf-stat-card__icon--' + tone()\">\n <kf-icon [name]=\"icon()\" size=\"md\" />\n </span>\n <span class=\"kf-stat-card__body\">\n <span class=\"kf-stat-card__value\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading\">\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n <kf-badge class=\"kf-stat-card__badge\" [tone]=\"badgeTone()\">{{ badge() }}</kf-badge>\n </span>\n } @else {\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <kf-progress\n class=\"kf-stat-card__bar\"\n [value]=\"bar()!\"\n [tone]=\"barTone()\"\n [ariaLabel]=\"label()\"\n />\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint\">{{ hint() }}</span>\n }\n </span>\n</ng-template>\n", styles: [".kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}:host{display:block}.kf-stat-card{display:flex;align-items:center;gap:var(--kf-space-md);width:100%;height:100%;box-sizing:border-box;padding:var(--kf-space-lg);border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-md);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);font:inherit;text-align:left}.kf-stat-card--clickable{cursor:pointer;transition:box-shadow .14s,transform .14s}.kf-stat-card--clickable:hover{box-shadow:var(--kf-shadow-md);transform:translateY(-2px)}.kf-stat-card--clickable:focus-visible{outline:2px solid transparent;box-shadow:var(--kf-shadow-focus)}.kf-stat-card--pressed{border-color:var(--kf-color-primary);background:var(--kf-color-primary-soft);box-shadow:inset 0 0 0 1px var(--kf-color-primary)}.kf-stat-card--pressed:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-primary),var(--kf-shadow-focus)}.kf-stat-card__icon{display:grid;place-items:center;width:50px;height:50px;flex:none;border-radius:var(--kf-radius-md)}.kf-stat-card__icon--primary{background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-stat-card__icon--success{background:var(--kf-color-success-soft);color:var(--kf-color-success-strong)}.kf-stat-card__icon--error{background:var(--kf-color-error-soft);color:var(--kf-color-error)}.kf-stat-card__icon--purple{background:var(--kf-color-purple-soft);color:var(--kf-color-purple)}.kf-stat-card__icon--warn{background:var(--kf-color-warning-soft);color:var(--kf-color-warning-strong)}.kf-stat-card__icon--info{background:var(--kf-color-info-soft);color:var(--kf-color-info-strong)}.kf-stat-card__icon--neutral{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-stat-card__body{display:flex;flex-direction:column;gap:2px;min-width:0}.kf-stat-card__value{font-family:var(--kf-font-title);font-weight:700;font-size:var(--kf-font-size-title-md);color:var(--kf-color-ink)}.kf-stat-card__label{font-size:.875rem;font-weight:700;color:var(--kf-color-ink)}.kf-stat-card__heading{display:flex;flex-wrap:wrap;align-items:center;gap:2px var(--kf-space-sm);min-width:0}.kf-stat-card__heading--bone{flex-wrap:nowrap}.kf-stat-card__note{font-size:.78rem;color:var(--kf-color-text-muted)}.kf-stat-card__bar{padding-block-start:var(--kf-space-xs)}.kf-stat-card__hint{font-size:.78rem;color:var(--kf-color-text)}.kf-stat-card__chevron{margin-left:auto;flex:none;color:var(--kf-color-gray-400)}.kf-stat-card__icon--bone{border-radius:var(--kf-radius-md)}.kf-stat-card__badge-bone{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-pill);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1}.kf-stat-card__bar-bone{display:block;height:4px;border-radius:var(--kf-radius-pill)}.kf-stat-card--compact{gap:var(--kf-space-sm) 12px;padding:var(--kf-space-md)}.kf-stat-card--compact .kf-stat-card__icon{width:40px;height:40px}.kf-stat-card--compact .kf-stat-card__value{font-size:var(--kf-font-size-title-sm)}:host(.kf-stat-card-host--compact){container-type:inline-size}@container (max-width: 210px){.kf-stat-card--compact{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:center;gap:2px 10px;padding:12px}.kf-stat-card--compact .kf-stat-card__body{display:contents}.kf-stat-card--compact .kf-stat-card__icon{grid-row:1;grid-column:1;width:36px;height:36px}.kf-stat-card--compact .kf-stat-card__value{grid-row:1;grid-column:2}.kf-stat-card--compact .kf-stat-card__heading,.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__note,.kf-stat-card--compact .kf-stat-card__bar,.kf-stat-card--compact .kf-stat-card__hint{grid-column:1 / -1}.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__heading{margin-top:6px}.kf-stat-card--compact .kf-stat-card__heading .kf-stat-card__label{margin-top:0}.kf-stat-card--compact .kf-stat-card__chevron{display:none}}\n"] }]
|
|
7218
|
-
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], note: [{ type: i0.Input, args: [{ isSignal: true, alias: "note", required: false }] }], bar: [{ type: i0.Input, args: [{ isSignal: true, alias: "bar", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeTone: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeTone", required: false }] }], pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], cardClick: [{ type: i0.Output, args: ["cardClick"] }] } });
|
|
7567
|
+
}, template: "@if (loading()) {\n <div\n class=\"kf-stat-card\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n aria-busy=\"true\"\n >\n <span\n class=\"kf-stat-card__icon kf-stat-card__icon--bone kf-bone-fill\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"kf-stat-card__body\" aria-hidden=\"true\">\n <span class=\"kf-stat-card__value kf-bone\" style=\"--kf-bone-width: 40%\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading kf-stat-card__heading--bone\">\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{\n label()\n }}</span>\n <span class=\"kf-stat-card__badge-bone kf-bone\" style=\"--kf-bone-width: auto\">{{\n badge()\n }}</span>\n </span>\n } @else {\n <span class=\"kf-stat-card__label kf-bone\" style=\"--kf-bone-width: 70%\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note kf-bone\" style=\"--kf-bone-width: 55%\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <span class=\"kf-stat-card__bar\">\n <span class=\"kf-stat-card__bar-bone kf-bone-fill\"></span>\n </span>\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint kf-bone\" style=\"--kf-bone-width: 45%\">{{ hint() }}</span>\n }\n </span>\n </div>\n} @else if (clickable()) {\n <button\n type=\"button\"\n class=\"kf-stat-card kf-stat-card--clickable\"\n [class.kf-stat-card--compact]=\"density() === 'compact'\"\n [class.kf-stat-card--pressed]=\"pressed() === true\"\n [attr.aria-pressed]=\"pressed()\"\n [attr.aria-expanded]=\"ariaExpanded() ?? null\"\n [attr.aria-haspopup]=\"ariaHaspopup() ?? null\"\n [attr.aria-controls]=\"ariaControls() || null\"\n (click)=\"cardClick.emit()\"\n >\n <ng-container *ngTemplateOutlet=\"content\" />\n <kf-icon class=\"kf-stat-card__chevron\" name=\"chevron-right\" size=\"sm\" />\n </button>\n} @else {\n <div class=\"kf-stat-card\" [class.kf-stat-card--compact]=\"density() === 'compact'\">\n <ng-container *ngTemplateOutlet=\"content\" />\n </div>\n}\n\n<ng-template #content>\n <span class=\"kf-stat-card__icon\" [class]=\"'kf-stat-card__icon--' + tone()\">\n <kf-icon [name]=\"icon()\" size=\"md\" />\n </span>\n <span class=\"kf-stat-card__body\">\n <span class=\"kf-stat-card__value\">{{ value() }}</span>\n @if (badge()) {\n <span class=\"kf-stat-card__heading\">\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n <kf-badge class=\"kf-stat-card__badge\" [tone]=\"badgeTone()\">{{ badge() }}</kf-badge>\n </span>\n } @else {\n <span class=\"kf-stat-card__label\">{{ label() }}</span>\n }\n @if (note()) {\n <span class=\"kf-stat-card__note\">{{ note() }}</span>\n }\n @if (hasBar()) {\n <kf-progress\n class=\"kf-stat-card__bar\"\n [value]=\"bar()!\"\n [tone]=\"barTone()\"\n [ariaLabel]=\"label()\"\n />\n }\n @if (hint()) {\n <span class=\"kf-stat-card__hint\">{{ hint() }}</span>\n }\n </span>\n</ng-template>\n", styles: [".kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}:host{display:block}.kf-stat-card{display:flex;align-items:center;gap:var(--kf-space-md);width:100%;height:100%;box-sizing:border-box;padding:var(--kf-space-lg);border:1px solid var(--kf-color-border-strong);border-radius:var(--kf-radius-md);background:var(--kf-color-white);box-shadow:var(--kf-shadow-sm);font:inherit;text-align:left}.kf-stat-card--clickable{cursor:pointer;transition:box-shadow .14s,transform .14s}.kf-stat-card--clickable:hover{box-shadow:var(--kf-shadow-md);transform:translateY(-2px)}.kf-stat-card--clickable:focus-visible{outline:2px solid transparent;box-shadow:var(--kf-shadow-focus)}.kf-stat-card--pressed{border-color:var(--kf-color-primary);background:var(--kf-color-primary-soft);box-shadow:inset 0 0 0 1px var(--kf-color-primary)}.kf-stat-card--pressed:focus-visible{box-shadow:inset 0 0 0 1px var(--kf-color-primary),var(--kf-shadow-focus)}.kf-stat-card__icon{display:grid;place-items:center;width:50px;height:50px;flex:none;border-radius:var(--kf-radius-md)}.kf-stat-card__icon--primary{background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-stat-card__icon--success{background:var(--kf-color-success-soft);color:var(--kf-color-success-strong)}.kf-stat-card__icon--error{background:var(--kf-color-error-soft);color:var(--kf-color-error)}.kf-stat-card__icon--purple{background:var(--kf-color-purple-soft);color:var(--kf-color-purple)}.kf-stat-card__icon--warn{background:var(--kf-color-warning-soft);color:var(--kf-color-warning-strong)}.kf-stat-card__icon--info{background:var(--kf-color-info-soft);color:var(--kf-color-info-strong)}.kf-stat-card__icon--neutral{background:var(--kf-color-gray-100);color:var(--kf-color-text)}.kf-stat-card__body{display:flex;flex-direction:column;gap:2px;min-width:0}.kf-stat-card__value{font-family:var(--kf-font-title);font-weight:700;font-size:var(--kf-font-size-title-md);color:var(--kf-color-ink)}.kf-stat-card__label{font-size:.875rem;font-weight:700;color:var(--kf-color-ink)}.kf-stat-card__heading{display:flex;flex-wrap:wrap;align-items:center;gap:2px var(--kf-space-sm);min-width:0}.kf-stat-card__heading--bone{flex-wrap:nowrap}.kf-stat-card__note{font-size:.78rem;color:var(--kf-color-text-muted)}.kf-stat-card__bar{padding-block-start:var(--kf-space-xs)}.kf-stat-card__hint{font-size:.78rem;color:var(--kf-color-text)}.kf-stat-card__chevron{margin-left:auto;flex:none;color:var(--kf-color-gray-400)}.kf-stat-card__icon--bone{border-radius:var(--kf-radius-md)}.kf-stat-card__badge-bone{padding:var(--kf-space-xs) var(--kf-space-sm);border-radius:var(--kf-radius-pill);font-size:var(--kf-font-size-caption);font-weight:600;line-height:1}.kf-stat-card__bar-bone{display:block;height:4px;border-radius:var(--kf-radius-pill)}.kf-stat-card--compact{gap:var(--kf-space-sm) 12px;padding:var(--kf-space-md)}.kf-stat-card--compact .kf-stat-card__icon{width:40px;height:40px}.kf-stat-card--compact .kf-stat-card__value{font-size:var(--kf-font-size-title-sm)}:host(.kf-stat-card-host--compact){container-type:inline-size}@container (max-width: 210px){.kf-stat-card--compact{display:grid;grid-template-columns:auto minmax(0,1fr);align-content:start;align-items:center;gap:2px 10px;padding:12px}.kf-stat-card--compact .kf-stat-card__body{display:contents}.kf-stat-card--compact .kf-stat-card__icon{grid-row:1;grid-column:1;width:36px;height:36px}.kf-stat-card--compact .kf-stat-card__value{grid-row:1;grid-column:2}.kf-stat-card--compact .kf-stat-card__heading,.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__note,.kf-stat-card--compact .kf-stat-card__bar,.kf-stat-card--compact .kf-stat-card__hint{grid-column:1 / -1}.kf-stat-card--compact .kf-stat-card__label,.kf-stat-card--compact .kf-stat-card__heading{margin-top:6px}.kf-stat-card--compact .kf-stat-card__heading .kf-stat-card__label{margin-top:0}.kf-stat-card--compact .kf-stat-card__chevron{display:none}}\n"] }]
|
|
7568
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], note: [{ type: i0.Input, args: [{ isSignal: true, alias: "note", required: false }] }], bar: [{ type: i0.Input, args: [{ isSignal: true, alias: "bar", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], badgeTone: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeTone", required: false }] }], pressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "pressed", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaHaspopup: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaHaspopup", required: false }] }], ariaControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControls", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], cardClick: [{ type: i0.Output, args: ["cardClick"] }] } });
|
|
7219
7569
|
|
|
7220
7570
|
/** Cantidad de elementos por defecto de cada variante (`count` sin valor). */
|
|
7221
7571
|
const DEFAULT_COUNT = {
|
|
@@ -7285,7 +7635,7 @@ class SkeletonPreset {
|
|
|
7285
7635
|
formColumns = computed(() => (this.columns() === 2 ? 2 : 1), /* @ts-ignore */
|
|
7286
7636
|
...(ngDevMode ? [{ debugName: "formColumns" }] : /* istanbul ignore next */ []));
|
|
7287
7637
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: SkeletonPreset, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7288
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: SkeletonPreset, isStandalone: true, selector: "kf-skeleton-preset", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n [class]=\"'kf-skeleton-preset kf-skeleton-preset--' + variant()\"\n aria-busy=\"true\"\n [style.--kf-skeleton-preset-columns]=\"columns() ?? null\"\n>\n @if (label()) {\n <span class=\"kf-sr-only\" role=\"status\">{{ label() }}</span>\n }\n @switch (variant()) {\n @case ('kpi-grid') {\n <div class=\"kf-skeleton-preset__grid\" [class.kf-skeleton-preset__grid--fixed]=\"!!columns()\">\n @for (i of items(); track i) {\n <kf-stat-card [loading]=\"true\" icon=\"bell\" value=\"0\" label=\"Etiqueta\" note=\"Nota\" />\n }\n </div>\n }\n @case ('card-grid') {\n <div class=\"kf-skeleton-preset__grid\" [class.kf-skeleton-preset__grid--fixed]=\"!!columns()\">\n @for (i of items(); track i) {\n <kf-card gap=\"sm\" aria-hidden=\"true\">\n <kf-skeleton variant=\"rect\" height=\"7.5rem\" />\n <kf-skeleton width=\"60%\" height=\"1.25rem\" />\n <kf-skeleton />\n <kf-skeleton width=\"80%\" />\n </kf-card>\n }\n </div>\n }\n @case ('form') {\n <div\n class=\"kf-skeleton-preset__form\"\n [class.kf-skeleton-preset__form--two]=\"formColumns() === 2\"\n aria-hidden=\"true\"\n >\n @for (i of items(); track i) {\n <div class=\"kf-skeleton-preset__field\">\n <span\n class=\"kf-skeleton-preset__label kf-overline-text kf-bone\"\n style=\"--kf-bone-width: 30%\"\n >\n Etiqueta\n </span>\n <span class=\"kf-skeleton-preset__control\">\n <span class=\"kf-skeleton-preset__value kf-bone\" style=\"--kf-bone-width: 55%\"\n >Valor</span\n >\n </span>\n </div>\n }\n </div>\n }\n @case ('list') {\n <div class=\"kf-skeleton-preset__stack\">\n @for (i of items(); track i) {\n <kf-document-row [loading]=\"true\" title=\"Documento\" meta=\"Archivo \u00B7 120 KB\" />\n }\n </div>\n }\n @case ('table') {\n <kf-data-table\n [columns]=\"tableColumns()\"\n [rows]=\"[]\"\n [loading]=\"true\"\n [skeletonRows]=\"total()\"\n />\n }\n @case ('timeline') {\n <div class=\"kf-skeleton-preset__timeline\" aria-hidden=\"true\">\n <div class=\"kf-skeleton-preset__timeline-toolbar\">\n <span class=\"kf-skeleton-preset__timeline-heading kf-bone\" style=\"--kf-bone-width: 30%\">\n Etapas\n </span>\n <span class=\"kf-skeleton-preset__timeline-toggle kf-bone\" style=\"--kf-bone-width: 7rem\">\n Expandir todo\n </span>\n </div>\n <ol class=\"kf-skeleton-preset__timeline-list\">\n @for (i of items(); track i) {\n <li class=\"kf-skeleton-preset__timeline-group\">\n <span class=\"kf-skeleton-preset__timeline-node kf-bone-fill\"></span>\n <span class=\"kf-skeleton-preset__timeline-text\">\n <span\n class=\"kf-skeleton-preset__timeline-title kf-bone\"\n style=\"--kf-bone-width: 45%\"\n >\n Etapa\n </span>\n <span\n class=\"kf-skeleton-preset__timeline-meta kf-bone\"\n style=\"--kf-bone-width: 30%\"\n >\n Detalle\n </span>\n </span>\n </li>\n }\n </ol>\n </div>\n }\n @case ('detail-header') {\n <div class=\"kf-skeleton-preset__header\" aria-hidden=\"true\">\n <span class=\"kf-skeleton-preset__header-icon kf-bone-fill\"></span>\n <span class=\"kf-skeleton-preset__header-heading\">\n <span class=\"kf-skeleton-preset__header-title kf-bone\" style=\"--kf-bone-width: 40%\">\n T\u00EDtulo\n </span>\n <span class=\"kf-skeleton-preset__header-subtitle kf-bone\" style=\"--kf-bone-width: 60%\">\n Subt\u00EDtulo\n </span>\n </span>\n </div>\n }\n }\n</div>\n", styles: [".kf-overline-text{font-family:var(--kf-font-title);font-size:var(--kf-font-size-caption);font-weight:var(--kf-font-weight-medium);letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted)}.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}.kf-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}:host{display:block;font-family:var(--kf-font-body)}.kf-skeleton-preset__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr));gap:var(--kf-space-md)}.kf-skeleton-preset__grid--fixed{grid-template-columns:repeat(var(--kf-skeleton-preset-columns),minmax(0,1fr))}.kf-skeleton-preset__stack{display:flex;flex-direction:column;gap:var(--kf-space-sm)}.kf-skeleton-preset__form{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--kf-space-md)}.kf-skeleton-preset__form--two{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:640px){.kf-skeleton-preset__form--two{grid-template-columns:minmax(0,1fr)}}.kf-skeleton-preset__field{display:flex;flex-direction:column;gap:var(--kf-space-xs)}.kf-skeleton-preset__control{display:block;padding:var(--kf-space-sm) var(--kf-space-sm);background:var(--kf-color-surface);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm)}.kf-skeleton-preset__timeline{--_node: var(--kf-status-node-size, 2.125rem);--_gutter: var(--kf-space-sm);--_pad-y: var(--kf-space-sm);--_line: 2px;display:flex;flex-direction:column;gap:var(--kf-space-sm)}.kf-skeleton-preset__timeline-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm)}.kf-skeleton-preset__timeline-heading{font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-sm);font-weight:var(--kf-font-weight-title)}.kf-skeleton-preset__timeline-toggle{box-sizing:border-box;padding:6px var(--kf-space-sm);border:1px solid transparent;font-size:.85rem;font-weight:600;border-radius:var(--kf-radius-sm)}@media(max-width:640px),(pointer:coarse){.kf-skeleton-preset__timeline-toggle{min-height:44px}}.kf-skeleton-preset__timeline-list{list-style:none;margin:0;padding:0}.kf-skeleton-preset__timeline-group{position:relative;display:flex;align-items:flex-start;gap:var(--kf-space-md);box-sizing:border-box;min-height:2.75rem;padding:var(--_pad-y) var(--_gutter)}.kf-skeleton-preset__timeline-group:not(:last-child):before{content:\"\";position:absolute;inset-inline-start:calc(var(--_gutter) + var(--_node) / 2 - var(--_line) / 2);top:calc(var(--_pad-y) + var(--_node));bottom:calc(var(--kf-space-xs) - var(--_pad-y));width:var(--_line);background:var(--kf-color-border)}.kf-skeleton-preset__timeline-node{flex:none;width:var(--_node);height:var(--_node);border-radius:50%}.kf-skeleton-preset__timeline-text{flex:1;display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0;min-height:var(--_node)}.kf-skeleton-preset__timeline-title{font-weight:700;font-size:var(--kf-font-size-body)}.kf-skeleton-preset__timeline-meta{font-size:var(--kf-font-size-body-sm)}.kf-skeleton-preset__header{display:flex;align-items:center;gap:var(--kf-space-md);padding-bottom:var(--kf-space-lg);border-bottom:1px solid var(--kf-color-border)}.kf-skeleton-preset__header-icon{flex:none;width:52px;height:52px;border:1px solid transparent;border-radius:var(--kf-radius-md)}.kf-skeleton-preset__header-heading{flex:1 1 auto;display:flex;flex-direction:column;gap:2px;min-width:0}.kf-skeleton-preset__header-title{font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-md);font-weight:var(--kf-font-weight-title);line-height:1.2}.kf-skeleton-preset__header-subtitle{font-size:.9375rem}@media(max-width:900px){.kf-skeleton-preset__header-icon{width:40px;height:40px}.kf-skeleton-preset__header-title{font-size:var(--kf-font-size-title-sm)}.kf-skeleton-preset__header-subtitle{font-size:var(--kf-font-size-label)}}\n"], dependencies: [{ kind: "component", type: Card, selector: "kf-card", inputs: ["flush", "gap", "loading"] }, { kind: "component", type: DataTable, selector: "kf-data-table", inputs: ["columns", "rows", "loading", "skeletonRows", "rowKey", "flush", "cardable", "defaultView", "showViewToggle", "cardMinWidth", "autoCards", "cardRows", "selectable", "selected", "rowSelectable", "selectLabel", "selectPageLabel", "selectedCountLabel", "stickyHeader", "maxHeight", "cardMenu", "cardMenuLabel", "cardOpenLabel", "render", "cellTemplates", "density", "rowClickable", "rowFocusable", "cellAriaLabel", "ariaLabel", "currentRowKey", "pageSize", "pageSizeOptions", "page", "keepPageOnRowsChange", "itemLabel", "sort", "view"], outputs: ["selectedChange", "cardMenuSelect", "rowClick", "cellClick", "pageChange", "pageSizeChange", "sortChange", "viewChange"] }, { kind: "component", type: DocumentRow, selector: "kf-document-row", inputs: ["icon", "tone", "title", "meta", "href", "downloadLabel", "pendingLabel", "loading"] }, { kind: "component", type: Skeleton, selector: "kf-skeleton", inputs: ["variant", "width", "height"] }, { kind: "component", type: StatCard, selector: "kf-stat-card", inputs: ["icon", "tone", "value", "label", "note", "bar", "hint", "badge", "badgeTone", "pressed", "density", "loading", "clickable"], outputs: ["cardClick"] }] });
|
|
7638
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: SkeletonPreset, isStandalone: true, selector: "kf-skeleton-preset", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n [class]=\"'kf-skeleton-preset kf-skeleton-preset--' + variant()\"\n aria-busy=\"true\"\n [style.--kf-skeleton-preset-columns]=\"columns() ?? null\"\n>\n @if (label()) {\n <span class=\"kf-sr-only\" role=\"status\">{{ label() }}</span>\n }\n @switch (variant()) {\n @case ('kpi-grid') {\n <div class=\"kf-skeleton-preset__grid\" [class.kf-skeleton-preset__grid--fixed]=\"!!columns()\">\n @for (i of items(); track i) {\n <kf-stat-card [loading]=\"true\" icon=\"bell\" value=\"0\" label=\"Etiqueta\" note=\"Nota\" />\n }\n </div>\n }\n @case ('card-grid') {\n <div class=\"kf-skeleton-preset__grid\" [class.kf-skeleton-preset__grid--fixed]=\"!!columns()\">\n @for (i of items(); track i) {\n <kf-card gap=\"sm\" aria-hidden=\"true\">\n <kf-skeleton variant=\"rect\" height=\"7.5rem\" />\n <kf-skeleton width=\"60%\" height=\"1.25rem\" />\n <kf-skeleton />\n <kf-skeleton width=\"80%\" />\n </kf-card>\n }\n </div>\n }\n @case ('form') {\n <div\n class=\"kf-skeleton-preset__form\"\n [class.kf-skeleton-preset__form--two]=\"formColumns() === 2\"\n aria-hidden=\"true\"\n >\n @for (i of items(); track i) {\n <div class=\"kf-skeleton-preset__field\">\n <span\n class=\"kf-skeleton-preset__label kf-overline-text kf-bone\"\n style=\"--kf-bone-width: 30%\"\n >\n Etiqueta\n </span>\n <span class=\"kf-skeleton-preset__control\">\n <span class=\"kf-skeleton-preset__value kf-bone\" style=\"--kf-bone-width: 55%\"\n >Valor</span\n >\n </span>\n </div>\n }\n </div>\n }\n @case ('list') {\n <div class=\"kf-skeleton-preset__stack\">\n @for (i of items(); track i) {\n <kf-document-row [loading]=\"true\" title=\"Documento\" meta=\"Archivo \u00B7 120 KB\" />\n }\n </div>\n }\n @case ('table') {\n <kf-data-table\n [columns]=\"tableColumns()\"\n [rows]=\"[]\"\n [loading]=\"true\"\n [skeletonRows]=\"total()\"\n />\n }\n @case ('timeline') {\n <div class=\"kf-skeleton-preset__timeline\" aria-hidden=\"true\">\n <div class=\"kf-skeleton-preset__timeline-toolbar\">\n <span class=\"kf-skeleton-preset__timeline-heading kf-bone\" style=\"--kf-bone-width: 30%\">\n Etapas\n </span>\n <span class=\"kf-skeleton-preset__timeline-toggle kf-bone\" style=\"--kf-bone-width: 7rem\">\n Expandir todo\n </span>\n </div>\n <ol class=\"kf-skeleton-preset__timeline-list\">\n @for (i of items(); track i) {\n <li class=\"kf-skeleton-preset__timeline-group\">\n <span class=\"kf-skeleton-preset__timeline-node kf-bone-fill\"></span>\n <span class=\"kf-skeleton-preset__timeline-text\">\n <span\n class=\"kf-skeleton-preset__timeline-title kf-bone\"\n style=\"--kf-bone-width: 45%\"\n >\n Etapa\n </span>\n <span\n class=\"kf-skeleton-preset__timeline-meta kf-bone\"\n style=\"--kf-bone-width: 30%\"\n >\n Detalle\n </span>\n </span>\n </li>\n }\n </ol>\n </div>\n }\n @case ('detail-header') {\n <div class=\"kf-skeleton-preset__header\" aria-hidden=\"true\">\n <span class=\"kf-skeleton-preset__header-icon kf-bone-fill\"></span>\n <span class=\"kf-skeleton-preset__header-heading\">\n <span class=\"kf-skeleton-preset__header-title kf-bone\" style=\"--kf-bone-width: 40%\">\n T\u00EDtulo\n </span>\n <span class=\"kf-skeleton-preset__header-subtitle kf-bone\" style=\"--kf-bone-width: 60%\">\n Subt\u00EDtulo\n </span>\n </span>\n </div>\n }\n }\n</div>\n", styles: [".kf-overline-text{font-family:var(--kf-font-title);font-size:var(--kf-font-size-caption);font-weight:var(--kf-font-weight-medium);letter-spacing:.04em;text-transform:uppercase;color:var(--kf-color-text-muted)}.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{background:linear-gradient(90deg,var(--kf-color-border) 25%,var(--kf-color-surface) 37%,var(--kf-color-border) 63%);background-size:400% 100%;animation:kf-bone-shimmer 1.4s ease infinite}.kf-bone{display:block;box-sizing:border-box;width:var(--kf-bone-width, 60%);max-width:100%;overflow:hidden;white-space:nowrap;border-radius:var(--kf-radius-xs);-webkit-user-select:none;user-select:none;pointer-events:none}.kf-bone.kf-bone{color:transparent!important;-webkit-text-fill-color:transparent}.kf-bone>*{visibility:hidden}@keyframes kf-bone-shimmer{0%{background-position:100% 0}to{background-position:0 0}}@media(prefers-reduced-motion:reduce){.kf-bone.kf-bone,.kf-bone-fill.kf-bone-fill,.kf-bone-overlay.kf-bone-overlay:after{animation:none;background:var(--kf-color-border)}}.kf-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}:host{display:block;font-family:var(--kf-font-body)}.kf-skeleton-preset__grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,15rem),1fr));gap:var(--kf-space-md)}.kf-skeleton-preset__grid--fixed{grid-template-columns:repeat(var(--kf-skeleton-preset-columns),minmax(0,1fr))}.kf-skeleton-preset__stack{display:flex;flex-direction:column;gap:var(--kf-space-sm)}.kf-skeleton-preset__form{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--kf-space-md)}.kf-skeleton-preset__form--two{grid-template-columns:repeat(2,minmax(0,1fr))}@media(max-width:640px){.kf-skeleton-preset__form--two{grid-template-columns:minmax(0,1fr)}}.kf-skeleton-preset__field{display:flex;flex-direction:column;gap:var(--kf-space-xs)}.kf-skeleton-preset__control{display:block;padding:var(--kf-space-sm) var(--kf-space-sm);background:var(--kf-color-surface);border:1px solid var(--kf-color-border);border-radius:var(--kf-radius-sm)}.kf-skeleton-preset__timeline{--_node: var(--kf-status-node-size, 2.125rem);--_gutter: var(--kf-space-sm);--_pad-y: var(--kf-space-sm);--_line: 2px;display:flex;flex-direction:column;gap:var(--kf-space-sm)}.kf-skeleton-preset__timeline-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-sm)}.kf-skeleton-preset__timeline-heading{font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-sm);font-weight:var(--kf-font-weight-title)}.kf-skeleton-preset__timeline-toggle{box-sizing:border-box;padding:6px var(--kf-space-sm);border:1px solid transparent;font-size:.85rem;font-weight:600;border-radius:var(--kf-radius-sm)}@media(max-width:640px),(pointer:coarse){.kf-skeleton-preset__timeline-toggle{min-height:44px}}.kf-skeleton-preset__timeline-list{list-style:none;margin:0;padding:0}.kf-skeleton-preset__timeline-group{position:relative;display:flex;align-items:flex-start;gap:var(--kf-space-md);box-sizing:border-box;min-height:2.75rem;padding:var(--_pad-y) var(--_gutter)}.kf-skeleton-preset__timeline-group:not(:last-child):before{content:\"\";position:absolute;inset-inline-start:calc(var(--_gutter) + var(--_node) / 2 - var(--_line) / 2);top:calc(var(--_pad-y) + var(--_node));bottom:calc(var(--kf-space-xs) - var(--_pad-y));width:var(--_line);background:var(--kf-color-border)}.kf-skeleton-preset__timeline-node{flex:none;width:var(--_node);height:var(--_node);border-radius:50%}.kf-skeleton-preset__timeline-text{flex:1;display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:0;min-height:var(--_node)}.kf-skeleton-preset__timeline-title{font-weight:700;font-size:var(--kf-font-size-body)}.kf-skeleton-preset__timeline-meta{font-size:var(--kf-font-size-body-sm)}.kf-skeleton-preset__header{display:flex;align-items:center;gap:var(--kf-space-md);padding-bottom:var(--kf-space-lg);border-bottom:1px solid var(--kf-color-border)}.kf-skeleton-preset__header-icon{flex:none;width:52px;height:52px;border:1px solid transparent;border-radius:var(--kf-radius-md)}.kf-skeleton-preset__header-heading{flex:1 1 auto;display:flex;flex-direction:column;gap:2px;min-width:0}.kf-skeleton-preset__header-title{font-family:var(--kf-font-title);font-size:var(--kf-font-size-title-md);font-weight:var(--kf-font-weight-title);line-height:1.2}.kf-skeleton-preset__header-subtitle{font-size:.9375rem}@media(max-width:900px){.kf-skeleton-preset__header-icon{width:40px;height:40px}.kf-skeleton-preset__header-title{font-size:var(--kf-font-size-title-sm)}.kf-skeleton-preset__header-subtitle{font-size:var(--kf-font-size-label)}}\n"], dependencies: [{ kind: "component", type: Card, selector: "kf-card", inputs: ["flush", "gap", "loading"] }, { kind: "component", type: DataTable, selector: "kf-data-table", inputs: ["columns", "rows", "loading", "skeletonRows", "rowKey", "flush", "cardable", "defaultView", "showViewToggle", "cardMinWidth", "autoCards", "cardRows", "selectable", "selected", "rowSelectable", "selectLabel", "selectPageLabel", "selectedCountLabel", "stickyHeader", "maxHeight", "cardMenu", "cardMenuLabel", "cardOpenLabel", "render", "cellTemplates", "density", "rowClickable", "rowFocusable", "cellAriaLabel", "ariaLabel", "currentRowKey", "pageSize", "pageSizeOptions", "page", "keepPageOnRowsChange", "itemLabel", "sort", "view"], outputs: ["selectedChange", "cardMenuSelect", "rowClick", "cellClick", "pageChange", "pageSizeChange", "sortChange", "viewChange"] }, { kind: "component", type: DocumentRow, selector: "kf-document-row", inputs: ["icon", "tone", "title", "meta", "href", "downloadLabel", "pendingLabel", "loading"] }, { kind: "component", type: Skeleton, selector: "kf-skeleton", inputs: ["variant", "width", "height"] }, { kind: "component", type: StatCard, selector: "kf-stat-card", inputs: ["icon", "tone", "value", "label", "note", "bar", "hint", "badge", "badgeTone", "pressed", "ariaExpanded", "ariaHaspopup", "ariaControls", "density", "loading", "clickable"], outputs: ["cardClick"] }] });
|
|
7289
7639
|
}
|
|
7290
7640
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: SkeletonPreset, decorators: [{
|
|
7291
7641
|
type: Component,
|
|
@@ -7940,7 +8290,7 @@ class ConfirmDialog {
|
|
|
7940
8290
|
this.host.nativeElement.querySelector('[aria-invalid="true"]')?.focus();
|
|
7941
8291
|
}
|
|
7942
8292
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ConfirmDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7943
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: ConfirmDialog, isStandalone: true, selector: "kf-confirm-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, consequence: { classPropertyName: "consequence", publicName: "consequence", isSignal: true, isRequired: false, transformFunction: null }, reasonLabel: { classPropertyName: "reasonLabel", publicName: "reasonLabel", isSignal: true, isRequired: false, transformFunction: null }, reasonMinLength: { classPropertyName: "reasonMinLength", publicName: "reasonMinLength", isSignal: true, isRequired: false, transformFunction: null }, reasonPlaceholder: { classPropertyName: "reasonPlaceholder", publicName: "reasonPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, reasonHint: { classPropertyName: "reasonHint", publicName: "reasonHint", isSignal: true, isRequired: false, transformFunction: null }, reasonError: { classPropertyName: "reasonError", publicName: "reasonError", isSignal: true, isRequired: false, transformFunction: null }, acknowledgeLabel: { classPropertyName: "acknowledgeLabel", publicName: "acknowledgeLabel", isSignal: true, isRequired: false, transformFunction: null }, acknowledgeError: { classPropertyName: "acknowledgeError", publicName: "acknowledgeError", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", confirmed: "confirmed", cancelled: "cancelled" }, ngImport: i0, template: "<kf-modal\n size=\"sm\"\n [open]=\"open()\"\n [title]=\"title()\"\n [dismissible]=\"!busy()\"\n [initialFocus]=\"initialFocus()\"\n (openChange)=\"onOpenChange($event)\"\n>\n <div class=\"kf-confirm-dialog__body\">\n @if (icon(); as iconName) {\n <span\n class=\"kf-confirm-dialog__icon\"\n [class.kf-confirm-dialog__icon--danger]=\"tone() === 'danger'\"\n >\n <kf-icon [name]=\"iconName\" size=\"lg\" />\n </span>\n }\n @if (message(); as text) {\n <p class=\"kf-confirm-dialog__message\">{{ text }}</p>\n }\n <ng-content />\n @if (consequence(); as text) {\n <kf-alert [tone]=\"tone() === 'danger' ? 'warn' : 'info'\">{{ text }}</kf-alert>\n }\n @if (reasonLabel(); as label) {\n <kf-textarea\n class=\"kf-confirm-dialog__reason\"\n required\n [label]=\"label\"\n [placeholder]=\"reasonPlaceholder()\"\n [hint]=\"reasonHint()\"\n [invalid]=\"showReasonError()\"\n [errorMessage]=\"showReasonError() ? reasonErrorText() : undefined\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"reason()\"\n (ngModelChange)=\"onReason($event)\"\n />\n }\n @if (acknowledgeLabel(); as label) {\n <div class=\"kf-confirm-dialog__acknowledge\">\n <kf-checkbox\n [label]=\"label\"\n [checked]=\"acknowledged()\"\n [invalid]=\"showAcknowledgeError()\"\n (checkedChange)=\"onAcknowledge($event)\"\n />\n @if (showAcknowledgeError()) {\n <span class=\"kf-confirm-dialog__error kf-field-error\" role=\"alert\">{{\n acknowledgeError()\n }}</span>\n }\n </div>\n }\n </div>\n <div footer class=\"kf-confirm-dialog__actions\">\n <kf-button\n class=\"kf-confirm-dialog__cancel\"\n variant=\"outline\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"cancel()\"\n >\n {{ cancelLabel() }}\n </kf-button>\n <kf-button\n class=\"kf-confirm-dialog__confirm\"\n type=\"button\"\n [variant]=\"tone() === 'danger' ? 'danger' : 'primary'\"\n [loading]=\"busy()\"\n (click)=\"confirm()\"\n >\n {{ confirmLabel() }}\n </kf-button>\n </div>\n</kf-modal>\n", styles: [".kf-field-hint{font-size:.75rem;color:var(--kf-color-text-muted)}.kf-field-error{display:flex;align-items:center;gap:var(--kf-space-xs);font-size:.75rem;font-weight:600;color:var(--kf-color-error-strong)}:host{display:contents}.kf-confirm-dialog__body{display:flex;flex-direction:column;gap:var(--kf-space-md)}.kf-confirm-dialog__message{margin:0;font-size:var(--kf-font-size-body-sm);color:var(--kf-color-text-muted)}.kf-confirm-dialog__icon{display:flex;align-items:center;justify-content:center;align-self:center;width:48px;height:48px;border-radius:var(--kf-radius-pill);background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-confirm-dialog__icon--danger{background:var(--kf-color-error-soft);color:var(--kf-color-error-strong)}.kf-confirm-dialog__acknowledge{display:flex;flex-direction:column;gap:var(--kf-space-xs)}.kf-confirm-dialog__actions{display:flex;justify-content:flex-end;gap:var(--kf-space-sm)}@media(max-width:480px){.kf-confirm-dialog__body{text-align:center}.kf-confirm-dialog__actions{flex-direction:column-reverse;align-items:stretch}}\n"], dependencies: [{ kind: "component", type: Alert, selector: "kf-alert", inputs: ["tone", "variant", "appearance", "iconAlign", "title", "dismissible", "open"], outputs: ["openChange"] }, { kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Checkbox, selector: "kf-checkbox", inputs: ["label", "ariaLabel", "checked", "disabled", "indeterminate", "invalid"], outputs: ["checkedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Modal, selector: "kf-modal", inputs: ["title", "open", "dismissible", "width", "size", "dividers", "maxHeight", "fullscreenOnMobile", "initialFocus"], outputs: ["openChange"] }, { kind: "component", type: Textarea, selector: "kf-textarea", inputs: ["label", "required", "hint", "invalid", "errorMessage", "disabled", "readonly", "placeholder", "minRows", "maxRows", "maxlength", "showCounter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8293
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: ConfirmDialog, isStandalone: true, selector: "kf-confirm-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, busy: { classPropertyName: "busy", publicName: "busy", isSignal: true, isRequired: false, transformFunction: null }, consequence: { classPropertyName: "consequence", publicName: "consequence", isSignal: true, isRequired: false, transformFunction: null }, reasonLabel: { classPropertyName: "reasonLabel", publicName: "reasonLabel", isSignal: true, isRequired: false, transformFunction: null }, reasonMinLength: { classPropertyName: "reasonMinLength", publicName: "reasonMinLength", isSignal: true, isRequired: false, transformFunction: null }, reasonPlaceholder: { classPropertyName: "reasonPlaceholder", publicName: "reasonPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, reasonHint: { classPropertyName: "reasonHint", publicName: "reasonHint", isSignal: true, isRequired: false, transformFunction: null }, reasonError: { classPropertyName: "reasonError", publicName: "reasonError", isSignal: true, isRequired: false, transformFunction: null }, acknowledgeLabel: { classPropertyName: "acknowledgeLabel", publicName: "acknowledgeLabel", isSignal: true, isRequired: false, transformFunction: null }, acknowledgeError: { classPropertyName: "acknowledgeError", publicName: "acknowledgeError", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", confirmed: "confirmed", cancelled: "cancelled" }, ngImport: i0, template: "<kf-modal\n size=\"sm\"\n [open]=\"open()\"\n [title]=\"title()\"\n [dismissible]=\"!busy()\"\n [initialFocus]=\"initialFocus()\"\n (openChange)=\"onOpenChange($event)\"\n>\n <div class=\"kf-confirm-dialog__body\">\n @if (icon(); as iconName) {\n <span\n class=\"kf-confirm-dialog__icon\"\n [class.kf-confirm-dialog__icon--danger]=\"tone() === 'danger'\"\n >\n <kf-icon [name]=\"iconName\" size=\"lg\" />\n </span>\n }\n @if (message(); as text) {\n <p class=\"kf-confirm-dialog__message\">{{ text }}</p>\n }\n <ng-content />\n @if (consequence(); as text) {\n <kf-alert [tone]=\"tone() === 'danger' ? 'warn' : 'info'\">{{ text }}</kf-alert>\n }\n @if (reasonLabel(); as label) {\n <kf-textarea\n class=\"kf-confirm-dialog__reason\"\n required\n [label]=\"label\"\n [placeholder]=\"reasonPlaceholder()\"\n [hint]=\"reasonHint()\"\n [invalid]=\"showReasonError()\"\n [errorMessage]=\"showReasonError() ? reasonErrorText() : undefined\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"reason()\"\n (ngModelChange)=\"onReason($event)\"\n />\n }\n @if (acknowledgeLabel(); as label) {\n <div class=\"kf-confirm-dialog__acknowledge\">\n <kf-checkbox\n [label]=\"label\"\n [checked]=\"acknowledged()\"\n [invalid]=\"showAcknowledgeError()\"\n (checkedChange)=\"onAcknowledge($event)\"\n />\n @if (showAcknowledgeError()) {\n <span class=\"kf-confirm-dialog__error kf-field-error\" role=\"alert\">{{\n acknowledgeError()\n }}</span>\n }\n </div>\n }\n </div>\n <div footer class=\"kf-confirm-dialog__actions\">\n <kf-button\n class=\"kf-confirm-dialog__cancel\"\n variant=\"outline\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"cancel()\"\n >\n {{ cancelLabel() }}\n </kf-button>\n <kf-button\n class=\"kf-confirm-dialog__confirm\"\n type=\"button\"\n [variant]=\"tone() === 'danger' ? 'danger' : 'primary'\"\n [loading]=\"busy()\"\n (click)=\"confirm()\"\n >\n {{ confirmLabel() }}\n </kf-button>\n </div>\n</kf-modal>\n", styles: [".kf-field-hint{font-size:.75rem;color:var(--kf-color-text-muted)}.kf-field-error{display:flex;align-items:center;gap:var(--kf-space-xs);font-size:.75rem;font-weight:600;color:var(--kf-color-error-strong)}:host{display:contents}.kf-confirm-dialog__body{display:flex;flex-direction:column;gap:var(--kf-space-md)}.kf-confirm-dialog__message{margin:0;font-size:var(--kf-font-size-body-sm);color:var(--kf-color-text-muted)}.kf-confirm-dialog__icon{display:flex;align-items:center;justify-content:center;align-self:center;width:48px;height:48px;border-radius:var(--kf-radius-pill);background:var(--kf-color-primary-soft);color:var(--kf-color-primary)}.kf-confirm-dialog__icon--danger{background:var(--kf-color-error-soft);color:var(--kf-color-error-strong)}.kf-confirm-dialog__acknowledge{display:flex;flex-direction:column;gap:var(--kf-space-xs)}.kf-confirm-dialog__actions{display:flex;justify-content:flex-end;gap:var(--kf-space-sm)}@media(max-width:480px){.kf-confirm-dialog__body{text-align:center}.kf-confirm-dialog__actions{flex-direction:column-reverse;align-items:stretch}}\n"], dependencies: [{ kind: "component", type: Alert, selector: "kf-alert", inputs: ["tone", "variant", "appearance", "iconAlign", "title", "dismissible", "actionsInline", "open"], outputs: ["openChange"] }, { kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Checkbox, selector: "kf-checkbox", inputs: ["label", "ariaLabel", "checked", "disabled", "indeterminate", "invalid"], outputs: ["checkedChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Modal, selector: "kf-modal", inputs: ["title", "open", "dismissible", "width", "size", "dividers", "maxHeight", "fullscreenOnMobile", "initialFocus"], outputs: ["openChange"] }, { kind: "component", type: Textarea, selector: "kf-textarea", inputs: ["label", "required", "hint", "invalid", "errorMessage", "disabled", "readonly", "placeholder", "minRows", "maxRows", "maxlength", "showCounter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7944
8294
|
}
|
|
7945
8295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: ConfirmDialog, decorators: [{
|
|
7946
8296
|
type: Component,
|
|
@@ -8758,7 +9108,7 @@ class DateField {
|
|
|
8758
9108
|
?.focus();
|
|
8759
9109
|
}
|
|
8760
9110
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DateField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8761
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.0", type: DateField, isStandalone: true, selector: "kf-date-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, availableDates: { classPropertyName: "availableDates", publicName: "availableDates", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, parseErrorMessage: { classPropertyName: "parseErrorMessage", publicName: "parseErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, rangeErrorMessage: { classPropertyName: "rangeErrorMessage", publicName: "rangeErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, openCalendarLabel: { classPropertyName: "openCalendarLabel", publicName: "openCalendarLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "field", first: true, predicate: Input, descendants: true, isSignal: true }, { propertyName: "fieldHost", first: true, predicate: Input, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "panel", first: true, predicate: DropdownPanel, descendants: true, isSignal: true }, { propertyName: "sheetTemplate", first: true, predicate: ["sheetTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #calendarTemplate>\n <kf-calendar\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [availableDates]=\"availableDates()\"\n [monthNames]=\"monthNames()\"\n [weekdayLabels]=\"weekdayLabels()\"\n [weekdayNames]=\"weekdayNames()\"\n [ariaLabel]=\"label()\"\n (valueChange)=\"pick($event)\"\n />\n</ng-template>\n\n<kf-dropdown [(open)]=\"popoverOpen\" [anchor]=\"fieldHost()\" [autoFocus]=\"false\">\n <kf-input\n [label]=\"label()\"\n [hideLabel]=\"hideLabel()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [invalid]=\"fieldInvalid()\"\n [errorMessage]=\"fieldError()\"\n [hint]=\"hint()\"\n [placeholder]=\"placeholder()\"\n [maxlength]=\"maxLength()\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"text()\"\n (ngModelChange)=\"onText($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <kf-button\n kf-input-trailing\n class=\"kf-date-field__toggle\"\n variant=\"ghost\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"calendar\"\n type=\"button\"\n [ariaLabel]=\"openCalendarLabel()\"\n [ariaHaspopup]=\"'dialog'\"\n [ariaExpanded]=\"expanded()\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\"\n />\n </kf-input>\n <kf-dropdown-panel role=\"dialog\" [ariaLabel]=\"label()\">\n <ng-container [ngTemplateOutlet]=\"calendarTemplate\" />\n </kf-dropdown-panel>\n</kf-dropdown>\n\n<ng-template #sheetTemplate>\n <kf-drawer side=\"bottom\" role=\"dialog\" [title]=\"label()\" [(open)]=\"sheetOpen\">\n <div class=\"kf-date-field__sheet\">\n <ng-container [ngTemplateOutlet]=\"calendarTemplate\" />\n </div>\n </kf-drawer>\n</ng-template>\n", styles: [":host{display:block}kf-dropdown{display:block}.kf-date-field__sheet{display:flex;justify-content:center;padding:var(--kf-space-sm) 0 var(--kf-space-md)}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Calendar, selector: "kf-calendar", inputs: ["value", "month", "min", "max", "availableDates", "markedDates", "today", "loading", "ariaLabel", "monthNames", "weekdayLabels", "weekdayNames", "markedLabel", "previousMonthLabel", "nextMonthLabel"], outputs: ["valueChange", "monthChange"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack"], outputs: ["openChange"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "maxHeight", "width", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Input, selector: "kf-input", inputs: ["label", "size", "hideLabel", "required", "icon", "suffix", "hint", "invalid", "errorMessage", "disabled", "readonly", "type", "placeholder", "autocomplete", "name", "inputmode", "min", "max", "step", "maxlength", "toggleable", "ariaLabel", "clearable", "clearLabel"], outputs: ["cleared"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9111
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.0", type: DateField, isStandalone: true, selector: "kf-date-field", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, hideLabel: { classPropertyName: "hideLabel", publicName: "hideLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, availableDates: { classPropertyName: "availableDates", publicName: "availableDates", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, parseErrorMessage: { classPropertyName: "parseErrorMessage", publicName: "parseErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, rangeErrorMessage: { classPropertyName: "rangeErrorMessage", publicName: "rangeErrorMessage", isSignal: true, isRequired: false, transformFunction: null }, openCalendarLabel: { classPropertyName: "openCalendarLabel", publicName: "openCalendarLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, viewQueries: [{ propertyName: "field", first: true, predicate: Input, descendants: true, isSignal: true }, { propertyName: "fieldHost", first: true, predicate: Input, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "panel", first: true, predicate: DropdownPanel, descendants: true, isSignal: true }, { propertyName: "sheetTemplate", first: true, predicate: ["sheetTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-template #calendarTemplate>\n <kf-calendar\n [value]=\"value()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [availableDates]=\"availableDates()\"\n [monthNames]=\"monthNames()\"\n [weekdayLabels]=\"weekdayLabels()\"\n [weekdayNames]=\"weekdayNames()\"\n [ariaLabel]=\"label()\"\n (valueChange)=\"pick($event)\"\n />\n</ng-template>\n\n<kf-dropdown [(open)]=\"popoverOpen\" [anchor]=\"fieldHost()\" [autoFocus]=\"false\">\n <kf-input\n [label]=\"label()\"\n [hideLabel]=\"hideLabel()\"\n [required]=\"required()\"\n [disabled]=\"disabled()\"\n [invalid]=\"fieldInvalid()\"\n [errorMessage]=\"fieldError()\"\n [hint]=\"hint()\"\n [placeholder]=\"placeholder()\"\n [maxlength]=\"maxLength()\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n [ngModelOptions]=\"{ standalone: true }\"\n [ngModel]=\"text()\"\n (ngModelChange)=\"onText($event)\"\n (keydown)=\"onKeydown($event)\"\n >\n <kf-button\n kf-input-trailing\n class=\"kf-date-field__toggle\"\n variant=\"ghost\"\n shape=\"circle\"\n size=\"sm\"\n icon=\"calendar\"\n type=\"button\"\n [ariaLabel]=\"openCalendarLabel()\"\n [ariaHaspopup]=\"'dialog'\"\n [ariaExpanded]=\"expanded()\"\n [disabled]=\"disabled()\"\n (click)=\"toggle()\"\n />\n </kf-input>\n <kf-dropdown-panel role=\"dialog\" [ariaLabel]=\"label()\">\n <ng-container [ngTemplateOutlet]=\"calendarTemplate\" />\n </kf-dropdown-panel>\n</kf-dropdown>\n\n<ng-template #sheetTemplate>\n <kf-drawer side=\"bottom\" role=\"dialog\" [title]=\"label()\" [(open)]=\"sheetOpen\">\n <div class=\"kf-date-field__sheet\">\n <ng-container [ngTemplateOutlet]=\"calendarTemplate\" />\n </div>\n </kf-drawer>\n</ng-template>\n", styles: [":host{display:block}kf-dropdown{display:block}.kf-date-field__sheet{display:flex;justify-content:center;padding:var(--kf-space-sm) 0 var(--kf-space-md)}\n"], dependencies: [{ kind: "component", type: Button, selector: "kf-button", inputs: ["variant", "size", "shape", "disabled", "type", "icon", "block", "loading", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDisabled", "ariaControls", "ariaHaspopup"] }, { kind: "component", type: Calendar, selector: "kf-calendar", inputs: ["value", "month", "min", "max", "availableDates", "markedDates", "today", "loading", "ariaLabel", "monthNames", "weekdayLabels", "weekdayNames", "markedLabel", "previousMonthLabel", "nextMonthLabel"], outputs: ["valueChange", "monthChange"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack", "mountInOverlay"], outputs: ["openChange"] }, { kind: "component", type: Dropdown, selector: "kf-dropdown", inputs: ["open", "anchor", "autoFocus"], outputs: ["openChange"] }, { kind: "component", type: DropdownPanel, selector: "kf-dropdown-panel", inputs: ["variant", "role", "maxHeight", "width", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Input, selector: "kf-input", inputs: ["label", "size", "hideLabel", "required", "icon", "suffix", "hint", "invalid", "errorMessage", "disabled", "readonly", "type", "placeholder", "autocomplete", "name", "inputmode", "min", "max", "step", "maxlength", "toggleable", "ariaLabel", "clearable", "clearLabel"], outputs: ["cleared"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8762
9112
|
}
|
|
8763
9113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: DateField, decorators: [{
|
|
8764
9114
|
type: Component,
|
|
@@ -9645,7 +9995,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImpor
|
|
|
9645
9995
|
* horizontal (para mobile: los filtros no ocupan más alto que una fila); el
|
|
9646
9996
|
* default `wrap` los reparte en varias líneas. `deselectable` permite
|
|
9647
9997
|
* quitar el filtro volviendo a tocar el chip activo (emite `''`), para el
|
|
9648
|
-
* caso "ningún chip = sin filtro".
|
|
9998
|
+
* caso "ningún chip = sin filtro". En `scroll`, cuando el chip activo cambia
|
|
9999
|
+
* (también al montar con un `value` inicial, ej. un filtro que viene en la
|
|
10000
|
+
* URL) el grupo se desplaza lo mínimo necesario para que quede a la vista;
|
|
10001
|
+
* solo mueve el scroll horizontal del propio grupo, nunca el de la página, y
|
|
10002
|
+
* no se repite cuando solo cambia un contador.
|
|
9649
10003
|
*
|
|
9650
10004
|
* <kf-filter-chips ariaLabel="Filtrar por estado"
|
|
9651
10005
|
* [options]="[{ value: '', label: 'Todas', count: 12 }]"
|
|
@@ -9666,9 +10020,24 @@ class FilterChips {
|
|
|
9666
10020
|
/** Tocar el chip activo lo desactiva y emite `''`. Default `false` (comportamiento histórico). */
|
|
9667
10021
|
deselectable = input(false, { ...(ngDevMode ? { debugName: "deselectable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
9668
10022
|
valueChange = output();
|
|
10023
|
+
group = viewChild.required('group', /* @ts-ignore */
|
|
10024
|
+
...(ngDevMode ? [{ debugName: "group" }] : /* istanbul ignore next */ []));
|
|
9669
10025
|
/** Normaliza cada opción string/objeto a la forma `{ value, label, count? }`. */
|
|
9670
10026
|
normalizedOptions = computed(() => this.options().map((option) => typeof option === 'string' ? { value: option, label: option } : option), /* @ts-ignore */
|
|
9671
10027
|
...(ngDevMode ? [{ debugName: "normalizedOptions" }] : /* istanbul ignore next */ []));
|
|
10028
|
+
/** Posición del chip activo (-1 si ninguno). Un contador nuevo no la cambia, así no re-dispara el scroll. */
|
|
10029
|
+
activeIndex = computed(() => this.normalizedOptions().findIndex((option) => option.value === this.value()), /* @ts-ignore */
|
|
10030
|
+
...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
10031
|
+
constructor() {
|
|
10032
|
+
afterRenderEffect(() => {
|
|
10033
|
+
const index = this.activeIndex();
|
|
10034
|
+
if (this.layout() !== 'scroll' || index < 0)
|
|
10035
|
+
return;
|
|
10036
|
+
const chip = this.group().nativeElement.children.item(index);
|
|
10037
|
+
if (chip)
|
|
10038
|
+
this.revealHorizontally(this.group().nativeElement, chip);
|
|
10039
|
+
});
|
|
10040
|
+
}
|
|
9672
10041
|
select(value) {
|
|
9673
10042
|
if (value === this.value()) {
|
|
9674
10043
|
if (this.deselectable() && value !== '') {
|
|
@@ -9678,13 +10047,28 @@ class FilterChips {
|
|
|
9678
10047
|
}
|
|
9679
10048
|
this.valueChange.emit(value);
|
|
9680
10049
|
}
|
|
10050
|
+
/**
|
|
10051
|
+
* Desplaza el grupo lo mínimo para que el chip entre completo. Se ajusta
|
|
10052
|
+
* `scrollLeft` a mano (y no `scrollIntoView`) porque este último también
|
|
10053
|
+
* puede mover el scroll vertical de la página.
|
|
10054
|
+
*/
|
|
10055
|
+
revealHorizontally(group, chip) {
|
|
10056
|
+
const groupBox = group.getBoundingClientRect();
|
|
10057
|
+
const chipBox = chip.getBoundingClientRect();
|
|
10058
|
+
if (chipBox.left < groupBox.left) {
|
|
10059
|
+
group.scrollLeft -= groupBox.left - chipBox.left;
|
|
10060
|
+
}
|
|
10061
|
+
else if (chipBox.right > groupBox.right) {
|
|
10062
|
+
group.scrollLeft += chipBox.right - groupBox.right;
|
|
10063
|
+
}
|
|
10064
|
+
}
|
|
9681
10065
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: FilterChips, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9682
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: FilterChips, isStandalone: true, selector: "kf-filter-chips", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, deselectable: { classPropertyName: "deselectable", publicName: "deselectable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: "<div\n class=\"kf-filter-chips\"\n [class.kf-filter-chips--scroll]=\"layout() === 'scroll'\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n>\n @for (option of normalizedOptions(); track option.value) {\n <button\n type=\"button\"\n class=\"kf-filter-chips__chip\"\n [class.kf-filter-chips__chip--active]=\"option.value === value()\"\n [attr.aria-pressed]=\"option.value === value()\"\n (click)=\"select(option.value)\"\n >\n {{ option.label }}\n @if (option.count !== undefined) {\n <span class=\"kf-filter-chips__count\">{{ option.count }}</span>\n }\n </button>\n }\n</div>\n", styles: [":host{display:block}.kf-filter-chips{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs)}.kf-filter-chips--scroll{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:3px;margin:-3px}.kf-filter-chips__chip{display:inline-flex;align-items:center;gap:var(--kf-space-xs);font:inherit;flex:none;white-space:nowrap;padding:var(--kf-space-xs) var(--kf-filter-chips-padding-inline, var(--kf-space-md));border-radius:var(--kf-radius-pill);border:1px solid var(--kf-color-border);background:var(--kf-color-surface);color:var(--kf-color-text);cursor:pointer;transition:background .14s,border-color .14s,color .14s}.kf-filter-chips__chip:hover:not(.kf-filter-chips__chip--active){border-color:var(--kf-color-border-strong)}.kf-filter-chips__chip:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-filter-chips__chip--active{background:var(--kf-color-primary);border-color:var(--kf-color-primary);color:var(--kf-color-white)}.kf-filter-chips__count{font-size:var(--kf-font-size-caption);font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.kf-filter-chips__chip{transition:none}}\n"] });
|
|
10066
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: FilterChips, isStandalone: true, selector: "kf-filter-chips", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, deselectable: { classPropertyName: "deselectable", publicName: "deselectable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "group", first: true, predicate: ["group"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n #group\n class=\"kf-filter-chips\"\n [class.kf-filter-chips--scroll]=\"layout() === 'scroll'\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n>\n @for (option of normalizedOptions(); track option.value) {\n <button\n type=\"button\"\n class=\"kf-filter-chips__chip\"\n [class.kf-filter-chips__chip--active]=\"option.value === value()\"\n [attr.aria-pressed]=\"option.value === value()\"\n (click)=\"select(option.value)\"\n >\n {{ option.label }}\n @if (option.count !== undefined) {\n <span class=\"kf-filter-chips__count\">{{ option.count }}</span>\n }\n </button>\n }\n</div>\n", styles: [":host{display:block}.kf-filter-chips{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs)}.kf-filter-chips--scroll{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:3px;margin:-3px}.kf-filter-chips__chip{display:inline-flex;align-items:center;gap:var(--kf-space-xs);font:inherit;flex:none;white-space:nowrap;padding:var(--kf-space-xs) var(--kf-filter-chips-padding-inline, var(--kf-space-md));border-radius:var(--kf-radius-pill);border:1px solid var(--kf-color-border);background:var(--kf-color-surface);color:var(--kf-color-text);cursor:pointer;transition:background .14s,border-color .14s,color .14s}.kf-filter-chips__chip:hover:not(.kf-filter-chips__chip--active){border-color:var(--kf-color-border-strong)}.kf-filter-chips__chip:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-filter-chips__chip--active{background:var(--kf-color-primary);border-color:var(--kf-color-primary);color:var(--kf-color-white)}.kf-filter-chips__count{font-size:var(--kf-font-size-caption);font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.kf-filter-chips__chip{transition:none}}\n"] });
|
|
9683
10067
|
}
|
|
9684
10068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: FilterChips, decorators: [{
|
|
9685
10069
|
type: Component,
|
|
9686
|
-
args: [{ selector: 'kf-filter-chips', template: "<div\n class=\"kf-filter-chips\"\n [class.kf-filter-chips--scroll]=\"layout() === 'scroll'\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n>\n @for (option of normalizedOptions(); track option.value) {\n <button\n type=\"button\"\n class=\"kf-filter-chips__chip\"\n [class.kf-filter-chips__chip--active]=\"option.value === value()\"\n [attr.aria-pressed]=\"option.value === value()\"\n (click)=\"select(option.value)\"\n >\n {{ option.label }}\n @if (option.count !== undefined) {\n <span class=\"kf-filter-chips__count\">{{ option.count }}</span>\n }\n </button>\n }\n</div>\n", styles: [":host{display:block}.kf-filter-chips{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs)}.kf-filter-chips--scroll{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:3px;margin:-3px}.kf-filter-chips__chip{display:inline-flex;align-items:center;gap:var(--kf-space-xs);font:inherit;flex:none;white-space:nowrap;padding:var(--kf-space-xs) var(--kf-filter-chips-padding-inline, var(--kf-space-md));border-radius:var(--kf-radius-pill);border:1px solid var(--kf-color-border);background:var(--kf-color-surface);color:var(--kf-color-text);cursor:pointer;transition:background .14s,border-color .14s,color .14s}.kf-filter-chips__chip:hover:not(.kf-filter-chips__chip--active){border-color:var(--kf-color-border-strong)}.kf-filter-chips__chip:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-filter-chips__chip--active{background:var(--kf-color-primary);border-color:var(--kf-color-primary);color:var(--kf-color-white)}.kf-filter-chips__count{font-size:var(--kf-font-size-caption);font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.kf-filter-chips__chip{transition:none}}\n"] }]
|
|
9687
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], deselectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "deselectable", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
10070
|
+
args: [{ selector: 'kf-filter-chips', template: "<div\n #group\n class=\"kf-filter-chips\"\n [class.kf-filter-chips--scroll]=\"layout() === 'scroll'\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n>\n @for (option of normalizedOptions(); track option.value) {\n <button\n type=\"button\"\n class=\"kf-filter-chips__chip\"\n [class.kf-filter-chips__chip--active]=\"option.value === value()\"\n [attr.aria-pressed]=\"option.value === value()\"\n (click)=\"select(option.value)\"\n >\n {{ option.label }}\n @if (option.count !== undefined) {\n <span class=\"kf-filter-chips__count\">{{ option.count }}</span>\n }\n </button>\n }\n</div>\n", styles: [":host{display:block}.kf-filter-chips{display:flex;flex-wrap:wrap;gap:var(--kf-space-xs)}.kf-filter-chips--scroll{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:3px;margin:-3px}.kf-filter-chips__chip{display:inline-flex;align-items:center;gap:var(--kf-space-xs);font:inherit;flex:none;white-space:nowrap;padding:var(--kf-space-xs) var(--kf-filter-chips-padding-inline, var(--kf-space-md));border-radius:var(--kf-radius-pill);border:1px solid var(--kf-color-border);background:var(--kf-color-surface);color:var(--kf-color-text);cursor:pointer;transition:background .14s,border-color .14s,color .14s}.kf-filter-chips__chip:hover:not(.kf-filter-chips__chip--active){border-color:var(--kf-color-border-strong)}.kf-filter-chips__chip:focus-visible{outline:none;box-shadow:var(--kf-shadow-focus)}.kf-filter-chips__chip--active{background:var(--kf-color-primary);border-color:var(--kf-color-primary);color:var(--kf-color-white)}.kf-filter-chips__count{font-size:var(--kf-font-size-caption);font-variant-numeric:tabular-nums}@media(prefers-reduced-motion:reduce){.kf-filter-chips__chip{transition:none}}\n"] }]
|
|
10071
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], deselectable: [{ type: i0.Input, args: [{ isSignal: true, alias: "deselectable", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], group: [{ type: i0.ViewChild, args: ['group', { isSignal: true }] }] } });
|
|
9688
10072
|
|
|
9689
10073
|
const TABBABLE$1 = 'button:not([disabled])';
|
|
9690
10074
|
/**
|
|
@@ -12654,7 +13038,7 @@ class PortalHeader {
|
|
|
12654
13038
|
}, /* @ts-ignore */
|
|
12655
13039
|
...(ngDevMode ? [{ debugName: "thumbStyle" }] : /* istanbul ignore next */ []));
|
|
12656
13040
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: PortalHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12657
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: PortalHeader, isStandalone: true, selector: "kf-portal-header", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, brand: { classPropertyName: "brand", publicName: "brand", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null }, isAdmin: { classPropertyName: "isAdmin", publicName: "isAdmin", isSignal: true, isRequired: false, transformFunction: null }, adminActions: { classPropertyName: "adminActions", publicName: "adminActions", isSignal: true, isRequired: false, transformFunction: null }, navItems: { classPropertyName: "navItems", publicName: "navItems", isSignal: true, isRequired: false, transformFunction: null }, userInitials: { classPropertyName: "userInitials", publicName: "userInitials", isSignal: true, isRequired: true, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null }, userName: { classPropertyName: "userName", publicName: "userName", isSignal: true, isRequired: false, transformFunction: null }, showCart: { classPropertyName: "showCart", publicName: "showCart", isSignal: true, isRequired: false, transformFunction: null }, cartCount: { classPropertyName: "cartCount", publicName: "cartCount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sessionClick: "sessionClick", cartClick: "cartClick" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "attr.data-tone": "tone()" } }, viewQueries: [{ propertyName: "sessionButtonRef", first: true, predicate: ["sessionButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "navItemAnchors", predicate: ["navItemAnchor"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isAdmin()) {\n <div class=\"kf-portal-header__admin-bar\">\n <div class=\"kf-portal-header__admin-inner\">\n <kf-admin-badge inline />\n <div class=\"kf-portal-header__admin-actions\">\n @for (action of adminActions(); track action.label) {\n <a class=\"kf-portal-header__admin-action\" [href]=\"action.href\">{{ action.label }}</a>\n }\n </div>\n </div>\n </div>\n}\n<div class=\"kf-portal-header__brand-bar\">\n <div class=\"kf-portal-header__brand-inner\">\n <div class=\"kf-portal-header__top-row\">\n <div class=\"kf-portal-header__logo-group\">\n @if (logoSrc()) {\n <img class=\"kf-portal-header__logo-img\" [src]=\"logoSrc()\" [alt]=\"logoAlt() || brand()\" />\n } @else {\n <span class=\"kf-portal-header__logo\">{{ brand() }}</span>\n }\n @if (tagline()) {\n <span class=\"kf-portal-header__logo-sep\" aria-hidden=\"true\"></span>\n <span class=\"kf-portal-header__logo-tag\">{{ tagline() }}</span>\n }\n </div>\n\n <div class=\"kf-portal-header__actions\">\n @if (showCart()) {\n <button\n type=\"button\"\n class=\"kf-portal-header__cart\"\n [attr.aria-label]=\"cartAriaLabel()\"\n (click)=\"cartClick.emit()\"\n >\n <kf-icon name=\"cart\" size=\"md\" />\n @if (cartCount() > 0) {\n <span class=\"kf-portal-header__cart-count\" aria-hidden=\"true\">{{\n cartCountLabel()\n }}</span>\n }\n </button>\n }\n\n <button\n #sessionButton\n type=\"button\"\n class=\"kf-portal-header__session\"\n [class.kf-portal-header__session--expanded]=\"userName()\"\n (click)=\"sessionClick.emit()\"\n >\n @if (userName()) {\n <kf-avatar [initials]=\"userInitials()\" />\n <span class=\"kf-portal-header__session-who\">\n <span class=\"kf-portal-header__session-greeting\">Hola</span>\n <span class=\"kf-portal-header__session-name\">{{ userName() }}</span>\n </span>\n <kf-icon name=\"chevron-down\" size=\"sm\" class=\"kf-portal-header__session-chevron\" />\n } @else {\n <kf-avatar [initials]=\"userInitials()\" pill />\n }\n </button>\n\n <button\n type=\"button\"\n class=\"kf-portal-header__menu-toggle\"\n [attr.aria-expanded]=\"mobileMenuOpen()\"\n aria-label=\"Abrir men\u00FA de navegaci\u00F3n\"\n (click)=\"mobileMenuOpen.set(!mobileMenuOpen())\"\n >\n <kf-icon [name]=\"mobileMenuOpen() ? 'x' : 'menu'\" size=\"md\" />\n </button>\n </div>\n </div>\n\n <nav class=\"kf-portal-header__nav\">\n <span class=\"kf-portal-header__nav-thumb\" [style]=\"thumbStyle()\" aria-hidden=\"true\"></span>\n @for (item of navItems(); track item.label) {\n <a\n #navItemAnchor\n class=\"kf-portal-header__nav-item\"\n [class.kf-portal-header__nav-item--active]=\"item.active\"\n [href]=\"item.href\"\n >\n {{ item.label }}\n </a>\n }\n </nav>\n </div>\n</div>\n\n<kf-drawer [(open)]=\"mobileMenuOpen\" ariaLabel=\"Men\u00FA de navegaci\u00F3n\">\n <div kf-drawer-header>\n <ng-content select=\"[kf-portal-header-extra]\" />\n </div>\n @for (item of navItems(); track item.label) {\n <a\n class=\"kf-portal-header__mobile-nav-item\"\n [class.kf-portal-header__mobile-nav-item--active]=\"item.active\"\n [href]=\"item.href\"\n (click)=\"mobileMenuOpen.set(false)\"\n >\n @if (item.icon) {\n <kf-icon [name]=\"item.icon\" size=\"sm\" />\n }\n <span class=\"kf-portal-header__mobile-nav-item-label\">{{ item.label }}</span>\n <kf-icon name=\"chevron-right\" size=\"sm\" />\n </a>\n }\n <div kf-drawer-footer>\n <ng-content select=\"[kf-portal-header-footer]\" />\n </div>\n</kf-drawer>\n", styles: [":host{display:block;position:sticky;top:0;z-index:30;font-family:var(--kf-font-body)}.kf-portal-header__admin-bar{padding-block:var(--kf-space-xs);background:var(--kf-header-bg)}.kf-portal-header__admin-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-md);max-width:var(--kf-header-max-width, none);margin:0 auto;padding:0 var(--kf-space-lg)}.kf-portal-header__admin-actions{display:flex;gap:var(--kf-space-md)}.kf-portal-header__admin-action{font-size:var(--kf-font-size-label);font-weight:600;color:color-mix(in srgb,var(--kf-header-fg) 85%,transparent);text-decoration:none}.kf-portal-header__admin-action:hover{color:var(--kf-header-fg)}.kf-portal-header__brand-bar{background:var(--kf-header-bg);border-top:1px solid color-mix(in srgb,var(--kf-header-fg) 10%,transparent)}.kf-portal-header__brand-inner{display:flex;flex-direction:column;max-width:var(--kf-header-max-width, none);margin:0 auto;padding:0 var(--kf-space-lg)}.kf-portal-header__top-row{display:flex;align-items:center;gap:var(--kf-space-lg);min-height:60px;padding-block:var(--kf-space-sm) 4px}.kf-portal-header__logo-group{display:flex;align-items:center;gap:var(--kf-space-md);flex:1 1 auto;min-width:0}.kf-portal-header__logo{font-family:var(--kf-font-title);font-size:1.25rem;font-weight:700;letter-spacing:.02em;color:var(--kf-header-fg);text-transform:uppercase}.kf-portal-header__logo-img{height:28px;width:auto;display:block}.kf-portal-header__logo-sep{flex:none;width:1px;height:30px;background:color-mix(in srgb,var(--kf-header-fg) 20%,transparent)}.kf-portal-header__logo-tag{font-family:var(--kf-font-title);font-weight:400;font-size:1.1875rem;color:color-mix(in srgb,var(--kf-header-fg) 78%,transparent)}.kf-portal-header__actions{margin-left:auto;display:flex;align-items:center;gap:var(--kf-space-sm)}.kf-portal-header__cart{position:relative;flex:none;width:46px;height:46px;border-radius:var(--kf-radius-pill);border:1px solid color-mix(in srgb,var(--kf-header-fg) 18%,transparent);background:transparent;color:var(--kf-header-fg);display:grid;place-items:center;cursor:pointer}.kf-portal-header__cart-count{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--kf-header-bg);border-radius:var(--kf-radius-pill);background:var(--kf-color-primary);color:var(--kf-color-white);font-size:.6875rem;font-weight:700;line-height:1;pointer-events:none}.kf-portal-header__cart:hover{background:color-mix(in srgb,var(--kf-header-fg) 10%,transparent);border-color:color-mix(in srgb,var(--kf-header-fg) 30%,transparent)}.kf-portal-header__nav{display:flex;align-items:center;gap:2px;padding:4px;margin-bottom:var(--kf-space-sm);background:color-mix(in srgb,var(--kf-header-fg) 8%,transparent);border-radius:var(--kf-radius-pill);width:fit-content;max-width:100%;position:relative}.kf-portal-header__nav-thumb{position:absolute;top:4px;bottom:4px;left:0;background:var(--kf-header-fg);border-radius:var(--kf-radius-pill);transition:transform .25s cubic-bezier(.4,0,.2,1),width .25s cubic-bezier(.4,0,.2,1),opacity .15s linear;pointer-events:none}.kf-portal-header__nav-item{position:relative;padding:var(--kf-space-sm) var(--kf-space-md);border-radius:var(--kf-radius-pill);color:color-mix(in srgb,var(--kf-header-fg) 75%,transparent);font-size:.875rem;font-weight:600;text-decoration:none;white-space:nowrap;transition:background .14s,color .14s}.kf-portal-header__nav-item:hover:not(.kf-portal-header__nav-item--active){color:var(--kf-header-fg);background:color-mix(in srgb,var(--kf-header-fg) 8%,transparent)}.kf-portal-header__nav-item--active{color:var(--kf-color-ink)}:host([data-tone=\"light\"]) .kf-portal-header__nav-item--active{color:var(--kf-header-bg)}.kf-portal-header__session{flex:none;border:none;background:transparent;padding:0;cursor:pointer}.kf-portal-header__session--expanded{display:flex;align-items:center;gap:var(--kf-space-sm);padding:7px 12px 7px 8px;background:var(--kf-color-primary);border-radius:var(--kf-radius-pill)}.kf-portal-header__session--expanded:hover{background:var(--kf-color-primary-active)}.kf-portal-header__session-who{display:flex;flex-direction:column;line-height:1.2;color:var(--kf-color-white)}.kf-portal-header__session-greeting{font-size:.65625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:color-mix(in srgb,var(--kf-color-white) 70%,transparent)}.kf-portal-header__session-name{font-size:.875rem;font-weight:700;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-portal-header__session-chevron{color:color-mix(in srgb,var(--kf-color-white) 85%,transparent)}.kf-portal-header__menu-toggle{display:none;flex:none;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-header-fg);cursor:pointer}.kf-portal-header__menu-toggle:hover{background:color-mix(in srgb,var(--kf-header-fg) 10%,transparent)}.kf-portal-header__mobile-nav-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-xs);color:var(--kf-color-text);font-size:.9375rem;font-weight:600;text-decoration:none;border-radius:var(--kf-radius-sm)}.kf-portal-header__mobile-nav-item:hover{background:var(--kf-color-surface)}.kf-portal-header__mobile-nav-item--active{color:var(--kf-color-primary-active);background:var(--kf-color-primary-soft)}.kf-portal-header__mobile-nav-item-label{flex:1 1 auto}.kf-portal-header__mobile-nav-item kf-icon:last-child{color:color-mix(in srgb,var(--kf-color-ink) 35%,transparent)}@media(max-width:768px){.kf-portal-header__nav,.kf-portal-header__session{display:none}.kf-portal-header__menu-toggle{display:inline-flex}}\n"], dependencies: [{ kind: "component", type: AdminBadge, selector: "kf-admin-badge", inputs: ["inline"] }, { kind: "component", type: Avatar, selector: "kf-avatar", inputs: ["initials", "src", "round", "size", "pill"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack"], outputs: ["openChange"] }] });
|
|
13041
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.0", type: PortalHeader, isStandalone: true, selector: "kf-portal-header", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, brand: { classPropertyName: "brand", publicName: "brand", isSignal: true, isRequired: false, transformFunction: null }, logoSrc: { classPropertyName: "logoSrc", publicName: "logoSrc", isSignal: true, isRequired: false, transformFunction: null }, logoAlt: { classPropertyName: "logoAlt", publicName: "logoAlt", isSignal: true, isRequired: false, transformFunction: null }, isAdmin: { classPropertyName: "isAdmin", publicName: "isAdmin", isSignal: true, isRequired: false, transformFunction: null }, adminActions: { classPropertyName: "adminActions", publicName: "adminActions", isSignal: true, isRequired: false, transformFunction: null }, navItems: { classPropertyName: "navItems", publicName: "navItems", isSignal: true, isRequired: false, transformFunction: null }, userInitials: { classPropertyName: "userInitials", publicName: "userInitials", isSignal: true, isRequired: true, transformFunction: null }, tagline: { classPropertyName: "tagline", publicName: "tagline", isSignal: true, isRequired: false, transformFunction: null }, userName: { classPropertyName: "userName", publicName: "userName", isSignal: true, isRequired: false, transformFunction: null }, showCart: { classPropertyName: "showCart", publicName: "showCart", isSignal: true, isRequired: false, transformFunction: null }, cartCount: { classPropertyName: "cartCount", publicName: "cartCount", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sessionClick: "sessionClick", cartClick: "cartClick" }, host: { listeners: { "window:resize": "onWindowResize()" }, properties: { "attr.data-tone": "tone()" } }, viewQueries: [{ propertyName: "sessionButtonRef", first: true, predicate: ["sessionButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "navItemAnchors", predicate: ["navItemAnchor"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (isAdmin()) {\n <div class=\"kf-portal-header__admin-bar\">\n <div class=\"kf-portal-header__admin-inner\">\n <kf-admin-badge inline />\n <div class=\"kf-portal-header__admin-actions\">\n @for (action of adminActions(); track action.label) {\n <a class=\"kf-portal-header__admin-action\" [href]=\"action.href\">{{ action.label }}</a>\n }\n </div>\n </div>\n </div>\n}\n<div class=\"kf-portal-header__brand-bar\">\n <div class=\"kf-portal-header__brand-inner\">\n <div class=\"kf-portal-header__top-row\">\n <div class=\"kf-portal-header__logo-group\">\n @if (logoSrc()) {\n <img class=\"kf-portal-header__logo-img\" [src]=\"logoSrc()\" [alt]=\"logoAlt() || brand()\" />\n } @else {\n <span class=\"kf-portal-header__logo\">{{ brand() }}</span>\n }\n @if (tagline()) {\n <span class=\"kf-portal-header__logo-sep\" aria-hidden=\"true\"></span>\n <span class=\"kf-portal-header__logo-tag\">{{ tagline() }}</span>\n }\n </div>\n\n <div class=\"kf-portal-header__actions\">\n @if (showCart()) {\n <button\n type=\"button\"\n class=\"kf-portal-header__cart\"\n [attr.aria-label]=\"cartAriaLabel()\"\n (click)=\"cartClick.emit()\"\n >\n <kf-icon name=\"cart\" size=\"md\" />\n @if (cartCount() > 0) {\n <span class=\"kf-portal-header__cart-count\" aria-hidden=\"true\">{{\n cartCountLabel()\n }}</span>\n }\n </button>\n }\n\n <button\n #sessionButton\n type=\"button\"\n class=\"kf-portal-header__session\"\n [class.kf-portal-header__session--expanded]=\"userName()\"\n (click)=\"sessionClick.emit()\"\n >\n @if (userName()) {\n <kf-avatar [initials]=\"userInitials()\" />\n <span class=\"kf-portal-header__session-who\">\n <span class=\"kf-portal-header__session-greeting\">Hola</span>\n <span class=\"kf-portal-header__session-name\">{{ userName() }}</span>\n </span>\n <kf-icon name=\"chevron-down\" size=\"sm\" class=\"kf-portal-header__session-chevron\" />\n } @else {\n <kf-avatar [initials]=\"userInitials()\" pill />\n }\n </button>\n\n <button\n type=\"button\"\n class=\"kf-portal-header__menu-toggle\"\n [attr.aria-expanded]=\"mobileMenuOpen()\"\n aria-label=\"Abrir men\u00FA de navegaci\u00F3n\"\n (click)=\"mobileMenuOpen.set(!mobileMenuOpen())\"\n >\n <kf-icon [name]=\"mobileMenuOpen() ? 'x' : 'menu'\" size=\"md\" />\n </button>\n </div>\n </div>\n\n <nav class=\"kf-portal-header__nav\">\n <span class=\"kf-portal-header__nav-thumb\" [style]=\"thumbStyle()\" aria-hidden=\"true\"></span>\n @for (item of navItems(); track item.label) {\n <a\n #navItemAnchor\n class=\"kf-portal-header__nav-item\"\n [class.kf-portal-header__nav-item--active]=\"item.active\"\n [href]=\"item.href\"\n >\n {{ item.label }}\n </a>\n }\n </nav>\n </div>\n</div>\n\n<kf-drawer [(open)]=\"mobileMenuOpen\" ariaLabel=\"Men\u00FA de navegaci\u00F3n\">\n <div kf-drawer-header>\n <ng-content select=\"[kf-portal-header-extra]\" />\n </div>\n @for (item of navItems(); track item.label) {\n <a\n class=\"kf-portal-header__mobile-nav-item\"\n [class.kf-portal-header__mobile-nav-item--active]=\"item.active\"\n [href]=\"item.href\"\n (click)=\"mobileMenuOpen.set(false)\"\n >\n @if (item.icon) {\n <kf-icon [name]=\"item.icon\" size=\"sm\" />\n }\n <span class=\"kf-portal-header__mobile-nav-item-label\">{{ item.label }}</span>\n <kf-icon name=\"chevron-right\" size=\"sm\" />\n </a>\n }\n <div kf-drawer-footer>\n <ng-content select=\"[kf-portal-header-footer]\" />\n </div>\n</kf-drawer>\n", styles: [":host{display:block;position:sticky;top:0;z-index:30;font-family:var(--kf-font-body)}.kf-portal-header__admin-bar{padding-block:var(--kf-space-xs);background:var(--kf-header-bg)}.kf-portal-header__admin-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--kf-space-md);max-width:var(--kf-header-max-width, none);margin:0 auto;padding:0 var(--kf-space-lg)}.kf-portal-header__admin-actions{display:flex;gap:var(--kf-space-md)}.kf-portal-header__admin-action{font-size:var(--kf-font-size-label);font-weight:600;color:color-mix(in srgb,var(--kf-header-fg) 85%,transparent);text-decoration:none}.kf-portal-header__admin-action:hover{color:var(--kf-header-fg)}.kf-portal-header__brand-bar{background:var(--kf-header-bg);border-top:1px solid color-mix(in srgb,var(--kf-header-fg) 10%,transparent)}.kf-portal-header__brand-inner{display:flex;flex-direction:column;max-width:var(--kf-header-max-width, none);margin:0 auto;padding:0 var(--kf-space-lg)}.kf-portal-header__top-row{display:flex;align-items:center;gap:var(--kf-space-lg);min-height:60px;padding-block:var(--kf-space-sm) 4px}.kf-portal-header__logo-group{display:flex;align-items:center;gap:var(--kf-space-md);flex:1 1 auto;min-width:0}.kf-portal-header__logo{font-family:var(--kf-font-title);font-size:1.25rem;font-weight:700;letter-spacing:.02em;color:var(--kf-header-fg);text-transform:uppercase}.kf-portal-header__logo-img{height:28px;width:auto;display:block}.kf-portal-header__logo-sep{flex:none;width:1px;height:30px;background:color-mix(in srgb,var(--kf-header-fg) 20%,transparent)}.kf-portal-header__logo-tag{font-family:var(--kf-font-title);font-weight:400;font-size:1.1875rem;color:color-mix(in srgb,var(--kf-header-fg) 78%,transparent)}.kf-portal-header__actions{margin-left:auto;display:flex;align-items:center;gap:var(--kf-space-sm)}.kf-portal-header__cart{position:relative;flex:none;width:46px;height:46px;border-radius:var(--kf-radius-pill);border:1px solid color-mix(in srgb,var(--kf-header-fg) 18%,transparent);background:transparent;color:var(--kf-header-fg);display:grid;place-items:center;cursor:pointer}.kf-portal-header__cart-count{position:absolute;top:-4px;right:-4px;min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;border:2px solid var(--kf-header-bg);border-radius:var(--kf-radius-pill);background:var(--kf-color-primary);color:var(--kf-color-white);font-size:.6875rem;font-weight:700;line-height:1;pointer-events:none}.kf-portal-header__cart:hover{background:color-mix(in srgb,var(--kf-header-fg) 10%,transparent);border-color:color-mix(in srgb,var(--kf-header-fg) 30%,transparent)}.kf-portal-header__nav{display:flex;align-items:center;gap:2px;padding:4px;margin-bottom:var(--kf-space-sm);background:color-mix(in srgb,var(--kf-header-fg) 8%,transparent);border-radius:var(--kf-radius-pill);width:fit-content;max-width:100%;position:relative}.kf-portal-header__nav-thumb{position:absolute;top:4px;bottom:4px;left:0;background:var(--kf-header-fg);border-radius:var(--kf-radius-pill);transition:transform .25s cubic-bezier(.4,0,.2,1),width .25s cubic-bezier(.4,0,.2,1),opacity .15s linear;pointer-events:none}.kf-portal-header__nav-item{position:relative;padding:var(--kf-space-sm) var(--kf-space-md);border-radius:var(--kf-radius-pill);color:color-mix(in srgb,var(--kf-header-fg) 75%,transparent);font-size:.875rem;font-weight:600;text-decoration:none;white-space:nowrap;transition:background .14s,color .14s}.kf-portal-header__nav-item:hover:not(.kf-portal-header__nav-item--active){color:var(--kf-header-fg);background:color-mix(in srgb,var(--kf-header-fg) 8%,transparent)}.kf-portal-header__nav-item--active{color:var(--kf-color-ink)}:host([data-tone=\"light\"]) .kf-portal-header__nav-item--active{color:var(--kf-header-bg)}.kf-portal-header__session{flex:none;border:none;background:transparent;padding:0;cursor:pointer}.kf-portal-header__session--expanded{display:flex;align-items:center;gap:var(--kf-space-sm);padding:7px 12px 7px 8px;background:var(--kf-color-primary);border-radius:var(--kf-radius-pill)}.kf-portal-header__session--expanded:hover{background:var(--kf-color-primary-active)}.kf-portal-header__session-who{display:flex;flex-direction:column;line-height:1.2;color:var(--kf-color-white)}.kf-portal-header__session-greeting{font-size:.65625rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:color-mix(in srgb,var(--kf-color-white) 70%,transparent)}.kf-portal-header__session-name{font-size:.875rem;font-weight:700;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kf-portal-header__session-chevron{color:color-mix(in srgb,var(--kf-color-white) 85%,transparent)}.kf-portal-header__menu-toggle{display:none;flex:none;align-items:center;justify-content:center;width:36px;height:36px;border:none;border-radius:var(--kf-radius-sm);background:transparent;color:var(--kf-header-fg);cursor:pointer}.kf-portal-header__menu-toggle:hover{background:color-mix(in srgb,var(--kf-header-fg) 10%,transparent)}.kf-portal-header__mobile-nav-item{display:flex;align-items:center;gap:var(--kf-space-sm);padding:var(--kf-space-sm) var(--kf-space-xs);color:var(--kf-color-text);font-size:.9375rem;font-weight:600;text-decoration:none;border-radius:var(--kf-radius-sm)}.kf-portal-header__mobile-nav-item:hover{background:var(--kf-color-surface)}.kf-portal-header__mobile-nav-item--active{color:var(--kf-color-primary-active);background:var(--kf-color-primary-soft)}.kf-portal-header__mobile-nav-item-label{flex:1 1 auto}.kf-portal-header__mobile-nav-item kf-icon:last-child{color:color-mix(in srgb,var(--kf-color-ink) 35%,transparent)}@media(max-width:768px){.kf-portal-header__nav,.kf-portal-header__session{display:none}.kf-portal-header__menu-toggle{display:inline-flex}}\n"], dependencies: [{ kind: "component", type: AdminBadge, selector: "kf-admin-badge", inputs: ["inline"] }, { kind: "component", type: Avatar, selector: "kf-avatar", inputs: ["initials", "src", "round", "size", "pill"] }, { kind: "component", type: Icon, selector: "kf-icon", inputs: ["name", "size", "rotate", "filled"] }, { kind: "component", type: Drawer, selector: "kf-drawer", inputs: ["open", "side", "role", "ariaLabel", "title", "closeLabel", "size", "sheetSize", "swipeToClose", "closeOnBack", "mountInOverlay"], outputs: ["openChange"] }] });
|
|
12658
13042
|
}
|
|
12659
13043
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.0", ngImport: i0, type: PortalHeader, decorators: [{
|
|
12660
13044
|
type: Component,
|