@solercia/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/fesm2022/solercia-ui-theme-studio.mjs +1872 -808
- package/fesm2022/solercia-ui-theme-studio.mjs.map +1 -1
- package/fesm2022/solercia-ui.mjs +284 -10
- package/fesm2022/solercia-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/solercia-ui-theme-studio.d.ts +185 -52
- package/types/solercia-ui.d.ts +89 -10
package/fesm2022/solercia-ui.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, ChangeDetectionStrategy, Component, signal, forwardRef, inject, ElementRef, effect, Directive, viewChild, HostListener, InjectionToken, numberAttribute, TemplateRef, model, contentChildren, linkedSignal, contentChild, untracked, Injectable, provideAppInitializer, DestroyRef, viewChildren } from '@angular/core';
|
|
2
|
+
import { input, output, computed, ChangeDetectionStrategy, Component, signal, forwardRef, inject, ElementRef, effect, Directive, viewChild, HostListener, InjectionToken, numberAttribute, TemplateRef, model, contentChildren, linkedSignal, contentChild, untracked, Injectable, provideAppInitializer, DestroyRef, viewChildren, CSP_NONCE } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
5
|
+
import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
|
|
6
6
|
import { Chart, LineController, BarController, DoughnutController, LineElement, PointElement, BarElement, ArcElement, CategoryScale, LinearScale, Legend, Tooltip, Filler } from 'chart.js';
|
|
7
7
|
import * as i1 from '@angular/cdk/drag-drop';
|
|
8
8
|
import { CdkDrag, CdkDropList, CdkDropListGroup } from '@angular/cdk/drag-drop';
|
|
@@ -6186,11 +6186,9 @@ class ThemeService {
|
|
|
6186
6186
|
* tema: uno inválido cae al default. Útil para hosts que ya tienen el tema en
|
|
6187
6187
|
* memoria (SSR, caché) o que no quieren implementar un ThemeSource.
|
|
6188
6188
|
*
|
|
6189
|
-
* MODO POR DEFECTO (BD): si el tema traído trae `meta.defaultMode
|
|
6190
|
-
*
|
|
6191
|
-
* (
|
|
6192
|
-
* persistirlo en `localStorage` — para que BD siga gobernando mientras el
|
|
6193
|
-
* usuario no elija por su cuenta.
|
|
6189
|
+
* MODO POR DEFECTO (BD): si el tema traído trae `meta.defaultMode`, ese modo
|
|
6190
|
+
* se aplica AHORA y se sincroniza en `localStorage`, aunque el navegador ya
|
|
6191
|
+
* tenga una elección guardada (ver `applyEntityDefaultMode`).
|
|
6194
6192
|
*/
|
|
6195
6193
|
setTenantTheme(theme) {
|
|
6196
6194
|
const validated = isRenderableTheme(theme) ? theme : null;
|
|
@@ -6230,8 +6228,8 @@ class ThemeService {
|
|
|
6230
6228
|
/**
|
|
6231
6229
|
* Fija el modo oscuro/claro y lo PERSISTE como elección EXPLÍCITA del
|
|
6232
6230
|
* usuario (toggle sol/luna, o "Aplicar tema" del Theme Studio). A partir de
|
|
6233
|
-
* este punto `hasExplicitModePreference()` es `true
|
|
6234
|
-
*
|
|
6231
|
+
* este punto `hasExplicitModePreference()` es `true`; la siguiente carga del
|
|
6232
|
+
* tema vuelve a imponer `meta.defaultMode` de BD.
|
|
6235
6233
|
*/
|
|
6236
6234
|
setDarkMode(dark) {
|
|
6237
6235
|
this._isDark.set(dark);
|
|
@@ -16773,6 +16771,282 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
16773
16771
|
args: ['document:click', ['$event']]
|
|
16774
16772
|
}] } });
|
|
16775
16773
|
|
|
16774
|
+
const CONFIRM_ICON_NAMES = {
|
|
16775
|
+
danger: 'x-circle',
|
|
16776
|
+
warning: 'exclamation-triangle',
|
|
16777
|
+
info: 'information-circle',
|
|
16778
|
+
};
|
|
16779
|
+
/**
|
|
16780
|
+
* `<sol-confirm-dialog>`: diálogo de confirmación con ícono por variante, título, mensaje y dos
|
|
16781
|
+
* acciones (confirmar a la izquierda, cancelar a la derecha). Escape y clic en el fondo cancelan.
|
|
16782
|
+
*
|
|
16783
|
+
* El componente no guarda estado: el host decide cuándo abrirlo (`open`) y qué hacer con
|
|
16784
|
+
* `confirm` y `cancel`.
|
|
16785
|
+
*/
|
|
16786
|
+
class SolConfirmDialogComponent {
|
|
16787
|
+
/** Abre o cierra el diálogo. */
|
|
16788
|
+
open = input(false, /* @ts-ignore */
|
|
16789
|
+
...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
16790
|
+
/** Título del diálogo. */
|
|
16791
|
+
title = input('¿Estás seguro?', /* @ts-ignore */
|
|
16792
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
16793
|
+
/** Mensaje bajo el título (opcional). */
|
|
16794
|
+
message = input('', /* @ts-ignore */
|
|
16795
|
+
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
16796
|
+
/** Texto del botón de confirmación. */
|
|
16797
|
+
confirmLabel = input('Confirmar', /* @ts-ignore */
|
|
16798
|
+
...(ngDevMode ? [{ debugName: "confirmLabel" }] : /* istanbul ignore next */ []));
|
|
16799
|
+
/** Texto del botón de cancelación. */
|
|
16800
|
+
cancelLabel = input('Cancelar', /* @ts-ignore */
|
|
16801
|
+
...(ngDevMode ? [{ debugName: "cancelLabel" }] : /* istanbul ignore next */ []));
|
|
16802
|
+
/** Variante visual: ícono y color del botón de confirmación. */
|
|
16803
|
+
variant = input('danger', /* @ts-ignore */
|
|
16804
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
16805
|
+
/** La persona confirmó la acción. */
|
|
16806
|
+
confirm = output();
|
|
16807
|
+
/** La persona canceló (botón, Escape o clic en el fondo). */
|
|
16808
|
+
cancel = output();
|
|
16809
|
+
iconClasses = computed(() => `sol-confirm-icon sol-confirm-icon--${this.variant()}`, /* @ts-ignore */
|
|
16810
|
+
...(ngDevMode ? [{ debugName: "iconClasses" }] : /* istanbul ignore next */ []));
|
|
16811
|
+
confirmBtnClasses = computed(() => `sol-confirm-btn sol-confirm-btn--${this.variant()}`, /* @ts-ignore */
|
|
16812
|
+
...(ngDevMode ? [{ debugName: "confirmBtnClasses" }] : /* istanbul ignore next */ []));
|
|
16813
|
+
iconName = computed(() => CONFIRM_ICON_NAMES[this.variant()], /* @ts-ignore */
|
|
16814
|
+
...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
|
|
16815
|
+
onEscapeKey() {
|
|
16816
|
+
if (this.open())
|
|
16817
|
+
this.onCancel();
|
|
16818
|
+
}
|
|
16819
|
+
onBackdropClick() {
|
|
16820
|
+
this.onCancel();
|
|
16821
|
+
}
|
|
16822
|
+
onConfirm() {
|
|
16823
|
+
this.confirm.emit();
|
|
16824
|
+
}
|
|
16825
|
+
onCancel() {
|
|
16826
|
+
this.cancel.emit();
|
|
16827
|
+
}
|
|
16828
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
16829
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolConfirmDialogComponent, isStandalone: true, selector: "sol-confirm-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, confirmLabel: { classPropertyName: "confirmLabel", publicName: "confirmLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { confirm: "confirm", cancel: "cancel" }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, ngImport: i0, template: `
|
|
16830
|
+
@if (open()) {
|
|
16831
|
+
<div
|
|
16832
|
+
class="sol-confirm-overlay"
|
|
16833
|
+
role="alertdialog"
|
|
16834
|
+
aria-modal="true"
|
|
16835
|
+
data-testid="sol-confirm-dialog"
|
|
16836
|
+
[attr.aria-label]="title()"
|
|
16837
|
+
(click)="onBackdropClick()"
|
|
16838
|
+
>
|
|
16839
|
+
<div class="sol-confirm-panel" (click)="$event.stopPropagation()">
|
|
16840
|
+
<div class="sol-confirm-header">
|
|
16841
|
+
<sol-icon class="sol-confirm-icon" [class]="iconClasses()" [name]="iconName()" />
|
|
16842
|
+
<h2 class="sol-confirm-title">{{ title() }}</h2>
|
|
16843
|
+
</div>
|
|
16844
|
+
|
|
16845
|
+
@if (message()) {
|
|
16846
|
+
<p class="sol-confirm-message">{{ message() }}</p>
|
|
16847
|
+
}
|
|
16848
|
+
|
|
16849
|
+
<div class="sol-confirm-actions">
|
|
16850
|
+
<button type="button" data-testid="sol-confirm-accept" [class]="confirmBtnClasses()" (click)="onConfirm()">
|
|
16851
|
+
{{ confirmLabel() }}
|
|
16852
|
+
</button>
|
|
16853
|
+
<button
|
|
16854
|
+
type="button"
|
|
16855
|
+
data-testid="sol-confirm-cancel"
|
|
16856
|
+
class="sol-confirm-btn sol-confirm-btn--cancel"
|
|
16857
|
+
(click)="onCancel()"
|
|
16858
|
+
>
|
|
16859
|
+
{{ cancelLabel() }}
|
|
16860
|
+
</button>
|
|
16861
|
+
</div>
|
|
16862
|
+
</div>
|
|
16863
|
+
</div>
|
|
16864
|
+
}
|
|
16865
|
+
`, isInline: true, styles: [".sol-confirm-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;align-items:center;justify-content:center;background:var(--sol-bg-overlay, rgba(0, 0, 0, .5));backdrop-filter:var(--sol-overlay-blur, blur(3px));-webkit-backdrop-filter:var(--sol-overlay-blur, blur(3px));animation:sol-confirm-fade-in .15s ease-out}.sol-confirm-panel{width:min(28rem,92vw);background:var(--sol-bg-surface, #ffffff);border-radius:var(--sol-border-radius-lg, 12px);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));padding:var(--sol-space-lg, 1.5rem);animation:sol-confirm-scale-in .2s ease-out}.sol-confirm-header{display:flex;align-items:center;gap:var(--sol-space-sm, .75rem);margin-bottom:var(--sol-space-sm, .5rem)}.sol-confirm-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:var(--sol-border-radius-full, 9999px);flex-shrink:0}.sol-confirm-icon--danger{background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent);color:var(--sol-color-danger, #ef4444)}.sol-confirm-icon--warning{background:color-mix(in srgb,var(--sol-color-warning, #f59e0b) 12%,transparent);color:var(--sol-color-warning, #f59e0b)}.sol-confirm-icon--info{background:color-mix(in srgb,var(--sol-color-info, #3b82f6) 12%,transparent);color:var(--sol-color-info, #3b82f6)}.sol-confirm-title{margin:0;font-size:var(--sol-font-size-lg, 1.125rem);font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-confirm-message{margin:var(--sol-space-sm, .5rem) 0 0 0;padding-left:calc(40px + var(--sol-space-sm, .75rem));font-size:var(--sol-font-size-sm, .875rem);color:var(--sol-color-text-secondary, #6b7280);line-height:1.5}.sol-confirm-actions{display:flex;justify-content:flex-end;gap:var(--sol-space-sm, .5rem);margin-top:var(--sol-space-lg, 1.5rem)}.sol-confirm-btn{display:inline-flex;align-items:center;justify-content:center;padding:var(--sol-space-sm, .5rem) var(--sol-space-md, 1rem);border:none;border-radius:var(--sol-border-radius-md, 8px);font-size:var(--sol-font-size-sm, .875rem);font-weight:500;font-family:inherit;cursor:pointer;transition:background-color .15s ease,opacity .15s ease;line-height:1;min-height:36px}.sol-confirm-btn--cancel{background:transparent;color:var(--sol-color-primary, #6366f1)}.sol-confirm-btn--cancel:hover{background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 10%,transparent)}.sol-confirm-btn--danger{background:var(--sol-color-danger, #ef4444);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--danger:hover{background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn--warning{background:var(--sol-color-warning, #f59e0b);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--warning:hover{background:color-mix(in srgb,var(--sol-color-warning, #f59e0b) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn--info{background:var(--sol-color-info, #3b82f6);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--info:hover{background:color-mix(in srgb,var(--sol-color-info, #3b82f6) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-primary, #6366f1) 40%,transparent)}@keyframes sol-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes sol-confirm-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16866
|
+
}
|
|
16867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolConfirmDialogComponent, decorators: [{
|
|
16868
|
+
type: Component,
|
|
16869
|
+
args: [{ selector: 'sol-confirm-dialog', standalone: true, imports: [SolIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
16870
|
+
@if (open()) {
|
|
16871
|
+
<div
|
|
16872
|
+
class="sol-confirm-overlay"
|
|
16873
|
+
role="alertdialog"
|
|
16874
|
+
aria-modal="true"
|
|
16875
|
+
data-testid="sol-confirm-dialog"
|
|
16876
|
+
[attr.aria-label]="title()"
|
|
16877
|
+
(click)="onBackdropClick()"
|
|
16878
|
+
>
|
|
16879
|
+
<div class="sol-confirm-panel" (click)="$event.stopPropagation()">
|
|
16880
|
+
<div class="sol-confirm-header">
|
|
16881
|
+
<sol-icon class="sol-confirm-icon" [class]="iconClasses()" [name]="iconName()" />
|
|
16882
|
+
<h2 class="sol-confirm-title">{{ title() }}</h2>
|
|
16883
|
+
</div>
|
|
16884
|
+
|
|
16885
|
+
@if (message()) {
|
|
16886
|
+
<p class="sol-confirm-message">{{ message() }}</p>
|
|
16887
|
+
}
|
|
16888
|
+
|
|
16889
|
+
<div class="sol-confirm-actions">
|
|
16890
|
+
<button type="button" data-testid="sol-confirm-accept" [class]="confirmBtnClasses()" (click)="onConfirm()">
|
|
16891
|
+
{{ confirmLabel() }}
|
|
16892
|
+
</button>
|
|
16893
|
+
<button
|
|
16894
|
+
type="button"
|
|
16895
|
+
data-testid="sol-confirm-cancel"
|
|
16896
|
+
class="sol-confirm-btn sol-confirm-btn--cancel"
|
|
16897
|
+
(click)="onCancel()"
|
|
16898
|
+
>
|
|
16899
|
+
{{ cancelLabel() }}
|
|
16900
|
+
</button>
|
|
16901
|
+
</div>
|
|
16902
|
+
</div>
|
|
16903
|
+
</div>
|
|
16904
|
+
}
|
|
16905
|
+
`, styles: [".sol-confirm-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;align-items:center;justify-content:center;background:var(--sol-bg-overlay, rgba(0, 0, 0, .5));backdrop-filter:var(--sol-overlay-blur, blur(3px));-webkit-backdrop-filter:var(--sol-overlay-blur, blur(3px));animation:sol-confirm-fade-in .15s ease-out}.sol-confirm-panel{width:min(28rem,92vw);background:var(--sol-bg-surface, #ffffff);border-radius:var(--sol-border-radius-lg, 12px);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));padding:var(--sol-space-lg, 1.5rem);animation:sol-confirm-scale-in .2s ease-out}.sol-confirm-header{display:flex;align-items:center;gap:var(--sol-space-sm, .75rem);margin-bottom:var(--sol-space-sm, .5rem)}.sol-confirm-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:var(--sol-border-radius-full, 9999px);flex-shrink:0}.sol-confirm-icon--danger{background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent);color:var(--sol-color-danger, #ef4444)}.sol-confirm-icon--warning{background:color-mix(in srgb,var(--sol-color-warning, #f59e0b) 12%,transparent);color:var(--sol-color-warning, #f59e0b)}.sol-confirm-icon--info{background:color-mix(in srgb,var(--sol-color-info, #3b82f6) 12%,transparent);color:var(--sol-color-info, #3b82f6)}.sol-confirm-title{margin:0;font-size:var(--sol-font-size-lg, 1.125rem);font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-confirm-message{margin:var(--sol-space-sm, .5rem) 0 0 0;padding-left:calc(40px + var(--sol-space-sm, .75rem));font-size:var(--sol-font-size-sm, .875rem);color:var(--sol-color-text-secondary, #6b7280);line-height:1.5}.sol-confirm-actions{display:flex;justify-content:flex-end;gap:var(--sol-space-sm, .5rem);margin-top:var(--sol-space-lg, 1.5rem)}.sol-confirm-btn{display:inline-flex;align-items:center;justify-content:center;padding:var(--sol-space-sm, .5rem) var(--sol-space-md, 1rem);border:none;border-radius:var(--sol-border-radius-md, 8px);font-size:var(--sol-font-size-sm, .875rem);font-weight:500;font-family:inherit;cursor:pointer;transition:background-color .15s ease,opacity .15s ease;line-height:1;min-height:36px}.sol-confirm-btn--cancel{background:transparent;color:var(--sol-color-primary, #6366f1)}.sol-confirm-btn--cancel:hover{background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 10%,transparent)}.sol-confirm-btn--danger{background:var(--sol-color-danger, #ef4444);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--danger:hover{background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn--warning{background:var(--sol-color-warning, #f59e0b);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--warning:hover{background:color-mix(in srgb,var(--sol-color-warning, #f59e0b) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn--info{background:var(--sol-color-info, #3b82f6);color:var(--sol-confirm-on-color, #ffffff)}.sol-confirm-btn--info:hover{background:color-mix(in srgb,var(--sol-color-info, #3b82f6) 85%,var(--sol-confirm-hover-shade, #000000))}.sol-confirm-btn:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-primary, #6366f1) 40%,transparent)}@keyframes sol-confirm-fade-in{0%{opacity:0}to{opacity:1}}@keyframes sol-confirm-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}\n"] }]
|
|
16906
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], confirmLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "confirmLabel", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], confirm: [{ type: i0.Output, args: ["confirm"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], onEscapeKey: [{
|
|
16907
|
+
type: HostListener,
|
|
16908
|
+
args: ['document:keydown.escape']
|
|
16909
|
+
}] } });
|
|
16910
|
+
|
|
16911
|
+
/** Atributo del `<style>` global que la directiva inyecta una sola vez por documento. */
|
|
16912
|
+
const REVEAL_STYLE_ATTR = 'data-sol-reveal-styles';
|
|
16913
|
+
/**
|
|
16914
|
+
* Keyframes y clases globales del reveal. Son los mismos que muchos hosts ya declaran en su
|
|
16915
|
+
* `styles.css` (contrato `--sol-reveal-*` del tema): repetirlos no cambia nada y garantiza el
|
|
16916
|
+
* efecto en hosts que no los declaran. Los keyframes no llevan duración ni easing: los aportan los
|
|
16917
|
+
* tokens del tema (`--sol-dur-*`, `--sol-ease-*`); con intensidad "none" o `prefers-reduced-motion`
|
|
16918
|
+
* las duraciones emitidas son ~1 ms y `--sol-reveal-dist` es 0, así que no hay movimiento.
|
|
16919
|
+
* Cada keyframe tiene un duplicado "B": alternar base ↔ B reinicia la animación (replay).
|
|
16920
|
+
*/
|
|
16921
|
+
const REVEAL_STYLES = `
|
|
16922
|
+
@keyframes solRevealRise { from { opacity: 0; transform: translateY(var(--sol-reveal-dist, 12px)); } to { opacity: 1; transform: translateY(0); } }
|
|
16923
|
+
@keyframes solRevealRiseB { from { opacity: 0; transform: translateY(var(--sol-reveal-dist, 12px)); } to { opacity: 1; transform: translateY(0); } }
|
|
16924
|
+
@keyframes solRevealFade { from { opacity: 0; } to { opacity: 1; } }
|
|
16925
|
+
@keyframes solRevealFadeB { from { opacity: 0; } to { opacity: 1; } }
|
|
16926
|
+
@keyframes solRevealPop { from { opacity: 0; transform: translateY(var(--sol-reveal-dist, 12px)) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
|
|
16927
|
+
@keyframes solRevealPopB { from { opacity: 0; transform: translateY(var(--sol-reveal-dist, 12px)) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
|
|
16928
|
+
@keyframes solRevealSlide { from { opacity: 0; transform: translateX(calc(-1 * var(--sol-reveal-dist, 12px))); } to { opacity: 1; transform: translateX(0); } }
|
|
16929
|
+
@keyframes solRevealSlideB { from { opacity: 0; transform: translateX(calc(-1 * var(--sol-reveal-dist, 12px))); } to { opacity: 1; transform: translateX(0); } }
|
|
16930
|
+
@keyframes solRevealZoom { from { opacity: 0; transform: scale(0.94) translateY(calc(var(--sol-reveal-dist, 12px) * 0.4)); } to { opacity: 1; transform: scale(1) translateY(0); } }
|
|
16931
|
+
@keyframes solRevealZoomB { from { opacity: 0; transform: scale(0.94) translateY(calc(var(--sol-reveal-dist, 12px) * 0.4)); } to { opacity: 1; transform: scale(1) translateY(0); } }
|
|
16932
|
+
.sol-reveal-in {
|
|
16933
|
+
animation: var(--sol-reveal-name, solRevealFade) var(--sol-dur-slow, 480ms) var(--sol-ease-entrance, ease-out) backwards;
|
|
16934
|
+
animation-delay: calc(var(--sol-reveal-index, 0) * var(--sol-dur-fast, 120ms) / 2);
|
|
16935
|
+
}
|
|
16936
|
+
.sol-reveal-in--replay {
|
|
16937
|
+
animation-name: var(--sol-reveal-name-b, solRevealFadeB);
|
|
16938
|
+
}
|
|
16939
|
+
`;
|
|
16940
|
+
/**
|
|
16941
|
+
* `[solReveal]`: animación de entrada al hacer scroll, dirigida por el tema.
|
|
16942
|
+
*
|
|
16943
|
+
* Un `IntersectionObserver` (umbral bajo, una sola vez por elemento) agrega la clase global
|
|
16944
|
+
* `.sol-reveal-in`, que dispara el keyframe elegido por el tema vía `--sol-reveal-name`
|
|
16945
|
+
* (`solRevealRise | solRevealFade | solRevealPop | solRevealSlide | solRevealZoom`) con la
|
|
16946
|
+
* duración y el easing de `--sol-dur-slow` y `--sol-ease-entrance`.
|
|
16947
|
+
*
|
|
16948
|
+
* - Stagger: `solRevealIndex` viaja como `--sol-reveal-index` y retrasa la entrada ~60 ms por
|
|
16949
|
+
* índice (sale de los tokens, así que escala con la intensidad del tema).
|
|
16950
|
+
* - Replay: cada cambio de `solRevealReplay` (búsqueda, filtro) alterna el keyframe base y su
|
|
16951
|
+
* duplicado "B" para reiniciar la animación sin clonar nodos.
|
|
16952
|
+
* - SSR o jsdom: sin `IntersectionObserver` el elemento queda visible y sin animación.
|
|
16953
|
+
* - Las clases y los keyframes globales se inyectan una sola vez por documento (con el nonce de
|
|
16954
|
+
* `CSP_NONCE` si el host lo provee), así el efecto no depende del `styles.css` del host.
|
|
16955
|
+
*
|
|
16956
|
+
* ```html
|
|
16957
|
+
* <section solReveal [solRevealIndex]="$index" [solRevealReplay]="filtro()">…</section>
|
|
16958
|
+
* ```
|
|
16959
|
+
*/
|
|
16960
|
+
class SolRevealDirective {
|
|
16961
|
+
host = inject(ElementRef);
|
|
16962
|
+
destroyRef = inject(DestroyRef);
|
|
16963
|
+
document = inject(DOCUMENT);
|
|
16964
|
+
nonce = inject(CSP_NONCE, { optional: true });
|
|
16965
|
+
/** Índice del stagger: retrasa la entrada índice × ~60 ms (vía tokens). */
|
|
16966
|
+
solRevealIndex = input(0, /* @ts-ignore */
|
|
16967
|
+
...(ngDevMode ? [{ debugName: "solRevealIndex" }] : /* istanbul ignore next */ []));
|
|
16968
|
+
/** Valor arbitrario: cada cambio re-dispara la animación (replay al filtrar). */
|
|
16969
|
+
solRevealReplay = input(undefined, /* @ts-ignore */
|
|
16970
|
+
...(ngDevMode ? [{ debugName: "solRevealReplay" }] : /* istanbul ignore next */ []));
|
|
16971
|
+
observer = null;
|
|
16972
|
+
revealed = false;
|
|
16973
|
+
altKeyframe = false;
|
|
16974
|
+
constructor() {
|
|
16975
|
+
effect(() => {
|
|
16976
|
+
this.host.nativeElement.style.setProperty('--sol-reveal-index', String(this.solRevealIndex()));
|
|
16977
|
+
});
|
|
16978
|
+
// Replay: se ignora el valor inicial; solo re-anima elementos ya revelados.
|
|
16979
|
+
let initial = true;
|
|
16980
|
+
effect(() => {
|
|
16981
|
+
this.solRevealReplay();
|
|
16982
|
+
if (initial) {
|
|
16983
|
+
initial = false;
|
|
16984
|
+
return;
|
|
16985
|
+
}
|
|
16986
|
+
if (this.revealed)
|
|
16987
|
+
this.replay();
|
|
16988
|
+
});
|
|
16989
|
+
}
|
|
16990
|
+
ngOnInit() {
|
|
16991
|
+
if (typeof IntersectionObserver === 'undefined')
|
|
16992
|
+
return;
|
|
16993
|
+
this.ensureGlobalStyles();
|
|
16994
|
+
// Oculto solo cuando el observer va a correr; el fill "backwards" retoma desde el "from".
|
|
16995
|
+
this.host.nativeElement.style.opacity = '0';
|
|
16996
|
+
this.observer = new IntersectionObserver(entries => {
|
|
16997
|
+
if (entries.some(entry => entry.isIntersecting))
|
|
16998
|
+
this.reveal();
|
|
16999
|
+
}, { threshold: 0.05 });
|
|
17000
|
+
this.observer.observe(this.host.nativeElement);
|
|
17001
|
+
this.destroyRef.onDestroy(() => this.disconnect());
|
|
17002
|
+
}
|
|
17003
|
+
ensureGlobalStyles() {
|
|
17004
|
+
const head = this.document?.head;
|
|
17005
|
+
if (!head || head.querySelector(`style[${REVEAL_STYLE_ATTR}]`))
|
|
17006
|
+
return;
|
|
17007
|
+
const style = this.document.createElement('style');
|
|
17008
|
+
style.setAttribute(REVEAL_STYLE_ATTR, '');
|
|
17009
|
+
if (this.nonce)
|
|
17010
|
+
style.setAttribute('nonce', this.nonce);
|
|
17011
|
+
style.textContent = REVEAL_STYLES;
|
|
17012
|
+
head.appendChild(style);
|
|
17013
|
+
}
|
|
17014
|
+
/** Primera entrada al viewport: una sola vez por elemento. */
|
|
17015
|
+
reveal() {
|
|
17016
|
+
this.disconnect();
|
|
17017
|
+
const element = this.host.nativeElement;
|
|
17018
|
+
element.style.removeProperty('opacity');
|
|
17019
|
+
element.classList.add('sol-reveal-in');
|
|
17020
|
+
this.revealed = true;
|
|
17021
|
+
}
|
|
17022
|
+
/** Alterna el keyframe base y su duplicado "B" para reiniciar la animación. */
|
|
17023
|
+
replay() {
|
|
17024
|
+
const element = this.host.nativeElement;
|
|
17025
|
+
this.altKeyframe = !this.altKeyframe;
|
|
17026
|
+
if (this.altKeyframe) {
|
|
17027
|
+
const name = getComputedStyle(element).getPropertyValue('--sol-reveal-name').trim() || 'solRevealFade';
|
|
17028
|
+
element.style.setProperty('--sol-reveal-name-b', `${name}B`);
|
|
17029
|
+
element.classList.add('sol-reveal-in--replay');
|
|
17030
|
+
}
|
|
17031
|
+
else {
|
|
17032
|
+
element.classList.remove('sol-reveal-in--replay');
|
|
17033
|
+
}
|
|
17034
|
+
}
|
|
17035
|
+
disconnect() {
|
|
17036
|
+
this.observer?.disconnect();
|
|
17037
|
+
this.observer = null;
|
|
17038
|
+
}
|
|
17039
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolRevealDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
17040
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: SolRevealDirective, isStandalone: true, selector: "[solReveal]", inputs: { solRevealIndex: { classPropertyName: "solRevealIndex", publicName: "solRevealIndex", isSignal: true, isRequired: false, transformFunction: null }, solRevealReplay: { classPropertyName: "solRevealReplay", publicName: "solRevealReplay", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
17041
|
+
}
|
|
17042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolRevealDirective, decorators: [{
|
|
17043
|
+
type: Directive,
|
|
17044
|
+
args: [{
|
|
17045
|
+
selector: '[solReveal]',
|
|
17046
|
+
standalone: true,
|
|
17047
|
+
}]
|
|
17048
|
+
}], ctorParameters: () => [], propDecorators: { solRevealIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "solRevealIndex", required: false }] }], solRevealReplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "solRevealReplay", required: false }] }] } });
|
|
17049
|
+
|
|
16776
17050
|
// Shared UI — atomic design system components
|
|
16777
17051
|
|
|
16778
17052
|
/*
|
|
@@ -16783,5 +17057,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
16783
17057
|
* Generated bundle index. Do not edit.
|
|
16784
17058
|
*/
|
|
16785
17059
|
|
|
16786
|
-
export { DEFAULT_SCORE_THRESHOLDS, EMIT_TABLE, KANBAN_ADD_ACTION, KanbanReorderService, NEUTRAL_CALENDAR_COLOR, SOL_BUNDLED_DEFAULT_THEME, SOL_CALENDAR_COLOR, SOL_CHART_ENGINE, SOL_DEFAULT_THEME, SOL_I18N, SOL_TABLE_VARIANTS, SOL_TENANT_RESOLVER, SOL_TREE_MAX_DEPTH, SolAvatarComponent, SolBadgeComponent, SolButtonComponent, SolCalendarComponent, SolCalendarGridComponent, SolCalendarHeaderComponent, SolCardComponent, SolChartComponent, SolCheckboxComponent, SolChipComponent, SolChipGroupComponent, SolDataTableComponent, SolDatePickerComponent, SolDayPickerComponent, SolDrawerComponent, SolEmptyStateComponent, SolFileUploadComponent, SolFlowCanvasComponent, SolFormFieldComponent, SolIconButtonComponent, SolIconComponent, SolInputComponent, SolKanbanBoardComponent, SolKanbanCardComponent, SolKanbanColumnComponent, SolKanbanDragSourceComponent, SolMessageStatusComponent, SolModalComponent, SolNotificationPanelComponent, SolNumberInputComponent, SolPageHeaderComponent, SolPaginationComponent, SolProgressBarComponent, SolRatingInputComponent, SolRichEditorComponent, SolScopeSwitcherComponent, SolScoreBadgeComponent, SolSearchInputComponent, SolSelectComponent, SolSkeletonComponent, SolSpinnerComponent, SolStarRatingComponent, SolStepperComponent, SolTabsComponent, SolTextareaComponent, SolTimelineComponent, SolToggleComponent, SolTooltipComponent, SolTreeComponent, SolTreeNodeDefDirective, SolTrendComponent, SolViewToggleComponent, SolVirtualScrollComponent, SolWizardComponent, SolWizardStepDirective, TCPDF_ALLOWED_STYLE_PROPERTIES, TCPDF_ALLOWED_TAGS, THEME_SOURCE, ThemeService, buildDayColumns, buildGoogleFontsUrl, collectUndatedNodes, computeAutoLayoutPositions, computeEventHeight, computeEventTop, computeGlobalRange, computeInitials, computeMonthAxisTicks, computeNowTop, createIdentitySolI18n, dayKey, defaultStatusToken, defaultTrendFormat, getWeekStart, hashToPaletteIndex, isRenderableTheme, isSafeBackgroundImage, isSafeCssColor, normalizeRating, parseEventDate, positionRows, provideTheme, resolveCssVars, resolveScoreTone, resolveTrendDirection, sanitizeAssetUrl, sanitizeHtmlToTcpdf, serializeElementToTcpdfHtml };
|
|
17060
|
+
export { DEFAULT_SCORE_THRESHOLDS, EMIT_TABLE, KANBAN_ADD_ACTION, KanbanReorderService, NEUTRAL_CALENDAR_COLOR, SOL_BUNDLED_DEFAULT_THEME, SOL_CALENDAR_COLOR, SOL_CHART_ENGINE, SOL_DEFAULT_THEME, SOL_I18N, SOL_TABLE_VARIANTS, SOL_TENANT_RESOLVER, SOL_TREE_MAX_DEPTH, SolAvatarComponent, SolBadgeComponent, SolButtonComponent, SolCalendarComponent, SolCalendarGridComponent, SolCalendarHeaderComponent, SolCardComponent, SolChartComponent, SolCheckboxComponent, SolChipComponent, SolChipGroupComponent, SolConfirmDialogComponent, SolDataTableComponent, SolDatePickerComponent, SolDayPickerComponent, SolDrawerComponent, SolEmptyStateComponent, SolFileUploadComponent, SolFlowCanvasComponent, SolFormFieldComponent, SolIconButtonComponent, SolIconComponent, SolInputComponent, SolKanbanBoardComponent, SolKanbanCardComponent, SolKanbanColumnComponent, SolKanbanDragSourceComponent, SolMessageStatusComponent, SolModalComponent, SolNotificationPanelComponent, SolNumberInputComponent, SolPageHeaderComponent, SolPaginationComponent, SolProgressBarComponent, SolRatingInputComponent, SolRevealDirective, SolRichEditorComponent, SolScopeSwitcherComponent, SolScoreBadgeComponent, SolSearchInputComponent, SolSelectComponent, SolSkeletonComponent, SolSpinnerComponent, SolStarRatingComponent, SolStepperComponent, SolTabsComponent, SolTextareaComponent, SolTimelineComponent, SolToggleComponent, SolTooltipComponent, SolTreeComponent, SolTreeNodeDefDirective, SolTrendComponent, SolViewToggleComponent, SolVirtualScrollComponent, SolWizardComponent, SolWizardStepDirective, TCPDF_ALLOWED_STYLE_PROPERTIES, TCPDF_ALLOWED_TAGS, THEME_SOURCE, ThemeService, buildDayColumns, buildGoogleFontsUrl, collectUndatedNodes, computeAutoLayoutPositions, computeEventHeight, computeEventTop, computeGlobalRange, computeInitials, computeMonthAxisTicks, computeNowTop, createIdentitySolI18n, dayKey, defaultStatusToken, defaultTrendFormat, getWeekStart, hashToPaletteIndex, isRenderableTheme, isSafeBackgroundImage, isSafeCssColor, normalizeRating, parseEventDate, positionRows, provideTheme, resolveCssVars, resolveScoreTone, resolveTrendDirection, sanitizeAssetUrl, sanitizeHtmlToTcpdf, serializeElementToTcpdfHtml };
|
|
16787
17061
|
//# sourceMappingURL=solercia-ui.mjs.map
|