@solercia/ui 0.5.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 +210 -0
- package/README.md +3 -1
- package/fesm2022/solercia-ui-theme-studio.mjs +5200 -0
- package/fesm2022/solercia-ui-theme-studio.mjs.map +1 -0
- package/fesm2022/solercia-ui.mjs +1240 -87
- package/fesm2022/solercia-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/solercia-ui-theme-studio.d.ts +679 -0
- package/types/solercia-ui.d.ts +3293 -2847
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';
|
|
@@ -721,6 +721,44 @@ const ICON_REGISTRY = {
|
|
|
721
721
|
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M9 15l6-6M11 6l.46-.54a5 5 0 0 1 7.08 7.08l-.54.46M13 18l-.4.53a5.07 5.07 0 0 1-7.13 0 4.97 4.97 0 0 1 0-7.07l.52-.46" />`,
|
|
722
722
|
fill: '',
|
|
723
723
|
},
|
|
724
|
+
// ── Aportes v0.6.0 — Heroicons v2.1.5, `d` copiados sin editar ────────────────
|
|
725
|
+
// Ocho íconos nuevos para el ciclo candidato a 0.6.0: acciones de
|
|
726
|
+
// descarga/impresión, contenido educativo (libro, bombilla, presentación),
|
|
727
|
+
// reconocimiento (pulgar arriba) y jerarquía de carpetas (folder/folder-open,
|
|
728
|
+
// para árboles de archivos). outline + solid desde el paquete npm
|
|
729
|
+
// `heroicons@2.1.5` (MIT), sin modificar el atributo `d`.
|
|
730
|
+
'arrow-down-tray': {
|
|
731
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3" />`,
|
|
732
|
+
fill: `<path fill-rule="evenodd" d="M12 2.25a.75.75 0 0 1 .75.75v11.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 1 1 1.06-1.06l3.22 3.22V3a.75.75 0 0 1 .75-.75Zm-9 13.5a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z" clip-rule="evenodd" />`,
|
|
733
|
+
},
|
|
734
|
+
'book-open': {
|
|
735
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25" />`,
|
|
736
|
+
fill: `<path d="M11.25 4.533A9.707 9.707 0 0 0 6 3a9.735 9.735 0 0 0-3.25.555.75.75 0 0 0-.5.707v14.25a.75.75 0 0 0 1 .707A8.237 8.237 0 0 1 6 18.75c1.995 0 3.823.707 5.25 1.886V4.533ZM12.75 20.636A8.214 8.214 0 0 1 18 18.75c.966 0 1.89.166 2.75.47a.75.75 0 0 0 1-.708V4.262a.75.75 0 0 0-.5-.707A9.735 9.735 0 0 0 18 3a9.707 9.707 0 0 0-5.25 1.533v16.103Z" />`,
|
|
737
|
+
},
|
|
738
|
+
'light-bulb': {
|
|
739
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18" />`,
|
|
740
|
+
fill: `<path d="M12 .75a8.25 8.25 0 0 0-4.135 15.39c.686.398 1.115 1.008 1.134 1.623a.75.75 0 0 0 .577.706c.352.083.71.148 1.074.195.323.041.6-.218.6-.544v-4.661a6.714 6.714 0 0 1-.937-.171.75.75 0 1 1 .374-1.453 5.261 5.261 0 0 0 2.626 0 .75.75 0 1 1 .374 1.452 6.712 6.712 0 0 1-.937.172v4.66c0 .327.277.586.6.545.364-.047.722-.112 1.074-.195a.75.75 0 0 0 .577-.706c.02-.615.448-1.225 1.134-1.623A8.25 8.25 0 0 0 12 .75Z" /><path fill-rule="evenodd" d="M9.013 19.9a.75.75 0 0 1 .877-.597 11.319 11.319 0 0 0 4.22 0 .75.75 0 1 1 .28 1.473 12.819 12.819 0 0 1-4.78 0 .75.75 0 0 1-.597-.876ZM9.754 22.344a.75.75 0 0 1 .824-.668 13.682 13.682 0 0 0 2.844 0 .75.75 0 1 1 .156 1.492 15.156 15.156 0 0 1-3.156 0 .75.75 0 0 1-.668-.824Z" clip-rule="evenodd" />`,
|
|
741
|
+
},
|
|
742
|
+
'hand-thumb-up': {
|
|
743
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z" />`,
|
|
744
|
+
fill: `<path d="M7.493 18.5c-.425 0-.82-.236-.975-.632A7.48 7.48 0 0 1 6 15.125c0-1.75.599-3.358 1.602-4.634.151-.192.373-.309.6-.397.473-.183.89-.514 1.212-.924a9.042 9.042 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75A.75.75 0 0 1 15 2a2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H14.23c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23h-.777ZM2.331 10.727a11.969 11.969 0 0 0-.831 4.398 12 12 0 0 0 .52 3.507C2.28 19.482 3.105 20 3.994 20H4.9c.445 0 .72-.498.523-.898a8.963 8.963 0 0 1-.924-3.977c0-1.708.476-3.305 1.302-4.666.245-.403-.028-.959-.5-.959H4.25c-.832 0-1.612.453-1.918 1.227Z" />`,
|
|
745
|
+
},
|
|
746
|
+
'presentation-chart-line': {
|
|
747
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5m.75-9 3-3 2.148 2.148A12.061 12.061 0 0 1 16.5 7.605" />`,
|
|
748
|
+
fill: `<path fill-rule="evenodd" d="M2.25 2.25a.75.75 0 0 0 0 1.5H3v10.5a3 3 0 0 0 3 3h1.21l-1.172 3.513a.75.75 0 0 0 1.424.474l.329-.987h8.418l.33.987a.75.75 0 0 0 1.422-.474l-1.17-3.513H18a3 3 0 0 0 3-3V3.75h.75a.75.75 0 0 0 0-1.5H2.25Zm6.54 15h6.42l.5 1.5H8.29l.5-1.5Zm8.085-8.995a.75.75 0 1 0-.75-1.299 12.81 12.81 0 0 0-3.558 3.05L11.03 8.47a.75.75 0 0 0-1.06 0l-3 3a.75.75 0 1 0 1.06 1.06l2.47-2.47 1.617 1.618a.75.75 0 0 0 1.146-.102 11.312 11.312 0 0 1 3.612-3.321Z" clip-rule="evenodd" />`,
|
|
749
|
+
},
|
|
750
|
+
printer: {
|
|
751
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0 1 10.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0 .229 2.523a1.125 1.125 0 0 1-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0 0 21 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 0 0-1.913-.247M6.34 18H5.25A2.25 2.25 0 0 1 3 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 0 1 1.913-.247m10.5 0a48.536 48.536 0 0 0-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5Zm-3 0h.008v.008H15V10.5Z" />`,
|
|
752
|
+
fill: `<path fill-rule="evenodd" d="M7.875 1.5C6.839 1.5 6 2.34 6 3.375v2.99c-.426.053-.851.11-1.274.174-1.454.218-2.476 1.483-2.476 2.917v6.294a3 3 0 0 0 3 3h.27l-.155 1.705A1.875 1.875 0 0 0 7.232 22.5h9.536a1.875 1.875 0 0 0 1.867-2.045l-.155-1.705h.27a3 3 0 0 0 3-3V9.456c0-1.434-1.022-2.7-2.476-2.917A48.716 48.716 0 0 0 18 6.366V3.375c0-1.036-.84-1.875-1.875-1.875h-8.25ZM16.5 6.205v-2.83A.375.375 0 0 0 16.125 3h-8.25a.375.375 0 0 0-.375.375v2.83a49.353 49.353 0 0 1 9 0Zm-.217 8.265c.178.018.317.16.333.337l.526 5.784a.375.375 0 0 1-.374.409H7.232a.375.375 0 0 1-.374-.409l.526-5.784a.373.373 0 0 1 .333-.337 41.741 41.741 0 0 1 8.566 0Zm.967-3.97a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75H18a.75.75 0 0 1-.75-.75V10.5ZM15 9.75a.75.75 0 0 0-.75.75v.008c0 .414.336.75.75.75h.008a.75.75 0 0 0 .75-.75V10.5a.75.75 0 0 0-.75-.75H15Z" clip-rule="evenodd" />`,
|
|
753
|
+
},
|
|
754
|
+
folder: {
|
|
755
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z" />`,
|
|
756
|
+
fill: `<path d="M19.906 9c.382 0 .749.057 1.094.162V9a3 3 0 0 0-3-3h-3.879a.75.75 0 0 1-.53-.22L11.47 3.66A2.25 2.25 0 0 0 9.879 3H6a3 3 0 0 0-3 3v3.162A3.756 3.756 0 0 1 4.094 9h15.812ZM4.094 10.5a2.25 2.25 0 0 0-2.227 2.568l.857 6A2.25 2.25 0 0 0 4.951 21H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-2.227-2.568H4.094Z" />`,
|
|
757
|
+
},
|
|
758
|
+
'folder-open': {
|
|
759
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776" />`,
|
|
760
|
+
fill: `<path d="M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z" />`,
|
|
761
|
+
},
|
|
724
762
|
};
|
|
725
763
|
|
|
726
764
|
class SolIconComponent {
|
|
@@ -977,6 +1015,23 @@ class SolSelectComponent {
|
|
|
977
1015
|
/** Label for the "all" option in single mode. */
|
|
978
1016
|
allOptionLabel = input('Todos', /* @ts-ignore */
|
|
979
1017
|
...(ngDevMode ? [{ debugName: "allOptionLabel" }] : /* istanbul ignore next */ []));
|
|
1018
|
+
/**
|
|
1019
|
+
* Viewport width (px) at or below which the trigger and the inner search
|
|
1020
|
+
* rise to 16px to avoid iOS Safari auto-zoom. The CSS baseline keeps
|
|
1021
|
+
* protecting viewports up to 640px without JavaScript; a larger value
|
|
1022
|
+
* (e.g. 768 for hosts whose mobile layout starts there) extends it.
|
|
1023
|
+
*/
|
|
1024
|
+
mobileBreakpoint = input(640, /* @ts-ignore */
|
|
1025
|
+
...(ngDevMode ? [{ debugName: "mobileBreakpoint" }] : /* istanbul ignore next */ []));
|
|
1026
|
+
/** Current viewport width, refreshed on `window:resize`. */
|
|
1027
|
+
viewportWidth = signal(SolSelectComponent.readViewportWidth(), /* @ts-ignore */
|
|
1028
|
+
...(ngDevMode ? [{ debugName: "viewportWidth" }] : /* istanbul ignore next */ []));
|
|
1029
|
+
/** True when the viewport is within `mobileBreakpoint` (drives the touch classes). */
|
|
1030
|
+
touchViewport = computed(() => {
|
|
1031
|
+
const width = this.viewportWidth();
|
|
1032
|
+
return width > 0 && width <= this.mobileBreakpoint();
|
|
1033
|
+
}, /* @ts-ignore */
|
|
1034
|
+
...(ngDevMode ? [{ debugName: "touchViewport" }] : /* istanbul ignore next */ []));
|
|
980
1035
|
// ── Internal state ──
|
|
981
1036
|
isOpen = signal(false, /* @ts-ignore */
|
|
982
1037
|
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
@@ -1044,6 +1099,12 @@ class SolSelectComponent {
|
|
|
1044
1099
|
constructor(hostEl) {
|
|
1045
1100
|
this.hostEl = hostEl;
|
|
1046
1101
|
}
|
|
1102
|
+
onViewportResize() {
|
|
1103
|
+
this.viewportWidth.set(SolSelectComponent.readViewportWidth());
|
|
1104
|
+
}
|
|
1105
|
+
static readViewportWidth() {
|
|
1106
|
+
return typeof window !== 'undefined' && Number.isFinite(window.innerWidth) ? window.innerWidth : 0;
|
|
1107
|
+
}
|
|
1047
1108
|
toggleDropdown() {
|
|
1048
1109
|
if (this.disabled())
|
|
1049
1110
|
return;
|
|
@@ -1115,7 +1176,7 @@ class SolSelectComponent {
|
|
|
1115
1176
|
this.onChange(Array.from(this.multiValues()));
|
|
1116
1177
|
}
|
|
1117
1178
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolSelectComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1118
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolSelectComponent, isStandalone: true, selector: "sol-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, showAllOption: { classPropertyName: "showAllOption", publicName: "showAllOption", isSignal: true, isRequired: false, transformFunction: null }, allOptionLabel: { classPropertyName: "allOptionLabel", publicName: "allOptionLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, providers: [
|
|
1179
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolSelectComponent, isStandalone: true, selector: "sol-select", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, showAllOption: { classPropertyName: "showAllOption", publicName: "showAllOption", isSignal: true, isRequired: false, transformFunction: null }, allOptionLabel: { classPropertyName: "allOptionLabel", publicName: "allOptionLabel", isSignal: true, isRequired: false, transformFunction: null }, mobileBreakpoint: { classPropertyName: "mobileBreakpoint", publicName: "mobileBreakpoint", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onDocumentClick($event)", "window:resize": "onViewportResize()" }, properties: { "class.sol-select--touch": "touchViewport()" } }, providers: [
|
|
1119
1180
|
{
|
|
1120
1181
|
provide: NG_VALUE_ACCESSOR,
|
|
1121
1182
|
useExisting: forwardRef(() => SolSelectComponent),
|
|
@@ -1158,6 +1219,7 @@ class SolSelectComponent {
|
|
|
1158
1219
|
[solFloatingPanel]="triggerBtn"
|
|
1159
1220
|
(dropUpChange)="dropUp.set($event)"
|
|
1160
1221
|
[class.sol-select__dropdown--up]="dropUp()"
|
|
1222
|
+
[class.sol-select__dropdown--touch]="touchViewport()"
|
|
1161
1223
|
>
|
|
1162
1224
|
<!-- Search -->
|
|
1163
1225
|
@if (searchable()) {
|
|
@@ -1219,11 +1281,13 @@ class SolSelectComponent {
|
|
|
1219
1281
|
@if (error()) {
|
|
1220
1282
|
<p class="sol-select__error">{{ error() }}</p>
|
|
1221
1283
|
}
|
|
1222
|
-
`, isInline: true, styles: [":host{display:block}:host,.sol-select__dropdown{--sol-select-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-select-text: var(--sol-color-text-primary, #1e293b);--sol-select-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-select-border: var(--sol-border-color-default, #cbd5e1);--sol-select-border-focus: var(--sol-color-primary, #6366f1);--sol-select-error-color: var(--sol-color-danger, #ef4444);--sol-select-label-color: var(--sol-color-text-secondary, #475569);--sol-select-arrow-color: var(--sol-color-text-muted, #94a3b8);--sol-select-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-select-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-select-border-width: var(--sol-border-width-default, 1px);--sol-select-padding-x: var(--sol-space-sm, .75rem);--sol-select-height: var(--sol-size-input-height, 2.5rem);--sol-select-font-size: var(--sol-font-size-base, .875rem);--sol-select-label-font-size: var(--sol-font-size-sm, .75rem);--sol-select-label-font-weight: var(--sol-font-weight-bold, 600);--sol-select-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0,0,0,.05)));--sol-select-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-select-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-select-dropdown-bg: var(--sol-bg-surface, #ffffff);--sol-select-option-hover: var(--sol-color-bg-hover, rgba(0,0,0,.04));--sol-select-option-active-bg: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sol-select-option-active-text: var(--sol-color-primary, #6366f1)}.sol-select__label{display:block;margin-bottom:.375rem;font-size:var(--sol-select-label-font-size);font-weight:var(--sol-select-label-font-weight);color:var(--sol-select-label-color);line-height:1.4}.sol-select__wrapper{position:relative;display:block}.sol-select__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--sol-select-height);padding:0 var(--sol-select-padding-x);font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background-color:var(--sol-select-bg);border:var(--sol-input-border, var(--sol-select-border-width) solid var(--sol-select-border));border-radius:var(--sol-select-radius);box-shadow:var(--sol-select-shadow);cursor:pointer;transition:border-color var(--sol-select-transition),box-shadow var(--sol-select-transition);text-align:left}.sol-select__trigger:focus{outline:none;border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__trigger:disabled{cursor:not-allowed;opacity:var(--sol-select-disabled-opacity)}.sol-select__trigger--error{border-color:var(--sol-select-error-color)}.sol-select__trigger--open{border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__display{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-select__display--placeholder{color:var(--sol-select-placeholder)}.sol-select__arrow{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--sol-select-arrow-color);transition:transform var(--sol-select-transition)}.sol-select__arrow--open{transform:rotate(180deg)}.sol-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--sol-select-dropdown-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:var(--sol-select-radius);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0,0,0,.15));max-height:280px;display:flex;flex-direction:column;animation:sol-select-fade .12s ease-out}.sol-select__search-box{padding:.5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__search{width:100%;height:2rem;padding:0 .5rem;font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background:var(--sol-select-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);outline:none}.sol-select__search:focus{border-color:var(--sol-select-border-focus)}.sol-select__bulk-actions{display:flex;gap:.25rem;padding:.375rem .5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__bulk-btn{flex:1;padding:.25rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--sol-select-option-active-text);background:transparent;border:1px solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__bulk-btn:hover{background:var(--sol-select-option-hover)}.sol-select__options{overflow-y:auto;flex:1;padding:.25rem 0}.sol-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:var(--sol-select-font-size);color:var(--sol-select-text);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__option:hover{background:var(--sol-select-option-hover)}.sol-select__option--active{background:var(--sol-select-option-active-bg);color:var(--sol-select-option-active-text);font-weight:500}.sol-select__check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;border:2px solid var(--sol-select-border);border-radius:3px;font-size:.65rem;flex-shrink:0}.sol-select__check--checked{background:var(--sol-select-option-active-text);border-color:var(--sol-select-option-active-text);color:#fff}.sol-select__empty{padding:.75rem;text-align:center;color:var(--sol-select-placeholder);font-size:var(--sol-select-font-size)}.sol-select__error{margin:.25rem 0 0;font-size:var(--sol-select-label-font-size);color:var(--sol-select-error-color);line-height:1.4}.sol-select__dropdown--up{top:auto;bottom:calc(100% + 4px);animation:sol-select-fade-up .12s ease-out}@keyframes sol-select-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sol-select-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(max-width:640px){.sol-select__search,.sol-select__trigger{font-size:16px}}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }, { kind: "directive", type: SolFloatingPanelDirective, selector: "[solFloatingPanel]", inputs: ["solFloatingPanel", "gap", "flipThreshold", "matchTriggerWidth", "align"], outputs: ["dropUpChange"], exportAs: ["solFloatingPanel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1284
|
+
`, isInline: true, styles: [":host{display:block}:host,.sol-select__dropdown{--sol-select-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-select-text: var(--sol-color-text-primary, #1e293b);--sol-select-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-select-border: var(--sol-border-color-default, #cbd5e1);--sol-select-border-focus: var(--sol-color-primary, #6366f1);--sol-select-error-color: var(--sol-color-danger, #ef4444);--sol-select-label-color: var(--sol-color-text-secondary, #475569);--sol-select-arrow-color: var(--sol-color-text-muted, #94a3b8);--sol-select-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-select-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-select-border-width: var(--sol-border-width-default, 1px);--sol-select-padding-x: var(--sol-space-sm, .75rem);--sol-select-height: var(--sol-size-input-height, 2.5rem);--sol-select-font-size: var(--sol-font-size-base, .875rem);--sol-select-label-font-size: var(--sol-font-size-sm, .75rem);--sol-select-label-font-weight: var(--sol-font-weight-bold, 600);--sol-select-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0,0,0,.05)));--sol-select-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-select-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-select-dropdown-bg: var(--sol-bg-surface, #ffffff);--sol-select-option-hover: var(--sol-color-bg-hover, rgba(0,0,0,.04));--sol-select-option-active-bg: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sol-select-option-active-text: var(--sol-color-primary, #6366f1)}.sol-select__label{display:block;margin-bottom:.375rem;font-size:var(--sol-select-label-font-size);font-weight:var(--sol-select-label-font-weight);color:var(--sol-select-label-color);line-height:1.4}.sol-select__wrapper{position:relative;display:block}.sol-select__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--sol-select-height);padding:0 var(--sol-select-padding-x);font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background-color:var(--sol-select-bg);border:var(--sol-input-border, var(--sol-select-border-width) solid var(--sol-select-border));border-radius:var(--sol-select-radius);box-shadow:var(--sol-select-shadow);cursor:pointer;transition:border-color var(--sol-select-transition),box-shadow var(--sol-select-transition);text-align:left}.sol-select__trigger:focus{outline:none;border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__trigger:disabled{cursor:not-allowed;opacity:var(--sol-select-disabled-opacity)}.sol-select__trigger--error{border-color:var(--sol-select-error-color)}.sol-select__trigger--open{border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__display{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-select__display--placeholder{color:var(--sol-select-placeholder)}.sol-select__arrow{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--sol-select-arrow-color);transition:transform var(--sol-select-transition)}.sol-select__arrow--open{transform:rotate(180deg)}.sol-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--sol-select-dropdown-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:var(--sol-select-radius);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0,0,0,.15));max-height:280px;display:flex;flex-direction:column;animation:sol-select-fade .12s ease-out}.sol-select__search-box{padding:.5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__search{width:100%;height:2rem;padding:0 .5rem;font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background:var(--sol-select-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);outline:none}.sol-select__search:focus{border-color:var(--sol-select-border-focus)}.sol-select__bulk-actions{display:flex;gap:.25rem;padding:.375rem .5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__bulk-btn{flex:1;padding:.25rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--sol-select-option-active-text);background:transparent;border:1px solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__bulk-btn:hover{background:var(--sol-select-option-hover)}.sol-select__options{overflow-y:auto;flex:1;padding:.25rem 0}.sol-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:var(--sol-select-font-size);color:var(--sol-select-text);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__option:hover{background:var(--sol-select-option-hover)}.sol-select__option--active{background:var(--sol-select-option-active-bg);color:var(--sol-select-option-active-text);font-weight:500}.sol-select__check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;border:2px solid var(--sol-select-border);border-radius:3px;font-size:.65rem;flex-shrink:0}.sol-select__check--checked{background:var(--sol-select-option-active-text);border-color:var(--sol-select-option-active-text);color:#fff}.sol-select__empty{padding:.75rem;text-align:center;color:var(--sol-select-placeholder);font-size:var(--sol-select-font-size)}.sol-select__error{margin:.25rem 0 0;font-size:var(--sol-select-label-font-size);color:var(--sol-select-error-color);line-height:1.4}.sol-select__dropdown--up{top:auto;bottom:calc(100% + 4px);animation:sol-select-fade-up .12s ease-out}@keyframes sol-select-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sol-select-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(max-width:640px){.sol-select__search,.sol-select__trigger{font-size:16px}}:host(.sol-select--touch) .sol-select__trigger,.sol-select__dropdown--touch .sol-select__search{font-size:var(--sol-font-size-touch-input, 16px)}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }, { kind: "directive", type: SolFloatingPanelDirective, selector: "[solFloatingPanel]", inputs: ["solFloatingPanel", "gap", "flipThreshold", "matchTriggerWidth", "align"], outputs: ["dropUpChange"], exportAs: ["solFloatingPanel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1223
1285
|
}
|
|
1224
1286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolSelectComponent, decorators: [{
|
|
1225
1287
|
type: Component,
|
|
1226
|
-
args: [{ selector: 'sol-select', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent, SolFloatingPanelDirective],
|
|
1288
|
+
args: [{ selector: 'sol-select', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent, SolFloatingPanelDirective], host: {
|
|
1289
|
+
'[class.sol-select--touch]': 'touchViewport()',
|
|
1290
|
+
}, providers: [
|
|
1227
1291
|
{
|
|
1228
1292
|
provide: NG_VALUE_ACCESSOR,
|
|
1229
1293
|
useExisting: forwardRef(() => SolSelectComponent),
|
|
@@ -1266,6 +1330,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1266
1330
|
[solFloatingPanel]="triggerBtn"
|
|
1267
1331
|
(dropUpChange)="dropUp.set($event)"
|
|
1268
1332
|
[class.sol-select__dropdown--up]="dropUp()"
|
|
1333
|
+
[class.sol-select__dropdown--touch]="touchViewport()"
|
|
1269
1334
|
>
|
|
1270
1335
|
<!-- Search -->
|
|
1271
1336
|
@if (searchable()) {
|
|
@@ -1327,10 +1392,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1327
1392
|
@if (error()) {
|
|
1328
1393
|
<p class="sol-select__error">{{ error() }}</p>
|
|
1329
1394
|
}
|
|
1330
|
-
`, styles: [":host{display:block}:host,.sol-select__dropdown{--sol-select-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-select-text: var(--sol-color-text-primary, #1e293b);--sol-select-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-select-border: var(--sol-border-color-default, #cbd5e1);--sol-select-border-focus: var(--sol-color-primary, #6366f1);--sol-select-error-color: var(--sol-color-danger, #ef4444);--sol-select-label-color: var(--sol-color-text-secondary, #475569);--sol-select-arrow-color: var(--sol-color-text-muted, #94a3b8);--sol-select-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-select-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-select-border-width: var(--sol-border-width-default, 1px);--sol-select-padding-x: var(--sol-space-sm, .75rem);--sol-select-height: var(--sol-size-input-height, 2.5rem);--sol-select-font-size: var(--sol-font-size-base, .875rem);--sol-select-label-font-size: var(--sol-font-size-sm, .75rem);--sol-select-label-font-weight: var(--sol-font-weight-bold, 600);--sol-select-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0,0,0,.05)));--sol-select-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-select-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-select-dropdown-bg: var(--sol-bg-surface, #ffffff);--sol-select-option-hover: var(--sol-color-bg-hover, rgba(0,0,0,.04));--sol-select-option-active-bg: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sol-select-option-active-text: var(--sol-color-primary, #6366f1)}.sol-select__label{display:block;margin-bottom:.375rem;font-size:var(--sol-select-label-font-size);font-weight:var(--sol-select-label-font-weight);color:var(--sol-select-label-color);line-height:1.4}.sol-select__wrapper{position:relative;display:block}.sol-select__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--sol-select-height);padding:0 var(--sol-select-padding-x);font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background-color:var(--sol-select-bg);border:var(--sol-input-border, var(--sol-select-border-width) solid var(--sol-select-border));border-radius:var(--sol-select-radius);box-shadow:var(--sol-select-shadow);cursor:pointer;transition:border-color var(--sol-select-transition),box-shadow var(--sol-select-transition);text-align:left}.sol-select__trigger:focus{outline:none;border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__trigger:disabled{cursor:not-allowed;opacity:var(--sol-select-disabled-opacity)}.sol-select__trigger--error{border-color:var(--sol-select-error-color)}.sol-select__trigger--open{border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__display{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-select__display--placeholder{color:var(--sol-select-placeholder)}.sol-select__arrow{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--sol-select-arrow-color);transition:transform var(--sol-select-transition)}.sol-select__arrow--open{transform:rotate(180deg)}.sol-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--sol-select-dropdown-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:var(--sol-select-radius);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0,0,0,.15));max-height:280px;display:flex;flex-direction:column;animation:sol-select-fade .12s ease-out}.sol-select__search-box{padding:.5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__search{width:100%;height:2rem;padding:0 .5rem;font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background:var(--sol-select-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);outline:none}.sol-select__search:focus{border-color:var(--sol-select-border-focus)}.sol-select__bulk-actions{display:flex;gap:.25rem;padding:.375rem .5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__bulk-btn{flex:1;padding:.25rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--sol-select-option-active-text);background:transparent;border:1px solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__bulk-btn:hover{background:var(--sol-select-option-hover)}.sol-select__options{overflow-y:auto;flex:1;padding:.25rem 0}.sol-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:var(--sol-select-font-size);color:var(--sol-select-text);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__option:hover{background:var(--sol-select-option-hover)}.sol-select__option--active{background:var(--sol-select-option-active-bg);color:var(--sol-select-option-active-text);font-weight:500}.sol-select__check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;border:2px solid var(--sol-select-border);border-radius:3px;font-size:.65rem;flex-shrink:0}.sol-select__check--checked{background:var(--sol-select-option-active-text);border-color:var(--sol-select-option-active-text);color:#fff}.sol-select__empty{padding:.75rem;text-align:center;color:var(--sol-select-placeholder);font-size:var(--sol-select-font-size)}.sol-select__error{margin:.25rem 0 0;font-size:var(--sol-select-label-font-size);color:var(--sol-select-error-color);line-height:1.4}.sol-select__dropdown--up{top:auto;bottom:calc(100% + 4px);animation:sol-select-fade-up .12s ease-out}@keyframes sol-select-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sol-select-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(max-width:640px){.sol-select__search,.sol-select__trigger{font-size:16px}}\n"] }]
|
|
1331
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], showAllOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAllOption", required: false }] }], allOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allOptionLabel", required: false }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], dropdownPanel: [{ type: i0.ViewChild, args: ['dropdownPanel', { isSignal: true }] }], onDocumentClick: [{
|
|
1395
|
+
`, styles: [":host{display:block}:host,.sol-select__dropdown{--sol-select-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-select-text: var(--sol-color-text-primary, #1e293b);--sol-select-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-select-border: var(--sol-border-color-default, #cbd5e1);--sol-select-border-focus: var(--sol-color-primary, #6366f1);--sol-select-error-color: var(--sol-color-danger, #ef4444);--sol-select-label-color: var(--sol-color-text-secondary, #475569);--sol-select-arrow-color: var(--sol-color-text-muted, #94a3b8);--sol-select-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-select-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-select-border-width: var(--sol-border-width-default, 1px);--sol-select-padding-x: var(--sol-space-sm, .75rem);--sol-select-height: var(--sol-size-input-height, 2.5rem);--sol-select-font-size: var(--sol-font-size-base, .875rem);--sol-select-label-font-size: var(--sol-font-size-sm, .75rem);--sol-select-label-font-weight: var(--sol-font-weight-bold, 600);--sol-select-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0,0,0,.05)));--sol-select-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-select-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-select-dropdown-bg: var(--sol-bg-surface, #ffffff);--sol-select-option-hover: var(--sol-color-bg-hover, rgba(0,0,0,.04));--sol-select-option-active-bg: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sol-select-option-active-text: var(--sol-color-primary, #6366f1)}.sol-select__label{display:block;margin-bottom:.375rem;font-size:var(--sol-select-label-font-size);font-weight:var(--sol-select-label-font-weight);color:var(--sol-select-label-color);line-height:1.4}.sol-select__wrapper{position:relative;display:block}.sol-select__trigger{display:flex;align-items:center;justify-content:space-between;width:100%;height:var(--sol-select-height);padding:0 var(--sol-select-padding-x);font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background-color:var(--sol-select-bg);border:var(--sol-input-border, var(--sol-select-border-width) solid var(--sol-select-border));border-radius:var(--sol-select-radius);box-shadow:var(--sol-select-shadow);cursor:pointer;transition:border-color var(--sol-select-transition),box-shadow var(--sol-select-transition);text-align:left}.sol-select__trigger:focus{outline:none;border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__trigger:disabled{cursor:not-allowed;opacity:var(--sol-select-disabled-opacity)}.sol-select__trigger--error{border-color:var(--sol-select-error-color)}.sol-select__trigger--open{border:var(--sol-input-focus-border, var(--sol-select-border-width) solid var(--sol-select-border-focus));box-shadow:var(--sol-select-focus-ring)}.sol-select__display{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-select__display--placeholder{color:var(--sol-select-placeholder)}.sol-select__arrow{width:1.25rem;height:1.25rem;flex-shrink:0;color:var(--sol-select-arrow-color);transition:transform var(--sol-select-transition)}.sol-select__arrow--open{transform:rotate(180deg)}.sol-select__dropdown{position:absolute;top:calc(100% + 4px);left:0;right:0;background:var(--sol-select-dropdown-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:var(--sol-select-radius);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0,0,0,.15));max-height:280px;display:flex;flex-direction:column;animation:sol-select-fade .12s ease-out}.sol-select__search-box{padding:.5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__search{width:100%;height:2rem;padding:0 .5rem;font-family:inherit;font-size:var(--sol-select-font-size);color:var(--sol-select-text);background:var(--sol-select-bg);border:var(--sol-select-border-width) solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);outline:none}.sol-select__search:focus{border-color:var(--sol-select-border-focus)}.sol-select__bulk-actions{display:flex;gap:.25rem;padding:.375rem .5rem;border-bottom:1px solid var(--sol-select-border)}.sol-select__bulk-btn{flex:1;padding:.25rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.03em;color:var(--sol-select-option-active-text);background:transparent;border:1px solid var(--sol-select-border);border-radius:calc(var(--sol-select-radius) - 2px);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__bulk-btn:hover{background:var(--sol-select-option-hover)}.sol-select__options{overflow-y:auto;flex:1;padding:.25rem 0}.sol-select__option{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:var(--sol-select-font-size);color:var(--sol-select-text);cursor:pointer;transition:background var(--sol-select-transition)}.sol-select__option:hover{background:var(--sol-select-option-hover)}.sol-select__option--active{background:var(--sol-select-option-active-bg);color:var(--sol-select-option-active-text);font-weight:500}.sol-select__check{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;border:2px solid var(--sol-select-border);border-radius:3px;font-size:.65rem;flex-shrink:0}.sol-select__check--checked{background:var(--sol-select-option-active-text);border-color:var(--sol-select-option-active-text);color:#fff}.sol-select__empty{padding:.75rem;text-align:center;color:var(--sol-select-placeholder);font-size:var(--sol-select-font-size)}.sol-select__error{margin:.25rem 0 0;font-size:var(--sol-select-label-font-size);color:var(--sol-select-error-color);line-height:1.4}.sol-select__dropdown--up{top:auto;bottom:calc(100% + 4px);animation:sol-select-fade-up .12s ease-out}@keyframes sol-select-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes sol-select-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(max-width:640px){.sol-select__search,.sol-select__trigger{font-size:16px}}:host(.sol-select--touch) .sol-select__trigger,.sol-select__dropdown--touch .sol-select__search{font-size:var(--sol-font-size-touch-input, 16px)}\n"] }]
|
|
1396
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], showAllOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAllOption", required: false }] }], allOptionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "allOptionLabel", required: false }] }], mobileBreakpoint: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileBreakpoint", required: false }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], dropdownPanel: [{ type: i0.ViewChild, args: ['dropdownPanel', { isSignal: true }] }], onDocumentClick: [{
|
|
1332
1397
|
type: HostListener,
|
|
1333
1398
|
args: ['document:click', ['$event']]
|
|
1399
|
+
}], onViewportResize: [{
|
|
1400
|
+
type: HostListener,
|
|
1401
|
+
args: ['window:resize']
|
|
1334
1402
|
}] } });
|
|
1335
1403
|
|
|
1336
1404
|
class SolTextareaComponent {
|
|
@@ -2052,7 +2120,7 @@ class SolCardComponent {
|
|
|
2052
2120
|
<div [class]="hostClasses()">
|
|
2053
2121
|
<ng-content />
|
|
2054
2122
|
</div>
|
|
2055
|
-
`, isInline: true, styles: [".sol-card{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #e5e7eb));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm, 0 1px 3px rgba(0, 0, 0, .08)));-webkit-backdrop-filter:var(--sol-card-blur, none);backdrop-filter:var(--sol-card-blur, none);transition:box-shadow var(--sol-dur-base, .24s) var(--sol-ease, ease),transform var(--sol-dur-base, .24s) var(--sol-ease, ease)}.sol-card:hover{transform:translateY(var(--sol-hover-lift, 0px));box-shadow:var(--sol-card-shadow-hover, var(--sol-card-shadow, var(--sol-shadow-sm)))}.sol-card-padded{padding:1.5rem}.sol-card-hoverable{cursor:pointer}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2123
|
+
`, isInline: true, styles: [":host{display:block}.sol-card{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #e5e7eb));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm, 0 1px 3px rgba(0, 0, 0, .08)));-webkit-backdrop-filter:var(--sol-card-blur, none);backdrop-filter:var(--sol-card-blur, none);transition:box-shadow var(--sol-dur-base, .24s) var(--sol-ease, ease),transform var(--sol-dur-base, .24s) var(--sol-ease, ease)}.sol-card:hover{transform:translateY(var(--sol-hover-lift, 0px));box-shadow:var(--sol-card-shadow-hover, var(--sol-card-shadow, var(--sol-shadow-sm)))}.sol-card-padded{padding:1.5rem}.sol-card-hoverable{cursor:pointer}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2056
2124
|
}
|
|
2057
2125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolCardComponent, decorators: [{
|
|
2058
2126
|
type: Component,
|
|
@@ -2060,7 +2128,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
2060
2128
|
<div [class]="hostClasses()">
|
|
2061
2129
|
<ng-content />
|
|
2062
2130
|
</div>
|
|
2063
|
-
`, styles: [".sol-card{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #e5e7eb));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm, 0 1px 3px rgba(0, 0, 0, .08)));-webkit-backdrop-filter:var(--sol-card-blur, none);backdrop-filter:var(--sol-card-blur, none);transition:box-shadow var(--sol-dur-base, .24s) var(--sol-ease, ease),transform var(--sol-dur-base, .24s) var(--sol-ease, ease)}.sol-card:hover{transform:translateY(var(--sol-hover-lift, 0px));box-shadow:var(--sol-card-shadow-hover, var(--sol-card-shadow, var(--sol-shadow-sm)))}.sol-card-padded{padding:1.5rem}.sol-card-hoverable{cursor:pointer}\n"] }]
|
|
2131
|
+
`, styles: [":host{display:block}.sol-card{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #e5e7eb));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm, 0 1px 3px rgba(0, 0, 0, .08)));-webkit-backdrop-filter:var(--sol-card-blur, none);backdrop-filter:var(--sol-card-blur, none);transition:box-shadow var(--sol-dur-base, .24s) var(--sol-ease, ease),transform var(--sol-dur-base, .24s) var(--sol-ease, ease)}.sol-card:hover{transform:translateY(var(--sol-hover-lift, 0px));box-shadow:var(--sol-card-shadow-hover, var(--sol-card-shadow, var(--sol-shadow-sm)))}.sol-card-padded{padding:1.5rem}.sol-card-hoverable{cursor:pointer}\n"] }]
|
|
2064
2132
|
}], propDecorators: { padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], hoverable: [{ type: i0.Input, args: [{ isSignal: true, alias: "hoverable", required: false }] }] } });
|
|
2065
2133
|
|
|
2066
2134
|
class SolSpinnerComponent {
|
|
@@ -5588,6 +5656,13 @@ const THEME_SOURCE = new InjectionToken('THEME_SOURCE', {
|
|
|
5588
5656
|
// Null-object: no host adapter → no tenant theme → default is used.
|
|
5589
5657
|
factory: () => ({ async loadTheme() { return null; } }),
|
|
5590
5658
|
});
|
|
5659
|
+
/**
|
|
5660
|
+
* The bundled "Vértice" ThemeFile as a plain constant (0.6.0). It is the
|
|
5661
|
+
* factory value of `SOL_DEFAULT_THEME` and the default base theme of the
|
|
5662
|
+
* headless Theme Studio builder (`@solercia/ui/theme-studio`). Treat it as
|
|
5663
|
+
* read-only: clone it before mutating.
|
|
5664
|
+
*/
|
|
5665
|
+
const SOL_BUNDLED_DEFAULT_THEME = defaultTheme;
|
|
5591
5666
|
/**
|
|
5592
5667
|
* The theme the library ships with and applies when there is no tenant theme.
|
|
5593
5668
|
* Defaults to the bundled "Vértice" theme (a full ThemeFile that mirrors the
|
|
@@ -5598,7 +5673,7 @@ const THEME_SOURCE = new InjectionToken('THEME_SOURCE', {
|
|
|
5598
5673
|
*/
|
|
5599
5674
|
const SOL_DEFAULT_THEME = new InjectionToken('SOL_DEFAULT_THEME', {
|
|
5600
5675
|
providedIn: 'root',
|
|
5601
|
-
factory: () =>
|
|
5676
|
+
factory: () => SOL_BUNDLED_DEFAULT_THEME,
|
|
5602
5677
|
});
|
|
5603
5678
|
|
|
5604
5679
|
/**
|
|
@@ -5632,7 +5707,7 @@ const THEME_PREF_KEY = 'sol-dark-mode';
|
|
|
5632
5707
|
/** Atajo para defaults v2 que copian otra ruta ya resuelta del contrato (respeta el modo). */
|
|
5633
5708
|
const sameAs = (path) => (ctx) => ctx.resolve(path);
|
|
5634
5709
|
/**
|
|
5635
|
-
* Tabla única de "qué variables existen":
|
|
5710
|
+
* Tabla única de "qué variables existen": 96 filas (47 v1 obligatorias + 49 v2
|
|
5636
5711
|
* con default). Cada fila es [nombreCssVar, rutaDelToken, defaultV1?]; la ruta
|
|
5637
5712
|
* apunta dentro de `{ primitives, semantic, component }` (ver `resolveCssVars`).
|
|
5638
5713
|
* Agregar/quitar una fila cambia el conjunto emitido — por eso el test de tokens
|
|
@@ -5642,6 +5717,8 @@ const EMIT_TABLE = [
|
|
|
5642
5717
|
// Colors
|
|
5643
5718
|
['--sol-color-primary', 'semantic.color.primary'],
|
|
5644
5719
|
['--sol-color-secondary', 'semantic.color.secondary'],
|
|
5720
|
+
// Text color for secondary actions (Cancel-style buttons); consumed by sol-button.
|
|
5721
|
+
['--sol-color-secondary-contrast', 'semantic.color.secondaryContrast', '#1E293B'],
|
|
5645
5722
|
['--sol-color-accent', 'semantic.color.accent'],
|
|
5646
5723
|
['--sol-color-success', 'semantic.color.success'],
|
|
5647
5724
|
['--sol-color-warning', 'semantic.color.warning'],
|
|
@@ -5673,6 +5750,10 @@ const EMIT_TABLE = [
|
|
|
5673
5750
|
['--sol-size-component-sm', 'primitives.size.control.sm'],
|
|
5674
5751
|
['--sol-size-component-md', 'primitives.size.control.md'],
|
|
5675
5752
|
['--sol-size-component-lg', 'primitives.size.control.lg'],
|
|
5753
|
+
// Additive mobile minimums (Fitts / iOS auto-zoom): consumed inside media
|
|
5754
|
+
// queries only, so desktop density is untouched.
|
|
5755
|
+
['--sol-size-control-touch', 'primitives.size.control.touch', '44px'],
|
|
5756
|
+
['--sol-font-size-touch-input', 'primitives.font.size.touchInput', '16px'],
|
|
5676
5757
|
['--sol-size-sidebar-width', 'component.layout.sidebarWidth'],
|
|
5677
5758
|
['--sol-size-header-height', 'component.layout.headerHeight'],
|
|
5678
5759
|
// Spacing
|
|
@@ -5766,6 +5847,10 @@ const EMIT_TABLE = [
|
|
|
5766
5847
|
// cuadro de diálogo lo lleve por defecto; un tema puede subirlo (glass) o
|
|
5767
5848
|
// anularlo ("none", p. ej. skins planos/brutalistas).
|
|
5768
5849
|
['--sol-overlay-blur', 'component.overlay.blur', 'blur(3px)'],
|
|
5850
|
+
// Contraste del primario (por modo): texto/ícono sobre el primario. Los componentes ya lo
|
|
5851
|
+
// consumían con fallback blanco; ahora el tema lo fija para primarios claros
|
|
5852
|
+
// (menta, amarillo), que necesitan texto oscuro encima.
|
|
5853
|
+
['--sol-color-primary-contrast', 'semantic.color.primaryContrast', '#FFFFFF'],
|
|
5769
5854
|
];
|
|
5770
5855
|
/**
|
|
5771
5856
|
* Referencias `{ruta}` — GLOBAL: los temas v2 embeben refs dentro de shorthands
|
|
@@ -5969,7 +6054,7 @@ function isRenderableTheme(file) {
|
|
|
5969
6054
|
/**
|
|
5970
6055
|
* ThemeService — runtime de theming white-label, AGNÓSTICO del host.
|
|
5971
6056
|
*
|
|
5972
|
-
* Emite los
|
|
6057
|
+
* Emite los 96 tokens `--sol-*` sobre `:root` a partir de un `ThemeFile` y
|
|
5973
6058
|
* reacciona a tres entradas: el tema del tenant (cargado por el puerto
|
|
5974
6059
|
* `THEME_SOURCE` que provee el host), el default empaquetado
|
|
5975
6060
|
* (`SOL_DEFAULT_THEME`) y el toggle light/dark. NO conoce el ORIGEN del tema
|
|
@@ -6042,6 +6127,18 @@ class ThemeService {
|
|
|
6042
6127
|
return meta.logo?.altText?.trim() || meta.tenant || null;
|
|
6043
6128
|
}, /* @ts-ignore */
|
|
6044
6129
|
...(ngDevMode ? [{ debugName: "brandName" }] : /* istanbul ignore next */ []));
|
|
6130
|
+
/**
|
|
6131
|
+
* URL del favicon del TENANT: `meta.favicon` sanitizado si existe y es seguro;
|
|
6132
|
+
* si no, la URL del logo efectivo. `null` sin tema de tenant (se restaura el
|
|
6133
|
+
* favicon empaquetado del host).
|
|
6134
|
+
*/
|
|
6135
|
+
tenantFavicon = computed(() => {
|
|
6136
|
+
const tenant = this.tenantTheme();
|
|
6137
|
+
if (!tenant)
|
|
6138
|
+
return null;
|
|
6139
|
+
return sanitizeAssetUrl(tenant.meta?.favicon) ?? this.logo()?.url ?? null;
|
|
6140
|
+
}, /* @ts-ignore */
|
|
6141
|
+
...(ngDevMode ? [{ debugName: "tenantFavicon" }] : /* istanbul ignore next */ []));
|
|
6045
6142
|
/** href original del favicon empaquetado (index.html); se captura una sola vez. */
|
|
6046
6143
|
faviconOriginalHref = null;
|
|
6047
6144
|
faviconCaptured = false;
|
|
@@ -6063,11 +6160,11 @@ class ThemeService {
|
|
|
6063
6160
|
}
|
|
6064
6161
|
});
|
|
6065
6162
|
// Favicon: SOLO el tema del tenant rebrandea; el default restaura el de
|
|
6066
|
-
// index.html. `
|
|
6067
|
-
//
|
|
6163
|
+
// index.html. `meta.favicon` (0.6.0, sanitizado) manda cuando existe; sin
|
|
6164
|
+
// él, el favicon sigue al logo efectivo del modo actual (logo dual), así
|
|
6165
|
+
// que reacciona también al toggle light/dark.
|
|
6068
6166
|
effect(() => {
|
|
6069
|
-
|
|
6070
|
-
this.applyFavicon(tenantLogo?.url ?? null);
|
|
6167
|
+
this.applyFavicon(this.tenantFavicon());
|
|
6071
6168
|
});
|
|
6072
6169
|
// Fuentes web por tenant (v2): un ÚNICO <link> a Google Fonts construido
|
|
6073
6170
|
// por código (family + weights). Cambiar de tema reemplaza el link; un
|
|
@@ -6088,15 +6185,74 @@ class ThemeService {
|
|
|
6088
6185
|
* en vez de que la librería tire vía THEME_SOURCE). Validado como cualquier
|
|
6089
6186
|
* tema: uno inválido cae al default. Útil para hosts que ya tienen el tema en
|
|
6090
6187
|
* memoria (SSR, caché) o que no quieren implementar un ThemeSource.
|
|
6188
|
+
*
|
|
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`).
|
|
6091
6192
|
*/
|
|
6092
6193
|
setTenantTheme(theme) {
|
|
6093
|
-
|
|
6194
|
+
const validated = isRenderableTheme(theme) ? theme : null;
|
|
6195
|
+
this.tenantTheme.set(validated);
|
|
6196
|
+
this.applyEntityDefaultMode(validated);
|
|
6197
|
+
}
|
|
6198
|
+
/**
|
|
6199
|
+
* Aplica `meta.defaultMode` del tema de la entidad (BD) como AUTORIDAD en
|
|
6200
|
+
* cada carga: cuando el tema declara un modo por defecto, ese modo gana
|
|
6201
|
+
* SIEMPRE, sobrescribiendo cualquier valor viejo en `localStorage`. Asi
|
|
6202
|
+
* ningun navegador se queda "pegado" en un modo antiguo — al recargar, el
|
|
6203
|
+
* modo vuelve a salir de BD. El toggle sol/luna sigue funcionando como
|
|
6204
|
+
* override en vivo dentro de la sesion; el siguiente arranque vuelve a
|
|
6205
|
+
* imponer el valor de BD. Si el tema NO declara `defaultMode` (v1), no se
|
|
6206
|
+
* toca nada y rige la preferencia local / del sistema de siempre.
|
|
6207
|
+
*
|
|
6208
|
+
* Se llama desde los DOS caminos que fijan el tema del tenant: el PUSH
|
|
6209
|
+
* (`setTenantTheme`) y el PULL via THEME_SOURCE (`loadTenantTheme`), para
|
|
6210
|
+
* que el shell real de PANDORA (que tira el tema) tambien lo honre.
|
|
6211
|
+
*/
|
|
6212
|
+
applyEntityDefaultMode(theme) {
|
|
6213
|
+
const defaultMode = theme?.meta?.defaultMode;
|
|
6214
|
+
if (defaultMode === undefined)
|
|
6215
|
+
return;
|
|
6216
|
+
const dark = defaultMode === 'dark';
|
|
6217
|
+
this._isDark.set(dark);
|
|
6218
|
+
this.applyDarkClass(dark);
|
|
6219
|
+
// Sincroniza localStorage con el valor de BD para que el estado quede
|
|
6220
|
+
// consistente y el navegador nunca conserve un modo obsoleto.
|
|
6221
|
+
try {
|
|
6222
|
+
localStorage.setItem(THEME_PREF_KEY, String(dark));
|
|
6223
|
+
}
|
|
6224
|
+
catch {
|
|
6225
|
+
// Storage inaccesible: el modo queda aplicado en memoria de todos modos.
|
|
6226
|
+
}
|
|
6227
|
+
}
|
|
6228
|
+
/**
|
|
6229
|
+
* Fija el modo oscuro/claro y lo PERSISTE como elección EXPLÍCITA del
|
|
6230
|
+
* usuario (toggle sol/luna, o "Aplicar tema" del Theme Studio). A partir de
|
|
6231
|
+
* este punto `hasExplicitModePreference()` es `true`; la siguiente carga del
|
|
6232
|
+
* tema vuelve a imponer `meta.defaultMode` de BD.
|
|
6233
|
+
*/
|
|
6234
|
+
setDarkMode(dark) {
|
|
6235
|
+
this._isDark.set(dark);
|
|
6236
|
+
try {
|
|
6237
|
+
localStorage.setItem(THEME_PREF_KEY, String(dark));
|
|
6238
|
+
}
|
|
6239
|
+
catch {
|
|
6240
|
+
// Storage inaccesible (incógnito/navegador restringido): el modo queda
|
|
6241
|
+
// aplicado en memoria, solo no persiste entre sesiones.
|
|
6242
|
+
}
|
|
6243
|
+
this.applyDarkClass(dark);
|
|
6094
6244
|
}
|
|
6095
6245
|
toggleMode() {
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6246
|
+
this.setDarkMode(!this._isDark());
|
|
6247
|
+
}
|
|
6248
|
+
/** `true` si este navegador ya tiene una elección EXPLÍCITA de modo (toggle) en `localStorage`. */
|
|
6249
|
+
hasExplicitModePreference() {
|
|
6250
|
+
try {
|
|
6251
|
+
return localStorage.getItem(THEME_PREF_KEY) !== null;
|
|
6252
|
+
}
|
|
6253
|
+
catch {
|
|
6254
|
+
return false;
|
|
6255
|
+
}
|
|
6100
6256
|
}
|
|
6101
6257
|
/**
|
|
6102
6258
|
* Fuerza la recarga del tema del tenant activo (Theme Studio: tras el PUT
|
|
@@ -6128,6 +6284,7 @@ class ThemeService {
|
|
|
6128
6284
|
return;
|
|
6129
6285
|
if (isRenderableTheme(file)) {
|
|
6130
6286
|
this.tenantTheme.set(file);
|
|
6287
|
+
this.applyEntityDefaultMode(file);
|
|
6131
6288
|
}
|
|
6132
6289
|
else {
|
|
6133
6290
|
console.warn(`ThemeService: el tema de la empresa ${companyId} llegó inválido o vacío; se aplica el tema por defecto.`);
|
|
@@ -6148,7 +6305,13 @@ class ThemeService {
|
|
|
6148
6305
|
return companyId !== (this.tenantResolver?.activeTenantId() ?? null);
|
|
6149
6306
|
}
|
|
6150
6307
|
loadDarkPreference() {
|
|
6151
|
-
|
|
6308
|
+
let stored = null;
|
|
6309
|
+
try {
|
|
6310
|
+
stored = localStorage.getItem(THEME_PREF_KEY);
|
|
6311
|
+
}
|
|
6312
|
+
catch {
|
|
6313
|
+
stored = null;
|
|
6314
|
+
}
|
|
6152
6315
|
if (stored !== null)
|
|
6153
6316
|
return stored === 'true';
|
|
6154
6317
|
// matchMedia no existe en jsdom — sin señal del sistema, modo claro.
|
|
@@ -6253,6 +6416,25 @@ function provideTheme() {
|
|
|
6253
6416
|
});
|
|
6254
6417
|
}
|
|
6255
6418
|
|
|
6419
|
+
/**
|
|
6420
|
+
* Modelo de tokens en 3 niveles (W3C DTCG-aligned): primitivos → semánticos → componente.
|
|
6421
|
+
* Los niveles VIVEN en esta fuente TS + `themes/default.theme.json` y se resuelven hacia
|
|
6422
|
+
* abajo (ver `resolveCssVars` en `theme.service.ts`) hacia el conjunto de variables
|
|
6423
|
+
* `--sol-*` de la `EMIT_TABLE`.
|
|
6424
|
+
*
|
|
6425
|
+
* ThemeFile v2 (E8 — skins white-label): todos los bloques nuevos son OPCIONALES (`?`).
|
|
6426
|
+
* Un ThemeFile v1 sigue siendo válido sin cambios: cada token v2 ausente emite su
|
|
6427
|
+
* default (el look del `default.json` actual). Ver `ThemeFile-v2-SPEC.md` del handoff.
|
|
6428
|
+
*/
|
|
6429
|
+
/** Catálogo ordenado de variantes de tabla (para selectores y validación). */
|
|
6430
|
+
const SOL_TABLE_VARIANTS = [
|
|
6431
|
+
'clean',
|
|
6432
|
+
'zebra',
|
|
6433
|
+
'bordered',
|
|
6434
|
+
'emphasis-header',
|
|
6435
|
+
'banded',
|
|
6436
|
+
];
|
|
6437
|
+
|
|
6256
6438
|
/**
|
|
6257
6439
|
* Variables `--sol-*` que alimentan el chart y su fallback (valores del modo
|
|
6258
6440
|
* light de `styles.css`). El fallback solo aplica si la variable no resuelve
|
|
@@ -8520,7 +8702,7 @@ class SolIconButtonComponent {
|
|
|
8520
8702
|
>
|
|
8521
8703
|
<sol-icon [name]="icon()" [size]="iconSize()" />
|
|
8522
8704
|
</button>
|
|
8523
|
-
`, isInline: true, styles: [":host{display:inline-block}.sol-icon-btn{display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:var(--sol-button-radius, var(--sol-border-radius-md, .5rem));background:transparent;color:var(--sol-color-text-muted, #64748b);cursor:pointer;transition:background-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease),transform var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-icon-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .96))}.sol-icon-btn:focus-visible{outline:none;box-shadow:var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent))}.sol-icon-btn:disabled{cursor:not-allowed;opacity:var(--sol-disabled-opacity, .55)}.sol-icon-btn--default{border-color:var(--sol-border-color-default, #e2e8f0);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--default:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,var(--sol-bg-surface, #fff));color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--danger{color:var(--sol-color-danger, #ef4444)}.sol-icon-btn--danger:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent)}.sol-icon-btn--ghost{color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--ghost:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 10%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--sm{width:32px;height:32px}.sol-icon-btn--md{width:36px;height:36px}.sol-icon-btn--lg{width:40px;height:40px}.sol-icon-btn--touch{width:44px;height:44px}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8705
|
+
`, isInline: true, styles: [":host{display:inline-block}.sol-icon-btn{display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:var(--sol-button-radius, var(--sol-border-radius-md, .5rem));background:transparent;color:var(--sol-color-text-muted, #64748b);cursor:pointer;transition:background-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease),transform var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-icon-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .96))}.sol-icon-btn:focus-visible{outline:none;box-shadow:var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent))}.sol-icon-btn:disabled{cursor:not-allowed;opacity:var(--sol-disabled-opacity, .55)}.sol-icon-btn--default{border-color:var(--sol-border-color-default, #e2e8f0);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--default:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,var(--sol-bg-surface, #fff));color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--danger{color:var(--sol-color-danger, #ef4444)}.sol-icon-btn--danger:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent)}.sol-icon-btn--ghost{color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--ghost:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 10%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--outline{border-color:var(--sol-border-color-default, #e2e8f0);background:transparent;color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--outline:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--sm{width:32px;height:32px}.sol-icon-btn--md{width:36px;height:36px}.sol-icon-btn--lg{width:40px;height:40px}.sol-icon-btn--touch{width:44px;height:44px}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8524
8706
|
}
|
|
8525
8707
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolIconButtonComponent, decorators: [{
|
|
8526
8708
|
type: Component,
|
|
@@ -8534,7 +8716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
8534
8716
|
>
|
|
8535
8717
|
<sol-icon [name]="icon()" [size]="iconSize()" />
|
|
8536
8718
|
</button>
|
|
8537
|
-
`, styles: [":host{display:inline-block}.sol-icon-btn{display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:var(--sol-button-radius, var(--sol-border-radius-md, .5rem));background:transparent;color:var(--sol-color-text-muted, #64748b);cursor:pointer;transition:background-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease),transform var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-icon-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .96))}.sol-icon-btn:focus-visible{outline:none;box-shadow:var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent))}.sol-icon-btn:disabled{cursor:not-allowed;opacity:var(--sol-disabled-opacity, .55)}.sol-icon-btn--default{border-color:var(--sol-border-color-default, #e2e8f0);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--default:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,var(--sol-bg-surface, #fff));color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--danger{color:var(--sol-color-danger, #ef4444)}.sol-icon-btn--danger:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent)}.sol-icon-btn--ghost{color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--ghost:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 10%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--sm{width:32px;height:32px}.sol-icon-btn--md{width:36px;height:36px}.sol-icon-btn--lg{width:40px;height:40px}.sol-icon-btn--touch{width:44px;height:44px}\n"] }]
|
|
8719
|
+
`, styles: [":host{display:inline-block}.sol-icon-btn{display:grid;place-items:center;padding:0;border:1px solid transparent;border-radius:var(--sol-button-radius, var(--sol-border-radius-md, .5rem));background:transparent;color:var(--sol-color-text-muted, #64748b);cursor:pointer;transition:background-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease),transform var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-icon-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .96))}.sol-icon-btn:focus-visible{outline:none;box-shadow:var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent))}.sol-icon-btn:disabled{cursor:not-allowed;opacity:var(--sol-disabled-opacity, .55)}.sol-icon-btn--default{border-color:var(--sol-border-color-default, #e2e8f0);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--default:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,var(--sol-bg-surface, #fff));color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--danger{color:var(--sol-color-danger, #ef4444)}.sol-icon-btn--danger:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-danger, #ef4444) 12%,transparent)}.sol-icon-btn--ghost{color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--ghost:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 10%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--outline{border-color:var(--sol-border-color-default, #e2e8f0);background:transparent;color:var(--sol-color-text-muted, #64748b)}.sol-icon-btn--outline:hover:not(:disabled){background:color-mix(in srgb,var(--sol-color-primary, #2563eb) 8%,transparent);color:var(--sol-color-text-primary, #0f172a)}.sol-icon-btn--sm{width:32px;height:32px}.sol-icon-btn--md{width:36px;height:36px}.sol-icon-btn--lg{width:40px;height:40px}.sol-icon-btn--touch{width:44px;height:44px}\n"] }]
|
|
8538
8720
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: true }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
8539
8721
|
|
|
8540
8722
|
/**
|
|
@@ -8641,9 +8823,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
8641
8823
|
}], ctorParameters: () => [], propDecorators: { solRowReveal: [{ type: i0.Input, args: [{ isSignal: true, alias: "solRowReveal", required: false }] }], solRowRevealIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "solRowRevealIndex", required: false }] }], solRowRevealReplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "solRowRevealReplay", required: false }] }] } });
|
|
8642
8824
|
/**
|
|
8643
8825
|
* Tabla de datos genérica dirigida por columnas: búsqueda, orden, paginación,
|
|
8644
|
-
* estado de carga (skeleton), estado vacío
|
|
8645
|
-
*
|
|
8646
|
-
*
|
|
8826
|
+
* estado de carga (skeleton), estado vacío, filtros por columna (opt-in, ver
|
|
8827
|
+
* `DataTableColumn.filter`) y acciones por fila (posición configurable, ver
|
|
8828
|
+
* `actionsPosition`). Colapsa cada fila a un resumen expandible (sin scroll
|
|
8829
|
+
* horizontal) cuando el tema activo lo prefiere
|
|
8830
|
+
* (`component.table.mobile: "collapse"`) y el ancho de su propio HOST — no
|
|
8831
|
+
* del viewport del navegador, ver `collapseWidth` — cae por debajo del
|
|
8832
|
+
* umbral: una tabla dentro de un layout angosto (sidebar, grid a dos
|
|
8833
|
+
* columnas) colapsa aunque la ventana siga en ancho desktop.
|
|
8647
8834
|
*
|
|
8648
8835
|
* Componente presentacional: no conoce dominio. Las acciones no genéricas se
|
|
8649
8836
|
* proyectan por el slot `#rowActions` (TemplateRef que recibe la fila).
|
|
@@ -8651,6 +8838,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
8651
8838
|
*/
|
|
8652
8839
|
class SolDataTableComponent {
|
|
8653
8840
|
themeService = inject(ThemeService);
|
|
8841
|
+
host = inject(ElementRef);
|
|
8654
8842
|
data = input([], /* @ts-ignore */
|
|
8655
8843
|
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
8656
8844
|
columns = input([], /* @ts-ignore */
|
|
@@ -8682,6 +8870,16 @@ class SolDataTableComponent {
|
|
|
8682
8870
|
/** Encabezado de la columna de acciones. */
|
|
8683
8871
|
actionsLabel = input('Acciones', /* @ts-ignore */
|
|
8684
8872
|
...(ngDevMode ? [{ debugName: "actionsLabel" }] : /* istanbul ignore next */ []));
|
|
8873
|
+
/**
|
|
8874
|
+
* Posición de la columna de acciones (0.6.0). `'end'` (default) preserva
|
|
8875
|
+
* el comportamiento previo — th/td de acciones después de las columnas de
|
|
8876
|
+
* datos. `'start'` los renderiza ANTES, como primera columna (aplica al
|
|
8877
|
+
* `#rowActions` proyectado y a los botones editar/eliminar por defecto
|
|
8878
|
+
* por igual). Sin efecto en el modo colapsado móvil: ahí las acciones
|
|
8879
|
+
* siguen viviendo solo en el detalle expandido de la card.
|
|
8880
|
+
*/
|
|
8881
|
+
actionsPosition = input('end', /* @ts-ignore */
|
|
8882
|
+
...(ngDevMode ? [{ debugName: "actionsPosition" }] : /* istanbul ignore next */ []));
|
|
8685
8883
|
/**
|
|
8686
8884
|
* aria-label del botón ▶ de expansión de fila en el modo móvil. El default
|
|
8687
8885
|
* se alinea con el texto de la clave i18n `shared.table.toggleDetails`
|
|
@@ -8702,6 +8900,26 @@ class SolDataTableComponent {
|
|
|
8702
8900
|
*/
|
|
8703
8901
|
rowReveal = input(true, /* @ts-ignore */
|
|
8704
8902
|
...(ngDevMode ? [{ debugName: "rowReveal" }] : /* istanbul ignore next */ []));
|
|
8903
|
+
/**
|
|
8904
|
+
* Ancho (px) del HOST bajo el cual la tabla colapsa a cards (0.6.0).
|
|
8905
|
+
* Reemplaza el criterio anterior, que solo miraba el viewport del
|
|
8906
|
+
* navegador (`matchMedia`) — la fuente de verdad ahora es un
|
|
8907
|
+
* `ResizeObserver` sobre el propio elemento raíz del componente, así que
|
|
8908
|
+
* una tabla dentro de un contenedor angosto (sidebar, grid a dos
|
|
8909
|
+
* columnas) colapsa aunque la ventana siga en ancho desktop. El default
|
|
8910
|
+
* (767) conserva el breakpoint canónico previo.
|
|
8911
|
+
*/
|
|
8912
|
+
collapseWidth = input(767, /* @ts-ignore */
|
|
8913
|
+
...(ngDevMode ? [{ debugName: "collapseWidth" }] : /* istanbul ignore next */ []));
|
|
8914
|
+
/**
|
|
8915
|
+
* Variante visual (0.6.0): `clean` | `zebra` | `bordered` | `emphasis-header`
|
|
8916
|
+
* | `banded`. Sobrescribe `component.table.variant` del tema activo; `null`
|
|
8917
|
+
* (default) deja decidir al tema y, si el tema tampoco la declara, la tabla
|
|
8918
|
+
* conserva su look de siempre. Los colores salen de `var(--sol-*)`, así que
|
|
8919
|
+
* la variante reacciona sola a claro/oscuro.
|
|
8920
|
+
*/
|
|
8921
|
+
variant = input(null, /* @ts-ignore */
|
|
8922
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
8705
8923
|
editClicked = output();
|
|
8706
8924
|
deleteClicked = output();
|
|
8707
8925
|
/**
|
|
@@ -8727,6 +8945,9 @@ class SolDataTableComponent {
|
|
|
8727
8945
|
...(ngDevMode ? [{ debugName: "sortKey" }] : /* istanbul ignore next */ []));
|
|
8728
8946
|
sortDirection = signal('asc', /* @ts-ignore */
|
|
8729
8947
|
...(ngDevMode ? [{ debugName: "sortDirection" }] : /* istanbul ignore next */ []));
|
|
8948
|
+
/** Valor de filtro por columna (0.6.0), indexado por `DataTableColumn.key`. */
|
|
8949
|
+
columnFilters = signal({}, /* @ts-ignore */
|
|
8950
|
+
...(ngDevMode ? [{ debugName: "columnFilters" }] : /* istanbul ignore next */ []));
|
|
8730
8951
|
/**
|
|
8731
8952
|
* Clave de replay de `solRowReveal`: cambia con cualquier búsqueda, orden
|
|
8732
8953
|
* o paginación — reinicia la animación de entrada de las filas visibles
|
|
@@ -8734,8 +8955,12 @@ class SolDataTableComponent {
|
|
|
8734
8955
|
*/
|
|
8735
8956
|
revealReplayKey = computed(() => `${this.searchTerm()}:${this.sortKey()}:${this.sortDirection()}:${this.currentPage()}`, /* @ts-ignore */
|
|
8736
8957
|
...(ngDevMode ? [{ debugName: "revealReplayKey" }] : /* istanbul ignore next */ []));
|
|
8737
|
-
/**
|
|
8738
|
-
|
|
8958
|
+
/**
|
|
8959
|
+
* Señal reactiva al ancho del HOST (0.6.0, ver `collapseWidth`): true
|
|
8960
|
+
* cuando el ResizeObserver mide un ancho <= `collapseWidth()`. Fuente de
|
|
8961
|
+
* verdad del colapso — ya NO es el viewport del navegador.
|
|
8962
|
+
*/
|
|
8963
|
+
isContainerNarrow = observeContainerWidth(this.host, this.collapseWidth);
|
|
8739
8964
|
/** Índices de las filas fantasma del estado de carga (7 filas fijas). */
|
|
8740
8965
|
skeletonRows = [0, 1, 2, 3, 4, 5, 6];
|
|
8741
8966
|
/**
|
|
@@ -8750,8 +8975,18 @@ class SolDataTableComponent {
|
|
|
8750
8975
|
return file?.modes?.[mode]?.component?.table?.mobile ?? 'collapse';
|
|
8751
8976
|
}, /* @ts-ignore */
|
|
8752
8977
|
...(ngDevMode ? [{ debugName: "tableMobileMode" }] : /* istanbul ignore next */ []));
|
|
8753
|
-
/**
|
|
8754
|
-
|
|
8978
|
+
/** Variante efectiva: el input manda; si no, `component.table.variant` del tema activo. */
|
|
8979
|
+
effectiveVariant = computed(() => {
|
|
8980
|
+
const own = this.variant();
|
|
8981
|
+
if (own)
|
|
8982
|
+
return own;
|
|
8983
|
+
const file = this.themeService.activeTheme();
|
|
8984
|
+
const mode = this.themeService.isDark() ? 'dark' : 'light';
|
|
8985
|
+
return file?.modes?.[mode]?.component?.table?.variant ?? null;
|
|
8986
|
+
}, /* @ts-ignore */
|
|
8987
|
+
...(ngDevMode ? [{ debugName: "effectiveVariant" }] : /* istanbul ignore next */ []));
|
|
8988
|
+
/** El modo colapsado aplica solo con host angosto (`collapseWidth`) y preferencia "collapse". */
|
|
8989
|
+
mobileCollapse = computed(() => this.isContainerNarrow() && this.tableMobileMode() === 'collapse', /* @ts-ignore */
|
|
8755
8990
|
...(ngDevMode ? [{ debugName: "mobileCollapse" }] : /* istanbul ignore next */ []));
|
|
8756
8991
|
/** Filas expandidas del modo colapsado (por id de trackBy). */
|
|
8757
8992
|
expandedRows = signal(new Set(), /* @ts-ignore */
|
|
@@ -8773,12 +9008,30 @@ class SolDataTableComponent {
|
|
|
8773
9008
|
return this.columns().filter((col) => col !== title && col !== subtitle && col !== badge);
|
|
8774
9009
|
}, /* @ts-ignore */
|
|
8775
9010
|
...(ngDevMode ? [{ debugName: "mobileDetailCols" }] : /* istanbul ignore next */ []));
|
|
9011
|
+
/** true si AL MENOS una columna declara `filter` — dispara la fila de filtros. */
|
|
9012
|
+
hasColumnFilters = computed(() => this.columns().some((col) => !!col.filter), /* @ts-ignore */
|
|
9013
|
+
...(ngDevMode ? [{ debugName: "hasColumnFilters" }] : /* istanbul ignore next */ []));
|
|
8776
9014
|
filteredData = computed(() => {
|
|
8777
9015
|
let result = [...this.data()];
|
|
8778
9016
|
const term = this.searchTerm().toLowerCase();
|
|
8779
9017
|
if (term) {
|
|
8780
9018
|
result = result.filter((row) => this.columns().some((col) => String(this.resolveValue(row, col.key) ?? '').toLowerCase().includes(term)));
|
|
8781
9019
|
}
|
|
9020
|
+
// Filtros por columna (0.6.0): se COMBINAN (AND) entre sí y con la
|
|
9021
|
+
// búsqueda global de arriba. 'select' es igualdad exacta (viene de un
|
|
9022
|
+
// desplegable con las opciones reales de la columna); 'text' es
|
|
9023
|
+
// contención — el mismo criterio que la búsqueda global.
|
|
9024
|
+
const activeFilters = Object.entries(this.columnFilters()).filter(([, value]) => value !== '');
|
|
9025
|
+
if (activeFilters.length > 0) {
|
|
9026
|
+
const columnByKey = new Map(this.columns().map((col) => [col.key, col]));
|
|
9027
|
+
result = result.filter((row) => activeFilters.every(([key, value]) => {
|
|
9028
|
+
const cellValue = String(this.resolveValue(row, key) ?? '').toLowerCase();
|
|
9029
|
+
const needle = value.toLowerCase();
|
|
9030
|
+
return columnByKey.get(key)?.filter === 'select'
|
|
9031
|
+
? cellValue === needle
|
|
9032
|
+
: cellValue.includes(needle);
|
|
9033
|
+
}));
|
|
9034
|
+
}
|
|
8782
9035
|
const key = this.sortKey();
|
|
8783
9036
|
if (key) {
|
|
8784
9037
|
const dir = this.sortDirection() === 'asc' ? 1 : -1;
|
|
@@ -8810,6 +9063,22 @@ class SolDataTableComponent {
|
|
|
8810
9063
|
}
|
|
8811
9064
|
return index;
|
|
8812
9065
|
}
|
|
9066
|
+
/**
|
|
9067
|
+
* Valores únicos (ordenados) de `column` dentro de `data()` — puebla el
|
|
9068
|
+
* `<select>` de su filtro (0.6.0). Deriva del dataset completo, no del ya
|
|
9069
|
+
* filtrado: así las opciones no desaparecen a medida que el propio
|
|
9070
|
+
* usuario filtra.
|
|
9071
|
+
*/
|
|
9072
|
+
columnFilterOptions(column) {
|
|
9073
|
+
const values = new Set();
|
|
9074
|
+
for (const row of this.data()) {
|
|
9075
|
+
const value = this.resolveValue(row, column.key);
|
|
9076
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
9077
|
+
values.add(String(value));
|
|
9078
|
+
}
|
|
9079
|
+
}
|
|
9080
|
+
return Array.from(values).sort((a, b) => a.localeCompare(b));
|
|
9081
|
+
}
|
|
8813
9082
|
/** Estado de expansión de una fila en el modo móvil colapsado. */
|
|
8814
9083
|
isRowExpanded(id) {
|
|
8815
9084
|
return this.expandedRows().has(id);
|
|
@@ -8833,6 +9102,15 @@ class SolDataTableComponent {
|
|
|
8833
9102
|
// Al filtrar, el detalle expandido pierde contexto — se colapsa todo.
|
|
8834
9103
|
this.expandedRows.set(new Set());
|
|
8835
9104
|
}
|
|
9105
|
+
/** Cambia el filtro de una columna (0.6.0) desde su input/select nativo. */
|
|
9106
|
+
onColumnFilterChange(key, event) {
|
|
9107
|
+
const value = event.target.value;
|
|
9108
|
+
this.columnFilters.update((current) => ({ ...current, [key]: value }));
|
|
9109
|
+
this.currentPage.set(1);
|
|
9110
|
+
// Mismo criterio que onSearch: al filtrar, el detalle expandido pierde
|
|
9111
|
+
// contexto — se colapsa todo.
|
|
9112
|
+
this.expandedRows.set(new Set());
|
|
9113
|
+
}
|
|
8836
9114
|
onSort(key) {
|
|
8837
9115
|
if (this.sortKey() === key) {
|
|
8838
9116
|
this.sortDirection.update((d) => (d === 'asc' ? 'desc' : 'asc'));
|
|
@@ -8847,7 +9125,7 @@ class SolDataTableComponent {
|
|
|
8847
9125
|
this.currentPage.set(1);
|
|
8848
9126
|
}
|
|
8849
9127
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolDataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8850
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolDataTableComponent, isStandalone: true, selector: "sol-data-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, filterPosition: { classPropertyName: "filterPosition", publicName: "filterPosition", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, showEditAction: { classPropertyName: "showEditAction", publicName: "showEditAction", isSignal: true, isRequired: false, transformFunction: null }, showDeleteAction: { classPropertyName: "showDeleteAction", publicName: "showDeleteAction", isSignal: true, isRequired: false, transformFunction: null }, trackByKey: { classPropertyName: "trackByKey", publicName: "trackByKey", isSignal: true, isRequired: false, transformFunction: null }, actionsLabel: { classPropertyName: "actionsLabel", publicName: "actionsLabel", isSignal: true, isRequired: false, transformFunction: null }, toggleDetailsLabel: { classPropertyName: "toggleDetailsLabel", publicName: "toggleDetailsLabel", isSignal: true, isRequired: false, transformFunction: null }, rowReveal: { classPropertyName: "rowReveal", publicName: "rowReveal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editClicked: "editClicked", deleteClicked: "deleteClicked" }, queries: [{ propertyName: "rowActionsTemplate", first: true, predicate: ["rowActions"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
9128
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolDataTableComponent, isStandalone: true, selector: "sol-data-table", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, searchPlaceholder: { classPropertyName: "searchPlaceholder", publicName: "searchPlaceholder", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, filterPosition: { classPropertyName: "filterPosition", publicName: "filterPosition", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, showEditAction: { classPropertyName: "showEditAction", publicName: "showEditAction", isSignal: true, isRequired: false, transformFunction: null }, showDeleteAction: { classPropertyName: "showDeleteAction", publicName: "showDeleteAction", isSignal: true, isRequired: false, transformFunction: null }, trackByKey: { classPropertyName: "trackByKey", publicName: "trackByKey", isSignal: true, isRequired: false, transformFunction: null }, actionsLabel: { classPropertyName: "actionsLabel", publicName: "actionsLabel", isSignal: true, isRequired: false, transformFunction: null }, actionsPosition: { classPropertyName: "actionsPosition", publicName: "actionsPosition", isSignal: true, isRequired: false, transformFunction: null }, toggleDetailsLabel: { classPropertyName: "toggleDetailsLabel", publicName: "toggleDetailsLabel", isSignal: true, isRequired: false, transformFunction: null }, rowReveal: { classPropertyName: "rowReveal", publicName: "rowReveal", isSignal: true, isRequired: false, transformFunction: null }, collapseWidth: { classPropertyName: "collapseWidth", publicName: "collapseWidth", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { editClicked: "editClicked", deleteClicked: "deleteClicked" }, queries: [{ propertyName: "rowActionsTemplate", first: true, predicate: ["rowActions"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
8851
9129
|
<!-- Slot para filtros personalizados (fuera de la tarjeta) -->
|
|
8852
9130
|
<div
|
|
8853
9131
|
class="sol-data-table__filters"
|
|
@@ -8856,7 +9134,11 @@ class SolDataTableComponent {
|
|
|
8856
9134
|
<ng-content select="[tableFilters]" />
|
|
8857
9135
|
</div>
|
|
8858
9136
|
|
|
8859
|
-
<div
|
|
9137
|
+
<div
|
|
9138
|
+
class="sol-data-table"
|
|
9139
|
+
[attr.aria-busy]="loadingVisible() || null"
|
|
9140
|
+
[attr.data-variant]="effectiveVariant()"
|
|
9141
|
+
>
|
|
8860
9142
|
@if (showToolbar()) {
|
|
8861
9143
|
<div class="sol-data-table__toolbar">
|
|
8862
9144
|
<div class="sol-data-table__toolbar-left">
|
|
@@ -8873,10 +9155,10 @@ class SolDataTableComponent {
|
|
|
8873
9155
|
|
|
8874
9156
|
<!-- Acciones por fila compartidas entre el modo tabla y el modo móvil. -->
|
|
8875
9157
|
<ng-template #rowActionButtons let-row>
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
9158
|
+
<div class="sol-data-table__action-group">
|
|
9159
|
+
@if (rowActionsTemplate(); as tpl) {
|
|
9160
|
+
<ng-container *ngTemplateOutlet="tpl; context: { $implicit: row }" />
|
|
9161
|
+
} @else {
|
|
8880
9162
|
@if (showEditAction()) {
|
|
8881
9163
|
<sol-button variant="ghost" size="sm" (clicked)="editClicked.emit(row)">
|
|
8882
9164
|
<sol-icon name="edit" size="sm" />
|
|
@@ -8887,8 +9169,25 @@ class SolDataTableComponent {
|
|
|
8887
9169
|
<sol-icon name="trash" size="sm" class="text-red-500" />
|
|
8888
9170
|
</sol-button>
|
|
8889
9171
|
}
|
|
8890
|
-
|
|
8891
|
-
|
|
9172
|
+
}
|
|
9173
|
+
</div>
|
|
9174
|
+
</ng-template>
|
|
9175
|
+
|
|
9176
|
+
<!-- Celda(s) de acciones del modo tabla, reutilizadas en ambas
|
|
9177
|
+
posiciones ('start'/'end', ver input actionsPosition) para no
|
|
9178
|
+
duplicar el mismo th/td dos veces en el template. -->
|
|
9179
|
+
<ng-template #actionsHeaderCell>
|
|
9180
|
+
<th class="sol-data-table__th sol-data-table__th--actions">{{ actionsLabel() }}</th>
|
|
9181
|
+
</ng-template>
|
|
9182
|
+
|
|
9183
|
+
<ng-template #actionsFilterCell>
|
|
9184
|
+
<th class="sol-data-table__filter-cell"></th>
|
|
9185
|
+
</ng-template>
|
|
9186
|
+
|
|
9187
|
+
<ng-template #actionsBodyCell let-row>
|
|
9188
|
+
<td class="sol-data-table__td sol-data-table__td--actions">
|
|
9189
|
+
<ng-container *ngTemplateOutlet="rowActionButtons; context: { $implicit: row }" />
|
|
9190
|
+
</td>
|
|
8892
9191
|
</ng-template>
|
|
8893
9192
|
|
|
8894
9193
|
@if (mobileCollapse()) {
|
|
@@ -8991,6 +9290,9 @@ class SolDataTableComponent {
|
|
|
8991
9290
|
<table class="sol-data-table__table">
|
|
8992
9291
|
<thead>
|
|
8993
9292
|
<tr>
|
|
9293
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9294
|
+
<ng-container *ngTemplateOutlet="actionsHeaderCell" />
|
|
9295
|
+
}
|
|
8994
9296
|
@for (col of columns(); track col.key) {
|
|
8995
9297
|
<th
|
|
8996
9298
|
class="sol-data-table__th"
|
|
@@ -9006,10 +9308,51 @@ class SolDataTableComponent {
|
|
|
9006
9308
|
}
|
|
9007
9309
|
</th>
|
|
9008
9310
|
}
|
|
9009
|
-
@if (showActions()) {
|
|
9010
|
-
<
|
|
9311
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9312
|
+
<ng-container *ngTemplateOutlet="actionsHeaderCell" />
|
|
9011
9313
|
}
|
|
9012
9314
|
</tr>
|
|
9315
|
+
@if (hasColumnFilters()) {
|
|
9316
|
+
<!-- Fila de filtros opt-in (ver DataTableColumn.filter): solo
|
|
9317
|
+
dentro de <table>, nunca en el modo colapsado móvil (que
|
|
9318
|
+
ni siquiera renderiza este bloque). Las celdas siguen el
|
|
9319
|
+
mismo actionsPosition que el header para no desalinear
|
|
9320
|
+
columnas. -->
|
|
9321
|
+
<tr class="sol-data-table__filters-row">
|
|
9322
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9323
|
+
<ng-container *ngTemplateOutlet="actionsFilterCell" />
|
|
9324
|
+
}
|
|
9325
|
+
@for (col of columns(); track col.key) {
|
|
9326
|
+
<th class="sol-data-table__filter-cell">
|
|
9327
|
+
@if (col.filter === 'text') {
|
|
9328
|
+
<input
|
|
9329
|
+
type="text"
|
|
9330
|
+
class="sol-data-table__filter-input"
|
|
9331
|
+
placeholder="…"
|
|
9332
|
+
[attr.aria-label]="col.label"
|
|
9333
|
+
[value]="columnFilters()[col.key] ?? ''"
|
|
9334
|
+
(input)="onColumnFilterChange(col.key, $event)"
|
|
9335
|
+
/>
|
|
9336
|
+
} @else if (col.filter === 'select') {
|
|
9337
|
+
<select
|
|
9338
|
+
class="sol-data-table__filter-select"
|
|
9339
|
+
[attr.aria-label]="col.label"
|
|
9340
|
+
[value]="columnFilters()[col.key] ?? ''"
|
|
9341
|
+
(change)="onColumnFilterChange(col.key, $event)"
|
|
9342
|
+
>
|
|
9343
|
+
<option value="">Todas</option>
|
|
9344
|
+
@for (opt of columnFilterOptions(col); track opt) {
|
|
9345
|
+
<option [value]="opt">{{ opt }}</option>
|
|
9346
|
+
}
|
|
9347
|
+
</select>
|
|
9348
|
+
}
|
|
9349
|
+
</th>
|
|
9350
|
+
}
|
|
9351
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9352
|
+
<ng-container *ngTemplateOutlet="actionsFilterCell" />
|
|
9353
|
+
}
|
|
9354
|
+
</tr>
|
|
9355
|
+
}
|
|
9013
9356
|
</thead>
|
|
9014
9357
|
<tbody>
|
|
9015
9358
|
@if (loadingVisible()) {
|
|
@@ -9028,6 +9371,9 @@ class SolDataTableComponent {
|
|
|
9028
9371
|
[solRowRevealIndex]="$index"
|
|
9029
9372
|
[solRowRevealReplay]="revealReplayKey()"
|
|
9030
9373
|
>
|
|
9374
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9375
|
+
<ng-container *ngTemplateOutlet="actionsBodyCell; context: { $implicit: row }" />
|
|
9376
|
+
}
|
|
9031
9377
|
@for (col of columns(); track col.key) {
|
|
9032
9378
|
<td class="sol-data-table__td">
|
|
9033
9379
|
@if (col.cellTemplate) {
|
|
@@ -9037,10 +9383,8 @@ class SolDataTableComponent {
|
|
|
9037
9383
|
}
|
|
9038
9384
|
</td>
|
|
9039
9385
|
}
|
|
9040
|
-
@if (showActions()) {
|
|
9041
|
-
<
|
|
9042
|
-
<ng-container *ngTemplateOutlet="rowActionButtons; context: { $implicit: row }" />
|
|
9043
|
-
</td>
|
|
9386
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9387
|
+
<ng-container *ngTemplateOutlet="actionsBodyCell; context: { $implicit: row }" />
|
|
9044
9388
|
}
|
|
9045
9389
|
</tr>
|
|
9046
9390
|
} @empty {
|
|
@@ -9068,7 +9412,7 @@ class SolDataTableComponent {
|
|
|
9068
9412
|
/>
|
|
9069
9413
|
</div>
|
|
9070
9414
|
}
|
|
9071
|
-
`, isInline: true, styles: [".sol-data-table__filters{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.sol-data-table__filters:empty{display:none}.sol-data-table{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #E2E8F0));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm));overflow:hidden}.sol-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;gap:12px;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__toolbar-left{display:flex;align-items:center;gap:8px}.sol-data-table__toolbar-right{display:flex;align-items:center;gap:8px;min-width:200px;max-width:280px}.sol-data-table__wrapper{overflow-x:auto}.sol-data-table__table{width:100%;border-collapse:collapse}.sol-data-table__th{padding:10px 16px;font-size:var(--sol-font-size-xs, 11px);font-weight:600;color:var(--sol-color-text-muted, #64748B);text-transform:uppercase;letter-spacing:.05em;text-align:left;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 30%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-data-table__th--sortable{cursor:pointer;transition:color .15s}.sol-data-table__th--sortable:hover{color:var(--sol-color-text-primary, #0F172A)}.sol-data-table__th--actions{width:
|
|
9415
|
+
`, isInline: true, styles: [".sol-data-table__filters{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.sol-data-table__filters:empty{display:none}.sol-data-table{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #E2E8F0));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm));overflow:hidden}.sol-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;gap:12px;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__toolbar-left{display:flex;align-items:center;gap:8px}.sol-data-table__toolbar-right{display:flex;align-items:center;gap:8px;min-width:200px;max-width:280px}.sol-data-table__wrapper{overflow-x:auto}.sol-data-table__table{width:100%;border-collapse:collapse}.sol-data-table__th{padding:10px 16px;font-size:var(--sol-font-size-xs, 11px);font-weight:600;color:var(--sol-color-text-muted, #64748B);text-transform:uppercase;letter-spacing:.05em;text-align:left;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 30%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-data-table__th--sortable{cursor:pointer;transition:color .15s}.sol-data-table__th--sortable:hover{color:var(--sol-color-text-primary, #0F172A)}.sol-data-table__th--actions{width:1%;white-space:nowrap;text-align:center}.sol-data-table__filter-cell{padding:6px 16px;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 15%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__filter-input,.sol-data-table__filter-select{width:100%;box-sizing:border-box;height:var(--sol-size-component-sm, 30px);padding:0 8px;font-family:inherit;font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-primary, #0F172A);background:var(--sol-bg-surface, #fff);border:1px solid var(--sol-border-color-default, #E2E8F0);border-radius:var(--sol-border-radius-sm, 6px);outline:none;transition:border-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-data-table__filter-input::placeholder{color:var(--sol-color-text-muted, #94A3B8)}.sol-data-table__filter-input:focus,.sol-data-table__filter-select:focus{border-color:var(--sol-color-primary, #2563EB);box-shadow:var(--sol-focus-ring, 0 0 0 2px color-mix(in srgb, var(--sol-color-primary, #2563EB) 20%, transparent))}.sol-data-table__sort-icon{margin-left:4px;font-size:12px;color:var(--sol-color-primary, #2563EB)}.sol-data-table__tr{border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);transition:background-color .15s}.sol-data-table__tr:last-child .sol-data-table__td{border-bottom:none}.sol-data-table__tr:hover{background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 3%,transparent)}.sol-data-table__td{padding:12px 16px;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-primary, #0F172A);vertical-align:middle}.sol-data-table__td--actions{text-align:center;white-space:nowrap}.sol-data-table__action-group{display:flex;align-items:center;justify-content:center;gap:4px}.sol-data-table__empty{padding:40px 16px;text-align:center;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-muted, #94A3B8)}.sol-data-table__footer{padding:8px 4px 0}.sol-data-table[data-variant]{--sol-table-header-bg: color-mix(in srgb, var(--sol-color-primary, #2563EB) 8%, var(--sol-bg-surface, #FFFFFF));--sol-table-header-strong-bg: color-mix(in srgb, var(--sol-color-primary, #2563EB) 16%, var(--sol-bg-surface, #FFFFFF));--sol-table-zebra: color-mix(in srgb, var(--sol-color-text-primary, #0F172A) 4%, transparent);--sol-table-band: color-mix(in srgb, var(--sol-color-primary, #2563EB) 7%, transparent);--sol-table-cell-border: var(--sol-border-color-default, #E2E8F0);--sol-table-hover: color-mix(in srgb, var(--sol-color-text-primary, #0F172A) 6%, transparent)}.sol-data-table[data-variant] .sol-data-table__th{background:var(--sol-table-header-bg);color:var(--sol-color-text-secondary, #475569);font-size:var(--sol-font-size-sm, 12px);border-bottom:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant] .sol-data-table__tr{border-bottom:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant]:not([data-variant=clean]) .sol-data-table__table>tbody>.sol-data-table__tr:nth-of-type(odd){background:var(--sol-table-zebra)}.sol-data-table[data-variant=banded] .sol-data-table__table>tbody>.sol-data-table__tr:nth-of-type(3n){background:var(--sol-table-band)}.sol-data-table[data-variant][data-variant] .sol-data-table__table>tbody>.sol-data-table__tr:hover{background:var(--sol-table-hover)}.sol-data-table[data-variant=bordered] .sol-data-table__table{border:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant=bordered] .sol-data-table__th,.sol-data-table[data-variant=bordered] .sol-data-table__td,.sol-data-table[data-variant=bordered] .sol-data-table__table .sol-data-table__tr:last-child>.sol-data-table__td{border:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant=emphasis-header] .sol-data-table__th{background:var(--sol-table-header-strong-bg);color:var(--sol-color-primary, #2563EB)}.sol-data-table__cards{list-style:none;margin:0;padding:0}.sol-data-table__card{border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__card:last-child{border-bottom:none}.sol-data-table__card-head{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px;border:none;background:transparent;font:inherit;text-align:left;color:var(--sol-color-text-primary, #0F172A);cursor:pointer;box-sizing:border-box}.sol-data-table__card-chevron{flex-shrink:0;color:var(--sol-color-text-muted, #94A3B8);transition:transform var(--sol-dur-fast, .12s) var(--sol-ease, ease)}.sol-data-table__card-chevron--open{transform:rotate(90deg)}.sol-data-table__card-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.sol-data-table__card-title{font-size:var(--sol-font-size-sm, 13px);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-data-table__card-sub{font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-muted, #64748B);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-data-table__card-chip{flex-shrink:0;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 10px;border-radius:var(--sol-border-radius-full, 9999px);font-size:11px;font-weight:600;color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 12%,transparent)}.sol-data-table__card-details{padding:0 12px 12px 34px;animation:sol-data-table-reveal var(--sol-dur-base, .24s) var(--sol-ease-entrance, ease-out) backwards}@keyframes sol-data-table-reveal{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.sol-data-table__card-kv-list{margin:0;display:flex;flex-direction:column;gap:6px}.sol-data-table__card-kv{display:flex;gap:8px;align-items:baseline;min-width:0}.sol-data-table__card-kv dt{flex-shrink:0;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--sol-color-text-muted, #64748B)}.sol-data-table__card-kv dd{margin:0;min-width:0;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-primary, #0F172A);overflow-wrap:anywhere}.sol-data-table__card-actions{display:flex;justify-content:flex-end;gap:4px;margin-top:10px}@media(max-width:767px){.sol-data-table__toolbar{flex-wrap:wrap}.sol-data-table__toolbar-right{flex:1;min-width:0;max-width:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SolSearchInputComponent, selector: "sol-search-input", inputs: ["placeholder"], outputs: ["searchChange"] }, { kind: "component", type: SolPaginationComponent, selector: "sol-pagination", inputs: ["totalItems", "pageSize", "currentPage", "pageSizeOptions"], outputs: ["pageChanged", "pageSizeChanged"] }, { kind: "component", type: SolButtonComponent, selector: "sol-button", inputs: ["variant", "size", "disabled", "type", "loading"], outputs: ["clicked"] }, { kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }, { kind: "component", type: SolSkeletonComponent, selector: "sol-skeleton", inputs: ["variant", "width", "height", "aspectRatio", "count"] }, { kind: "directive", type: RowRevealDirective, selector: "[solRowReveal]", inputs: ["solRowReveal", "solRowRevealIndex", "solRowRevealReplay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9072
9416
|
}
|
|
9073
9417
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolDataTableComponent, decorators: [{
|
|
9074
9418
|
type: Component,
|
|
@@ -9089,7 +9433,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9089
9433
|
<ng-content select="[tableFilters]" />
|
|
9090
9434
|
</div>
|
|
9091
9435
|
|
|
9092
|
-
<div
|
|
9436
|
+
<div
|
|
9437
|
+
class="sol-data-table"
|
|
9438
|
+
[attr.aria-busy]="loadingVisible() || null"
|
|
9439
|
+
[attr.data-variant]="effectiveVariant()"
|
|
9440
|
+
>
|
|
9093
9441
|
@if (showToolbar()) {
|
|
9094
9442
|
<div class="sol-data-table__toolbar">
|
|
9095
9443
|
<div class="sol-data-table__toolbar-left">
|
|
@@ -9106,10 +9454,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9106
9454
|
|
|
9107
9455
|
<!-- Acciones por fila compartidas entre el modo tabla y el modo móvil. -->
|
|
9108
9456
|
<ng-template #rowActionButtons let-row>
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9457
|
+
<div class="sol-data-table__action-group">
|
|
9458
|
+
@if (rowActionsTemplate(); as tpl) {
|
|
9459
|
+
<ng-container *ngTemplateOutlet="tpl; context: { $implicit: row }" />
|
|
9460
|
+
} @else {
|
|
9113
9461
|
@if (showEditAction()) {
|
|
9114
9462
|
<sol-button variant="ghost" size="sm" (clicked)="editClicked.emit(row)">
|
|
9115
9463
|
<sol-icon name="edit" size="sm" />
|
|
@@ -9120,8 +9468,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9120
9468
|
<sol-icon name="trash" size="sm" class="text-red-500" />
|
|
9121
9469
|
</sol-button>
|
|
9122
9470
|
}
|
|
9123
|
-
|
|
9124
|
-
|
|
9471
|
+
}
|
|
9472
|
+
</div>
|
|
9473
|
+
</ng-template>
|
|
9474
|
+
|
|
9475
|
+
<!-- Celda(s) de acciones del modo tabla, reutilizadas en ambas
|
|
9476
|
+
posiciones ('start'/'end', ver input actionsPosition) para no
|
|
9477
|
+
duplicar el mismo th/td dos veces en el template. -->
|
|
9478
|
+
<ng-template #actionsHeaderCell>
|
|
9479
|
+
<th class="sol-data-table__th sol-data-table__th--actions">{{ actionsLabel() }}</th>
|
|
9480
|
+
</ng-template>
|
|
9481
|
+
|
|
9482
|
+
<ng-template #actionsFilterCell>
|
|
9483
|
+
<th class="sol-data-table__filter-cell"></th>
|
|
9484
|
+
</ng-template>
|
|
9485
|
+
|
|
9486
|
+
<ng-template #actionsBodyCell let-row>
|
|
9487
|
+
<td class="sol-data-table__td sol-data-table__td--actions">
|
|
9488
|
+
<ng-container *ngTemplateOutlet="rowActionButtons; context: { $implicit: row }" />
|
|
9489
|
+
</td>
|
|
9125
9490
|
</ng-template>
|
|
9126
9491
|
|
|
9127
9492
|
@if (mobileCollapse()) {
|
|
@@ -9224,6 +9589,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9224
9589
|
<table class="sol-data-table__table">
|
|
9225
9590
|
<thead>
|
|
9226
9591
|
<tr>
|
|
9592
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9593
|
+
<ng-container *ngTemplateOutlet="actionsHeaderCell" />
|
|
9594
|
+
}
|
|
9227
9595
|
@for (col of columns(); track col.key) {
|
|
9228
9596
|
<th
|
|
9229
9597
|
class="sol-data-table__th"
|
|
@@ -9239,10 +9607,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9239
9607
|
}
|
|
9240
9608
|
</th>
|
|
9241
9609
|
}
|
|
9242
|
-
@if (showActions()) {
|
|
9243
|
-
<
|
|
9610
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9611
|
+
<ng-container *ngTemplateOutlet="actionsHeaderCell" />
|
|
9244
9612
|
}
|
|
9245
9613
|
</tr>
|
|
9614
|
+
@if (hasColumnFilters()) {
|
|
9615
|
+
<!-- Fila de filtros opt-in (ver DataTableColumn.filter): solo
|
|
9616
|
+
dentro de <table>, nunca en el modo colapsado móvil (que
|
|
9617
|
+
ni siquiera renderiza este bloque). Las celdas siguen el
|
|
9618
|
+
mismo actionsPosition que el header para no desalinear
|
|
9619
|
+
columnas. -->
|
|
9620
|
+
<tr class="sol-data-table__filters-row">
|
|
9621
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9622
|
+
<ng-container *ngTemplateOutlet="actionsFilterCell" />
|
|
9623
|
+
}
|
|
9624
|
+
@for (col of columns(); track col.key) {
|
|
9625
|
+
<th class="sol-data-table__filter-cell">
|
|
9626
|
+
@if (col.filter === 'text') {
|
|
9627
|
+
<input
|
|
9628
|
+
type="text"
|
|
9629
|
+
class="sol-data-table__filter-input"
|
|
9630
|
+
placeholder="…"
|
|
9631
|
+
[attr.aria-label]="col.label"
|
|
9632
|
+
[value]="columnFilters()[col.key] ?? ''"
|
|
9633
|
+
(input)="onColumnFilterChange(col.key, $event)"
|
|
9634
|
+
/>
|
|
9635
|
+
} @else if (col.filter === 'select') {
|
|
9636
|
+
<select
|
|
9637
|
+
class="sol-data-table__filter-select"
|
|
9638
|
+
[attr.aria-label]="col.label"
|
|
9639
|
+
[value]="columnFilters()[col.key] ?? ''"
|
|
9640
|
+
(change)="onColumnFilterChange(col.key, $event)"
|
|
9641
|
+
>
|
|
9642
|
+
<option value="">Todas</option>
|
|
9643
|
+
@for (opt of columnFilterOptions(col); track opt) {
|
|
9644
|
+
<option [value]="opt">{{ opt }}</option>
|
|
9645
|
+
}
|
|
9646
|
+
</select>
|
|
9647
|
+
}
|
|
9648
|
+
</th>
|
|
9649
|
+
}
|
|
9650
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9651
|
+
<ng-container *ngTemplateOutlet="actionsFilterCell" />
|
|
9652
|
+
}
|
|
9653
|
+
</tr>
|
|
9654
|
+
}
|
|
9246
9655
|
</thead>
|
|
9247
9656
|
<tbody>
|
|
9248
9657
|
@if (loadingVisible()) {
|
|
@@ -9261,6 +9670,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9261
9670
|
[solRowRevealIndex]="$index"
|
|
9262
9671
|
[solRowRevealReplay]="revealReplayKey()"
|
|
9263
9672
|
>
|
|
9673
|
+
@if (showActions() && actionsPosition() === 'start') {
|
|
9674
|
+
<ng-container *ngTemplateOutlet="actionsBodyCell; context: { $implicit: row }" />
|
|
9675
|
+
}
|
|
9264
9676
|
@for (col of columns(); track col.key) {
|
|
9265
9677
|
<td class="sol-data-table__td">
|
|
9266
9678
|
@if (col.cellTemplate) {
|
|
@@ -9270,10 +9682,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9270
9682
|
}
|
|
9271
9683
|
</td>
|
|
9272
9684
|
}
|
|
9273
|
-
@if (showActions()) {
|
|
9274
|
-
<
|
|
9275
|
-
<ng-container *ngTemplateOutlet="rowActionButtons; context: { $implicit: row }" />
|
|
9276
|
-
</td>
|
|
9685
|
+
@if (showActions() && actionsPosition() === 'end') {
|
|
9686
|
+
<ng-container *ngTemplateOutlet="actionsBodyCell; context: { $implicit: row }" />
|
|
9277
9687
|
}
|
|
9278
9688
|
</tr>
|
|
9279
9689
|
} @empty {
|
|
@@ -9301,8 +9711,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9301
9711
|
/>
|
|
9302
9712
|
</div>
|
|
9303
9713
|
}
|
|
9304
|
-
`, styles: [".sol-data-table__filters{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.sol-data-table__filters:empty{display:none}.sol-data-table{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #E2E8F0));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm));overflow:hidden}.sol-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;gap:12px;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__toolbar-left{display:flex;align-items:center;gap:8px}.sol-data-table__toolbar-right{display:flex;align-items:center;gap:8px;min-width:200px;max-width:280px}.sol-data-table__wrapper{overflow-x:auto}.sol-data-table__table{width:100%;border-collapse:collapse}.sol-data-table__th{padding:10px 16px;font-size:var(--sol-font-size-xs, 11px);font-weight:600;color:var(--sol-color-text-muted, #64748B);text-transform:uppercase;letter-spacing:.05em;text-align:left;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 30%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-data-table__th--sortable{cursor:pointer;transition:color .15s}.sol-data-table__th--sortable:hover{color:var(--sol-color-text-primary, #0F172A)}.sol-data-table__th--actions{width:
|
|
9305
|
-
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], filterPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPosition", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], showEditAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditAction", required: false }] }], showDeleteAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDeleteAction", required: false }] }], trackByKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByKey", required: false }] }], actionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsLabel", required: false }] }], toggleDetailsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleDetailsLabel", required: false }] }], rowReveal: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowReveal", required: false }] }], editClicked: [{ type: i0.Output, args: ["editClicked"] }], deleteClicked: [{ type: i0.Output, args: ["deleteClicked"] }], rowActionsTemplate: [{ type: i0.ContentChild, args: ['rowActions', { isSignal: true }] }] } });
|
|
9714
|
+
`, styles: [".sol-data-table__filters{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.sol-data-table__filters:empty{display:none}.sol-data-table{background:var(--sol-card-bg, var(--sol-bg-surface, #fff));border:var(--sol-card-border, 1px solid var(--sol-border-color-default, #E2E8F0));border-radius:var(--sol-card-radius, var(--sol-border-radius-lg, 12px));box-shadow:var(--sol-card-shadow, var(--sol-shadow-sm));overflow:hidden}.sol-data-table__toolbar{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;gap:12px;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__toolbar-left{display:flex;align-items:center;gap:8px}.sol-data-table__toolbar-right{display:flex;align-items:center;gap:8px;min-width:200px;max-width:280px}.sol-data-table__wrapper{overflow-x:auto}.sol-data-table__table{width:100%;border-collapse:collapse}.sol-data-table__th{padding:10px 16px;font-size:var(--sol-font-size-xs, 11px);font-weight:600;color:var(--sol-color-text-muted, #64748B);text-transform:uppercase;letter-spacing:.05em;text-align:left;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 30%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-data-table__th--sortable{cursor:pointer;transition:color .15s}.sol-data-table__th--sortable:hover{color:var(--sol-color-text-primary, #0F172A)}.sol-data-table__th--actions{width:1%;white-space:nowrap;text-align:center}.sol-data-table__filter-cell{padding:6px 16px;background:color-mix(in srgb,var(--sol-border-color-default, #E2E8F0) 15%,transparent);border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__filter-input,.sol-data-table__filter-select{width:100%;box-sizing:border-box;height:var(--sol-size-component-sm, 30px);padding:0 8px;font-family:inherit;font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-primary, #0F172A);background:var(--sol-bg-surface, #fff);border:1px solid var(--sol-border-color-default, #E2E8F0);border-radius:var(--sol-border-radius-sm, 6px);outline:none;transition:border-color var(--sol-dur-fast, .15s) var(--sol-ease, ease),box-shadow var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-data-table__filter-input::placeholder{color:var(--sol-color-text-muted, #94A3B8)}.sol-data-table__filter-input:focus,.sol-data-table__filter-select:focus{border-color:var(--sol-color-primary, #2563EB);box-shadow:var(--sol-focus-ring, 0 0 0 2px color-mix(in srgb, var(--sol-color-primary, #2563EB) 20%, transparent))}.sol-data-table__sort-icon{margin-left:4px;font-size:12px;color:var(--sol-color-primary, #2563EB)}.sol-data-table__tr{border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);transition:background-color .15s}.sol-data-table__tr:last-child .sol-data-table__td{border-bottom:none}.sol-data-table__tr:hover{background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 3%,transparent)}.sol-data-table__td{padding:12px 16px;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-primary, #0F172A);vertical-align:middle}.sol-data-table__td--actions{text-align:center;white-space:nowrap}.sol-data-table__action-group{display:flex;align-items:center;justify-content:center;gap:4px}.sol-data-table__empty{padding:40px 16px;text-align:center;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-muted, #94A3B8)}.sol-data-table__footer{padding:8px 4px 0}.sol-data-table[data-variant]{--sol-table-header-bg: color-mix(in srgb, var(--sol-color-primary, #2563EB) 8%, var(--sol-bg-surface, #FFFFFF));--sol-table-header-strong-bg: color-mix(in srgb, var(--sol-color-primary, #2563EB) 16%, var(--sol-bg-surface, #FFFFFF));--sol-table-zebra: color-mix(in srgb, var(--sol-color-text-primary, #0F172A) 4%, transparent);--sol-table-band: color-mix(in srgb, var(--sol-color-primary, #2563EB) 7%, transparent);--sol-table-cell-border: var(--sol-border-color-default, #E2E8F0);--sol-table-hover: color-mix(in srgb, var(--sol-color-text-primary, #0F172A) 6%, transparent)}.sol-data-table[data-variant] .sol-data-table__th{background:var(--sol-table-header-bg);color:var(--sol-color-text-secondary, #475569);font-size:var(--sol-font-size-sm, 12px);border-bottom:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant] .sol-data-table__tr{border-bottom:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant]:not([data-variant=clean]) .sol-data-table__table>tbody>.sol-data-table__tr:nth-of-type(odd){background:var(--sol-table-zebra)}.sol-data-table[data-variant=banded] .sol-data-table__table>tbody>.sol-data-table__tr:nth-of-type(3n){background:var(--sol-table-band)}.sol-data-table[data-variant][data-variant] .sol-data-table__table>tbody>.sol-data-table__tr:hover{background:var(--sol-table-hover)}.sol-data-table[data-variant=bordered] .sol-data-table__table{border:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant=bordered] .sol-data-table__th,.sol-data-table[data-variant=bordered] .sol-data-table__td,.sol-data-table[data-variant=bordered] .sol-data-table__table .sol-data-table__tr:last-child>.sol-data-table__td{border:var(--sol-border-width-default, 1px) solid var(--sol-table-cell-border)}.sol-data-table[data-variant=emphasis-header] .sol-data-table__th{background:var(--sol-table-header-strong-bg);color:var(--sol-color-primary, #2563EB)}.sol-data-table__cards{list-style:none;margin:0;padding:0}.sol-data-table__card{border-bottom:1px solid var(--sol-border-color-default, #E2E8F0)}.sol-data-table__card:last-child{border-bottom:none}.sol-data-table__card-head{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px;border:none;background:transparent;font:inherit;text-align:left;color:var(--sol-color-text-primary, #0F172A);cursor:pointer;box-sizing:border-box}.sol-data-table__card-chevron{flex-shrink:0;color:var(--sol-color-text-muted, #94A3B8);transition:transform var(--sol-dur-fast, .12s) var(--sol-ease, ease)}.sol-data-table__card-chevron--open{transform:rotate(90deg)}.sol-data-table__card-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.sol-data-table__card-title{font-size:var(--sol-font-size-sm, 13px);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-data-table__card-sub{font-size:var(--sol-font-size-sm, 12px);color:var(--sol-color-text-muted, #64748B);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-data-table__card-chip{flex-shrink:0;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 10px;border-radius:var(--sol-border-radius-full, 9999px);font-size:11px;font-weight:600;color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 12%,transparent)}.sol-data-table__card-details{padding:0 12px 12px 34px;animation:sol-data-table-reveal var(--sol-dur-base, .24s) var(--sol-ease-entrance, ease-out) backwards}@keyframes sol-data-table-reveal{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.sol-data-table__card-kv-list{margin:0;display:flex;flex-direction:column;gap:6px}.sol-data-table__card-kv{display:flex;gap:8px;align-items:baseline;min-width:0}.sol-data-table__card-kv dt{flex-shrink:0;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--sol-color-text-muted, #64748B)}.sol-data-table__card-kv dd{margin:0;min-width:0;font-size:var(--sol-font-size-sm, 13px);color:var(--sol-color-text-primary, #0F172A);overflow-wrap:anywhere}.sol-data-table__card-actions{display:flex;justify-content:flex-end;gap:4px;margin-top:10px}@media(max-width:767px){.sol-data-table__toolbar{flex-wrap:wrap}.sol-data-table__toolbar-right{flex:1;min-width:0;max-width:none}}\n"] }]
|
|
9715
|
+
}], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], searchPlaceholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchPlaceholder", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], showToolbar: [{ type: i0.Input, args: [{ isSignal: true, alias: "showToolbar", required: false }] }], filterPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterPosition", required: false }] }], showActions: [{ type: i0.Input, args: [{ isSignal: true, alias: "showActions", required: false }] }], showEditAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showEditAction", required: false }] }], showDeleteAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDeleteAction", required: false }] }], trackByKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackByKey", required: false }] }], actionsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsLabel", required: false }] }], actionsPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionsPosition", required: false }] }], toggleDetailsLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggleDetailsLabel", required: false }] }], rowReveal: [{ type: i0.Input, args: [{ isSignal: true, alias: "rowReveal", required: false }] }], collapseWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapseWidth", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], editClicked: [{ type: i0.Output, args: ["editClicked"] }], deleteClicked: [{ type: i0.Output, args: ["deleteClicked"] }], rowActionsTemplate: [{ type: i0.ContentChild, args: ['rowActions', { isSignal: true }] }] } });
|
|
9306
9716
|
/**
|
|
9307
9717
|
* "Estira" una señal de carga a un tiempo mínimo visible (patrón anti-flash).
|
|
9308
9718
|
* Con un backend rápido `loading` pasa a `false` en pocos ms y el skeleton
|
|
@@ -9344,29 +9754,49 @@ function stretchLoading(source, minMs = 450) {
|
|
|
9344
9754
|
destroyRef.onDestroy(clear);
|
|
9345
9755
|
return computed(() => visible());
|
|
9346
9756
|
}
|
|
9347
|
-
/**
|
|
9757
|
+
/** Breakpoint canónico usado SOLO como valor inicial anti-flicker (ver abajo). */
|
|
9348
9758
|
const MOBILE_MEDIA_QUERY$1 = '(max-width: 767px)';
|
|
9349
9759
|
/**
|
|
9350
|
-
* Señal booleana reactiva al
|
|
9351
|
-
*
|
|
9352
|
-
*
|
|
9353
|
-
* (
|
|
9760
|
+
* Señal booleana reactiva al ancho del elemento HOST (0.6.0) — fuente de
|
|
9761
|
+
* verdad del colapso a cards vía `ResizeObserver`. Reemplaza el criterio
|
|
9762
|
+
* anterior (`matchMedia` sobre el VIEWPORT del navegador): true cuando el
|
|
9763
|
+
* ancho medido del host es <= `collapseWidth()`. Así una tabla dentro de un
|
|
9764
|
+
* contenedor angosto (sidebar, grid a dos columnas) colapsa aunque la
|
|
9765
|
+
* ventana siga en ancho desktop.
|
|
9766
|
+
*
|
|
9767
|
+
* `matchMedia` contra el breakpoint canónico 767px se conserva SOLO como
|
|
9768
|
+
* valor inicial (anti-flicker) hasta que llega la primera medición real del
|
|
9769
|
+
* observer — nunca se vuelve a consultar después de eso.
|
|
9770
|
+
*
|
|
9771
|
+
* Debe invocarse en contexto de inyección (inicializador de campo): usa
|
|
9772
|
+
* `DestroyRef` para desconectar el observer al destruir el componente.
|
|
9773
|
+
* Guarda para jsdom/SSR: sin `ResizeObserver` queda fija en el valor
|
|
9774
|
+
* inicial (mismo criterio que el resto de la lib usa para ese entorno).
|
|
9354
9775
|
*/
|
|
9355
|
-
function
|
|
9776
|
+
function observeContainerWidth(host, collapseWidth) {
|
|
9356
9777
|
const destroyRef = inject(DestroyRef);
|
|
9357
|
-
const
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
}
|
|
9362
|
-
const
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9778
|
+
const initial = typeof window !== 'undefined' && typeof window.matchMedia === 'function'
|
|
9779
|
+
? window.matchMedia(MOBILE_MEDIA_QUERY$1).matches
|
|
9780
|
+
: false;
|
|
9781
|
+
const hostWidth = signal(null, /* @ts-ignore */
|
|
9782
|
+
...(ngDevMode ? [{ debugName: "hostWidth" }] : /* istanbul ignore next */ []));
|
|
9783
|
+
const narrow = computed(() => {
|
|
9784
|
+
const width = hostWidth();
|
|
9785
|
+
return width === null ? initial : width <= collapseWidth();
|
|
9786
|
+
}, /* @ts-ignore */
|
|
9787
|
+
...(ngDevMode ? [{ debugName: "narrow" }] : /* istanbul ignore next */ []));
|
|
9788
|
+
if (typeof ResizeObserver === 'undefined') {
|
|
9789
|
+
return narrow;
|
|
9790
|
+
}
|
|
9791
|
+
const observer = new ResizeObserver((entries) => {
|
|
9792
|
+
const entry = entries[0];
|
|
9793
|
+
if (entry) {
|
|
9794
|
+
hostWidth.set(entry.contentRect.width);
|
|
9795
|
+
}
|
|
9796
|
+
});
|
|
9797
|
+
observer.observe(host.nativeElement);
|
|
9798
|
+
destroyRef.onDestroy(() => observer.disconnect());
|
|
9799
|
+
return narrow;
|
|
9370
9800
|
}
|
|
9371
9801
|
|
|
9372
9802
|
const PALETTE_SIZE = 8;
|
|
@@ -9471,7 +9901,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9471
9901
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrl", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
9472
9902
|
|
|
9473
9903
|
/** Escala de calificación: 5 estrellas, como la de Google. */
|
|
9474
|
-
const MAX_STARS = 5;
|
|
9904
|
+
const MAX_STARS$1 = 5;
|
|
9475
9905
|
/**
|
|
9476
9906
|
* `sol-star-rating` — calificación de 1 a 5 en estrellas, de solo lectura.
|
|
9477
9907
|
*
|
|
@@ -9499,16 +9929,16 @@ class SolStarRatingComponent {
|
|
|
9499
9929
|
showValue = input(false, /* @ts-ignore */
|
|
9500
9930
|
...(ngDevMode ? [{ debugName: "showValue" }] : /* istanbul ignore next */ []));
|
|
9501
9931
|
/** Índices para el `@for`: siempre son 5 estrellas. */
|
|
9502
|
-
stars = Array.from({ length: MAX_STARS }, (_, i) => i);
|
|
9932
|
+
stars = Array.from({ length: MAX_STARS$1 }, (_, i) => i);
|
|
9503
9933
|
/** Valor recortado al rango válido: un dato raro no rompe el ancho. */
|
|
9504
9934
|
safeValue = computed(() => {
|
|
9505
9935
|
const raw = this.value();
|
|
9506
9936
|
if (raw === null || !Number.isFinite(raw))
|
|
9507
9937
|
return 0;
|
|
9508
|
-
return Math.min(Math.max(raw, 0), MAX_STARS);
|
|
9938
|
+
return Math.min(Math.max(raw, 0), MAX_STARS$1);
|
|
9509
9939
|
}, /* @ts-ignore */
|
|
9510
9940
|
...(ngDevMode ? [{ debugName: "safeValue" }] : /* istanbul ignore next */ []));
|
|
9511
|
-
filledPercent = computed(() => (this.safeValue() / MAX_STARS) * 100, /* @ts-ignore */
|
|
9941
|
+
filledPercent = computed(() => (this.safeValue() / MAX_STARS$1) * 100, /* @ts-ignore */
|
|
9512
9942
|
...(ngDevMode ? [{ debugName: "filledPercent" }] : /* istanbul ignore next */ []));
|
|
9513
9943
|
/** Un decimal y coma decimal, como se escribe en español. */
|
|
9514
9944
|
formattedValue = computed(() => this.safeValue().toFixed(1).replace('.', ','), /* @ts-ignore */
|
|
@@ -9517,13 +9947,13 @@ class SolStarRatingComponent {
|
|
|
9517
9947
|
const rating = this.formattedValue();
|
|
9518
9948
|
const translated = this.i18n.translate('shared.starRating.label', {
|
|
9519
9949
|
rating,
|
|
9520
|
-
max: MAX_STARS,
|
|
9950
|
+
max: MAX_STARS$1,
|
|
9521
9951
|
});
|
|
9522
9952
|
// El contrato de `SolI18n` devuelve la clave misma cuando falta, así que
|
|
9523
9953
|
// ese caso se detecta y se cae a un texto propio en vez de anunciarle la
|
|
9524
9954
|
// clave cruda a un lector de pantalla.
|
|
9525
9955
|
return translated === 'shared.starRating.label'
|
|
9526
|
-
? `${rating} de ${MAX_STARS}`
|
|
9956
|
+
? `${rating} de ${MAX_STARS$1}`
|
|
9527
9957
|
: translated;
|
|
9528
9958
|
}, /* @ts-ignore */
|
|
9529
9959
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
@@ -9575,6 +10005,453 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9575
10005
|
`, styles: [":host{display:inline-flex}.sol-star-rating{display:inline-flex;align-items:center;gap:var(--sol-space-xs, .25rem)}.sol-star-rating__stars{position:relative;display:inline-flex;flex:none}.sol-star-rating__stars sol-icon{color:var(--sol-color-warning)}.sol-star-rating__empty{opacity:.35}.sol-star-rating__filled{position:absolute;inset-block:0;inset-inline-start:0;display:inline-flex;overflow:hidden;pointer-events:none}.sol-star-rating__value{font-weight:var(--sol-font-weight-bold, 600);color:var(--sol-color-text-primary)}\n"] }]
|
|
9576
10006
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], showValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "showValue", required: false }] }] } });
|
|
9577
10007
|
|
|
10008
|
+
/** Escala de calificación: 5 estrellas, la misma de `sol-star-rating`. */
|
|
10009
|
+
const MAX_STARS = 5;
|
|
10010
|
+
/**
|
|
10011
|
+
* `sol-rating-input` — calificación INTERACTIVA de 1 a 5 estrellas.
|
|
10012
|
+
*
|
|
10013
|
+
* ## Por qué es un componente aparte de `sol-star-rating`
|
|
10014
|
+
*
|
|
10015
|
+
* `sol-star-rating` es de SOLO LECTURA: su contenedor es un `role="img"` con
|
|
10016
|
+
* el valor en el `aria-label` y sus estrellas son `aria-hidden`. Un lector de
|
|
10017
|
+
* pantalla anuncia «4,3 de 5» de un tirón, como quien lee una imagen.
|
|
10018
|
+
*
|
|
10019
|
+
* Este componente es un GRUPO DE OPCIONES: `role="radiogroup"` con cinco
|
|
10020
|
+
* `role="radio"`, `aria-checked` por estrella, navegación por teclado y una
|
|
10021
|
+
* sola parada de tabulación. Son dos contratos de accesibilidad distintos —
|
|
10022
|
+
* mostrar un valor y capturarlo no son el mismo widget. Unirlos detrás de una
|
|
10023
|
+
* bandera `interactive` obligaría a alternar rol, foco, tabindex y semántica
|
|
10024
|
+
* de cada estrella dentro de una misma clase, y ninguno de los dos modos
|
|
10025
|
+
* quedaría bien. Por eso `sol-star-rating` NO se modificó.
|
|
10026
|
+
*
|
|
10027
|
+
* ## Sin valor por defecto (decisión deliberada)
|
|
10028
|
+
*
|
|
10029
|
+
* El principio de «smart defaults» dice que pre-seleccionar lo probable ahorra
|
|
10030
|
+
* decisiones. Este es exactamente el caso donde ese principio NO aplica: su
|
|
10031
|
+
* límite ético es que el default debe servir a quien responde, no a quien
|
|
10032
|
+
* pregunta. Una calificación pre-marcada ancla la respuesta (sesgo de anclaje)
|
|
10033
|
+
* y le sirve al negocio, no a la clienta: si arranca en 5, la respuesta media
|
|
10034
|
+
* sube sin que nadie lo haya decidido, y el dato deja de medir la experiencia.
|
|
10035
|
+
*
|
|
10036
|
+
* Por eso `value` arranca en `null` y las cinco estrellas nacen vacías, con
|
|
10037
|
+
* ninguna `aria-checked="true"` — un radiogroup sin opción marcada es
|
|
10038
|
+
* perfectamente válido en ARIA. `writeValue(null)` vuelve a ese estado.
|
|
10039
|
+
*
|
|
10040
|
+
* ## Teclado (patrón radiogroup de WAI-ARIA)
|
|
10041
|
+
*
|
|
10042
|
+
* - `Tab` entra al grupo una sola vez: cae en la estrella marcada, o en la
|
|
10043
|
+
* primera cuando todavía no hay calificación (roving tabindex).
|
|
10044
|
+
* - `←`/`↑` y `→`/`↓` mueven el foco y marcan la estrella que reciben — es el
|
|
10045
|
+
* comportamiento estándar de un grupo de radios. Los extremos no dan la
|
|
10046
|
+
* vuelta: `←` sobre la primera la marca (así la estrella 1 siempre es
|
|
10047
|
+
* alcanzable sin ratón).
|
|
10048
|
+
* - `Inicio`/`Fin` saltan a la primera/última y la marcan.
|
|
10049
|
+
* - `Espacio` marca la estrella enfocada — útil al entrar al grupo vacío sin
|
|
10050
|
+
* haber movido el foco.
|
|
10051
|
+
* - `Suprimir`/`Retroceso` limpian la selección cuando `allowClear` está
|
|
10052
|
+
* activo.
|
|
10053
|
+
*
|
|
10054
|
+
* ## Estados
|
|
10055
|
+
*
|
|
10056
|
+
* - **normal**: interactivo.
|
|
10057
|
+
* - **`disabled`**: no se puede usar ni enfocar (`aria-disabled` en el grupo).
|
|
10058
|
+
* Lo activa el input homónimo o un `control.disable()` del formulario.
|
|
10059
|
+
* - **`readOnly`**: el valor está congelado pero se lee con contraste pleno y
|
|
10060
|
+
* sigue siendo enfocable (`aria-readonly`). Distinto de `disabled` a
|
|
10061
|
+
* propósito: «esto ya no se cambia» no es lo mismo que «esto no es para ti».
|
|
10062
|
+
* - **`error`**: mensaje visible (mismo contrato de `sol-input`: un texto, no
|
|
10063
|
+
* un booleano), `aria-invalid` y `aria-describedby` sobre el grupo.
|
|
10064
|
+
*
|
|
10065
|
+
* La vista previa al pasar el ratón pinta las estrellas pero NUNCA toca
|
|
10066
|
+
* `value` ni `aria-checked`: al salir el puntero vuelve lo elegido, así que
|
|
10067
|
+
* pasar por encima jamás pierde la respuesta de la clienta.
|
|
10068
|
+
*
|
|
10069
|
+
* Objetivo táctil: cada estrella reserva un área real de 44×44 px (ley de
|
|
10070
|
+
* Fitts) porque se usa desde el celular; por eso el tamaño por defecto es
|
|
10071
|
+
* `lg` y no el `sm` del componente de solo lectura.
|
|
10072
|
+
*
|
|
10073
|
+
* ```html
|
|
10074
|
+
* <sol-rating-input
|
|
10075
|
+
* formControlName="calificacion"
|
|
10076
|
+
* ariaLabelKey="pages.appointment.rateVisit"
|
|
10077
|
+
* [allowClear]="true"
|
|
10078
|
+
* [error]="form.controls.calificacion.touched && form.controls.calificacion.invalid
|
|
10079
|
+
* ? ('pages.appointment.rateRequired' | transloco) : ''"
|
|
10080
|
+
* (ratingChanged)="registrar($event)"
|
|
10081
|
+
* />
|
|
10082
|
+
* ```
|
|
10083
|
+
*/
|
|
10084
|
+
class SolRatingInputComponent {
|
|
10085
|
+
i18n = inject(SOL_I18N);
|
|
10086
|
+
/** Botones de estrella renderizados, en el mismo orden que `stars`. */
|
|
10087
|
+
starRefs = viewChildren('starRef', /* @ts-ignore */
|
|
10088
|
+
...(ngDevMode ? [{ debugName: "starRefs" }] : /* istanbul ignore next */ []));
|
|
10089
|
+
static nextId = 0;
|
|
10090
|
+
/** Id del mensaje de error, referenciado por `aria-describedby` del grupo. */
|
|
10091
|
+
errorId = `sol-rating-input-error-${SolRatingInputComponent.nextId++}`;
|
|
10092
|
+
/** Tamaño de las estrellas. Hereda la escala de `sol-icon`. */
|
|
10093
|
+
size = input('lg', /* @ts-ignore */
|
|
10094
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
10095
|
+
/** Bloquea el control por completo: ni se usa ni se enfoca. */
|
|
10096
|
+
disabled = input(false, /* @ts-ignore */
|
|
10097
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
10098
|
+
/** Congela el valor conservando contraste y foco (`aria-readonly`). */
|
|
10099
|
+
readOnly = input(false, /* @ts-ignore */
|
|
10100
|
+
...(ngDevMode ? [{ debugName: "readOnly" }] : /* istanbul ignore next */ []));
|
|
10101
|
+
/** Mensaje de error visible. Cadena vacía = sin error (contrato de `sol-input`). */
|
|
10102
|
+
error = input('', /* @ts-ignore */
|
|
10103
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
10104
|
+
/** Habilita quitar la calificación ya dada (botón visible + Suprimir/Retroceso). */
|
|
10105
|
+
allowClear = input(false, /* @ts-ignore */
|
|
10106
|
+
...(ngDevMode ? [{ debugName: "allowClear" }] : /* istanbul ignore next */ []));
|
|
10107
|
+
/** Clave i18n del nombre accesible del grupo. */
|
|
10108
|
+
ariaLabelKey = input('shared.ratingInput.groupLabel', /* @ts-ignore */
|
|
10109
|
+
...(ngDevMode ? [{ debugName: "ariaLabelKey" }] : /* istanbul ignore next */ []));
|
|
10110
|
+
/** Clave i18n del nombre accesible de cada estrella (recibe `value` y `max`). */
|
|
10111
|
+
optionLabelKey = input('shared.ratingInput.option', /* @ts-ignore */
|
|
10112
|
+
...(ngDevMode ? [{ debugName: "optionLabelKey" }] : /* istanbul ignore next */ []));
|
|
10113
|
+
/** Clave i18n del botón que quita la calificación. */
|
|
10114
|
+
clearLabelKey = input('shared.ratingInput.clear', /* @ts-ignore */
|
|
10115
|
+
...(ngDevMode ? [{ debugName: "clearLabelKey" }] : /* istanbul ignore next */ []));
|
|
10116
|
+
/** Emite la calificación elegida, o `null` cuando se limpia. */
|
|
10117
|
+
ratingChanged = output();
|
|
10118
|
+
/**
|
|
10119
|
+
* Calificación actual. `null` = sin responder — el estado inicial, a
|
|
10120
|
+
* propósito (ver el JSDoc de la clase).
|
|
10121
|
+
*/
|
|
10122
|
+
value = signal(null, /* @ts-ignore */
|
|
10123
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
10124
|
+
/** Estrella bajo el puntero. Solo pinta: nunca cambia `value`. */
|
|
10125
|
+
previewValue = signal(null, /* @ts-ignore */
|
|
10126
|
+
...(ngDevMode ? [{ debugName: "previewValue" }] : /* istanbul ignore next */ []));
|
|
10127
|
+
/** Última estrella enfocada; manda sobre `value` para el roving tabindex. */
|
|
10128
|
+
focusedIndex = signal(null, /* @ts-ignore */
|
|
10129
|
+
...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
|
|
10130
|
+
/** Valores del `@for`: las 5 estrellas, de 1 a 5. */
|
|
10131
|
+
stars = Array.from({ length: MAX_STARS }, (_, i) => i + 1);
|
|
10132
|
+
/**
|
|
10133
|
+
* Deshabilitado desde el formulario (`control.disable()`), independiente del
|
|
10134
|
+
* input `disabled`.
|
|
10135
|
+
*/
|
|
10136
|
+
formDisabled = signal(false, /* @ts-ignore */
|
|
10137
|
+
...(ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []));
|
|
10138
|
+
/**
|
|
10139
|
+
* Deshabilitado efectivo: el input del consumidor O el estado del formulario.
|
|
10140
|
+
*
|
|
10141
|
+
* Diverge a propósito de los controles más viejos de la librería
|
|
10142
|
+
* (`sol-select`, `sol-number-input`), que dejan `setDisabledState` vacío y
|
|
10143
|
+
* solo miran su input: con `[formControl]`, un `control.disable()` los deja
|
|
10144
|
+
* plenamente usables. Aquí el formulario SÍ manda, que es lo que un
|
|
10145
|
+
* `ControlValueAccessor` promete.
|
|
10146
|
+
*/
|
|
10147
|
+
isDisabled = computed(() => this.disabled() || this.formDisabled(), /* @ts-ignore */
|
|
10148
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
10149
|
+
/** `true` cuando el control admite cambios (ni deshabilitado ni de solo lectura). */
|
|
10150
|
+
interactive = computed(() => !this.isDisabled() && !this.readOnly(), /* @ts-ignore */
|
|
10151
|
+
...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
|
|
10152
|
+
/** El botón de limpiar solo existe si hay algo que limpiar y se puede. */
|
|
10153
|
+
canClear = computed(() => this.allowClear() && this.value() !== null && this.interactive(), /* @ts-ignore */
|
|
10154
|
+
...(ngDevMode ? [{ debugName: "canClear" }] : /* istanbul ignore next */ []));
|
|
10155
|
+
/**
|
|
10156
|
+
* Índice (base 0) de la única estrella que participa del orden de tabulación:
|
|
10157
|
+
* la enfocada por última vez, si no la marcada, y si tampoco hay, la primera.
|
|
10158
|
+
* Nunca depende de la vista previa del ratón.
|
|
10159
|
+
*/
|
|
10160
|
+
rovingIndex = computed(() => {
|
|
10161
|
+
const focused = this.focusedIndex();
|
|
10162
|
+
if (focused !== null)
|
|
10163
|
+
return focused;
|
|
10164
|
+
const current = this.value();
|
|
10165
|
+
return current !== null ? current - 1 : 0;
|
|
10166
|
+
}, /* @ts-ignore */
|
|
10167
|
+
...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
|
|
10168
|
+
groupLabel = computed(() => this.text(this.ariaLabelKey(), 'Calificación de 1 a 5 estrellas'), /* @ts-ignore */
|
|
10169
|
+
...(ngDevMode ? [{ debugName: "groupLabel" }] : /* istanbul ignore next */ []));
|
|
10170
|
+
clearLabel = computed(() => this.text(this.clearLabelKey(), 'Quitar la calificación'), /* @ts-ignore */
|
|
10171
|
+
...(ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []));
|
|
10172
|
+
onChange = () => { };
|
|
10173
|
+
onTouched = () => { };
|
|
10174
|
+
/** `aria-checked` de la estrella: mira SOLO el valor, jamás la vista previa. */
|
|
10175
|
+
isChecked(star) {
|
|
10176
|
+
return this.value() === star;
|
|
10177
|
+
}
|
|
10178
|
+
/** Pintado: la vista previa manda sobre el valor mientras el puntero esté encima. */
|
|
10179
|
+
isFilled(star) {
|
|
10180
|
+
const reference = this.previewValue() ?? this.value();
|
|
10181
|
+
return reference !== null && star <= reference;
|
|
10182
|
+
}
|
|
10183
|
+
tabIndexFor(star) {
|
|
10184
|
+
return star - 1 === this.rovingIndex() ? 0 : -1;
|
|
10185
|
+
}
|
|
10186
|
+
optionLabel(star) {
|
|
10187
|
+
return this.text(this.optionLabelKey(), `${star} de ${MAX_STARS}`, {
|
|
10188
|
+
value: star,
|
|
10189
|
+
max: MAX_STARS,
|
|
10190
|
+
});
|
|
10191
|
+
}
|
|
10192
|
+
onStarFocus(star) {
|
|
10193
|
+
this.focusedIndex.set(star - 1);
|
|
10194
|
+
}
|
|
10195
|
+
preview(star) {
|
|
10196
|
+
if (!this.interactive())
|
|
10197
|
+
return;
|
|
10198
|
+
this.previewValue.set(star);
|
|
10199
|
+
}
|
|
10200
|
+
clearPreview() {
|
|
10201
|
+
this.previewValue.set(null);
|
|
10202
|
+
}
|
|
10203
|
+
markTouched() {
|
|
10204
|
+
this.onTouched();
|
|
10205
|
+
}
|
|
10206
|
+
/**
|
|
10207
|
+
* Marca una estrella. Reemite solo si el valor cambió de verdad.
|
|
10208
|
+
*
|
|
10209
|
+
* Normaliza la entrada (`1..5`) antes de tocar nada: la plantilla nunca
|
|
10210
|
+
* manda un valor fuera de escala, pero este método es público y un consumidor
|
|
10211
|
+
* podría llamarlo con cualquier número — una calificación de 9 rompería el
|
|
10212
|
+
* `aria-checked` de las cinco estrellas.
|
|
10213
|
+
*/
|
|
10214
|
+
select(star) {
|
|
10215
|
+
if (!this.interactive())
|
|
10216
|
+
return;
|
|
10217
|
+
const next = normalizeRating(star);
|
|
10218
|
+
if (next === null)
|
|
10219
|
+
return;
|
|
10220
|
+
this.focusedIndex.set(next - 1);
|
|
10221
|
+
if (this.value() === next)
|
|
10222
|
+
return;
|
|
10223
|
+
this.value.set(next);
|
|
10224
|
+
this.onChange(next);
|
|
10225
|
+
this.ratingChanged.emit(next);
|
|
10226
|
+
this.onTouched();
|
|
10227
|
+
}
|
|
10228
|
+
/** Vuelve al estado «sin responder». Requiere `allowClear`. */
|
|
10229
|
+
clear() {
|
|
10230
|
+
if (!this.interactive() || !this.allowClear())
|
|
10231
|
+
return;
|
|
10232
|
+
if (this.value() === null)
|
|
10233
|
+
return;
|
|
10234
|
+
this.value.set(null);
|
|
10235
|
+
this.previewValue.set(null);
|
|
10236
|
+
this.onChange(null);
|
|
10237
|
+
this.ratingChanged.emit(null);
|
|
10238
|
+
this.onTouched();
|
|
10239
|
+
}
|
|
10240
|
+
onKeydown(event) {
|
|
10241
|
+
if (!this.interactive())
|
|
10242
|
+
return;
|
|
10243
|
+
if (event.key === 'Delete' || event.key === 'Backspace') {
|
|
10244
|
+
if (!this.allowClear() || this.value() === null)
|
|
10245
|
+
return;
|
|
10246
|
+
event.preventDefault();
|
|
10247
|
+
this.clear();
|
|
10248
|
+
return;
|
|
10249
|
+
}
|
|
10250
|
+
if (event.key === ' ' || event.key === 'Spacebar') {
|
|
10251
|
+
event.preventDefault();
|
|
10252
|
+
this.select(this.rovingIndex() + 1);
|
|
10253
|
+
return;
|
|
10254
|
+
}
|
|
10255
|
+
const forward = event.key === 'ArrowRight' || event.key === 'ArrowDown';
|
|
10256
|
+
const backward = event.key === 'ArrowLeft' || event.key === 'ArrowUp';
|
|
10257
|
+
const home = event.key === 'Home';
|
|
10258
|
+
const end = event.key === 'End';
|
|
10259
|
+
if (!forward && !backward && !home && !end)
|
|
10260
|
+
return;
|
|
10261
|
+
event.preventDefault();
|
|
10262
|
+
const current = this.rovingIndex();
|
|
10263
|
+
let next;
|
|
10264
|
+
if (home)
|
|
10265
|
+
next = 0;
|
|
10266
|
+
else if (end)
|
|
10267
|
+
next = MAX_STARS - 1;
|
|
10268
|
+
// Sin vuelta en los extremos: `←` sobre la primera la deja ahí y la marca,
|
|
10269
|
+
// que es la única forma de elegir "1" con teclado desde el grupo vacío.
|
|
10270
|
+
else if (forward)
|
|
10271
|
+
next = Math.min(current + 1, MAX_STARS - 1);
|
|
10272
|
+
else
|
|
10273
|
+
next = Math.max(current - 1, 0);
|
|
10274
|
+
this.select(next + 1);
|
|
10275
|
+
this.focusStar(next);
|
|
10276
|
+
}
|
|
10277
|
+
/**
|
|
10278
|
+
* Mueve el foco a la estrella `index` (base 0) por referencia de plantilla,
|
|
10279
|
+
* sin depender de selectores CSS internos — mismo criterio que `sol-chip-group`.
|
|
10280
|
+
*/
|
|
10281
|
+
focusStar(index) {
|
|
10282
|
+
this.starRefs()[index]?.nativeElement.focus();
|
|
10283
|
+
}
|
|
10284
|
+
/**
|
|
10285
|
+
* Resuelve un texto por i18n con respaldo es-CO propio.
|
|
10286
|
+
*
|
|
10287
|
+
* El contrato `SolI18n` devuelve la CLAVE cuando falta la traducción, así que
|
|
10288
|
+
* ese caso se detecta y se cae al texto de la casa en vez de anunciarle la
|
|
10289
|
+
* clave cruda a un lector de pantalla — mismo criterio de `sol-star-rating`.
|
|
10290
|
+
*/
|
|
10291
|
+
text(key, fallback, params) {
|
|
10292
|
+
this.i18n.activeLang();
|
|
10293
|
+
const translated = this.i18n.translate(key, params);
|
|
10294
|
+
return translated && translated !== key ? translated : fallback;
|
|
10295
|
+
}
|
|
10296
|
+
// ── ControlValueAccessor ──
|
|
10297
|
+
/**
|
|
10298
|
+
* Normaliza lo que llegue del formulario a `1..5` o `null`. Un `0`, un `NaN`
|
|
10299
|
+
* o un `undefined` significan «sin responder», no «cero estrellas»: la escala
|
|
10300
|
+
* empieza en 1 y el vacío tiene que seguir siendo distinguible.
|
|
10301
|
+
*/
|
|
10302
|
+
writeValue(value) {
|
|
10303
|
+
this.value.set(normalizeRating(value));
|
|
10304
|
+
this.previewValue.set(null);
|
|
10305
|
+
this.focusedIndex.set(null);
|
|
10306
|
+
}
|
|
10307
|
+
registerOnChange(fn) {
|
|
10308
|
+
this.onChange = fn;
|
|
10309
|
+
}
|
|
10310
|
+
registerOnTouched(fn) {
|
|
10311
|
+
this.onTouched = fn;
|
|
10312
|
+
}
|
|
10313
|
+
setDisabledState(isDisabled) {
|
|
10314
|
+
this.formDisabled.set(isDisabled);
|
|
10315
|
+
}
|
|
10316
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolRatingInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10317
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolRatingInputComponent, isStandalone: true, selector: "sol-rating-input", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readOnly: { classPropertyName: "readOnly", publicName: "readOnly", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, allowClear: { classPropertyName: "allowClear", publicName: "allowClear", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelKey: { classPropertyName: "ariaLabelKey", publicName: "ariaLabelKey", isSignal: true, isRequired: false, transformFunction: null }, optionLabelKey: { classPropertyName: "optionLabelKey", publicName: "optionLabelKey", isSignal: true, isRequired: false, transformFunction: null }, clearLabelKey: { classPropertyName: "clearLabelKey", publicName: "clearLabelKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { ratingChanged: "ratingChanged" }, providers: [
|
|
10318
|
+
{
|
|
10319
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10320
|
+
useExisting: forwardRef(() => SolRatingInputComponent),
|
|
10321
|
+
multi: true,
|
|
10322
|
+
},
|
|
10323
|
+
], viewQueries: [{ propertyName: "starRefs", predicate: ["starRef"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
10324
|
+
<div class="sol-rating-input" [class.sol-rating-input--error]="!!error()">
|
|
10325
|
+
<div class="sol-rating-input__row">
|
|
10326
|
+
<div
|
|
10327
|
+
class="sol-rating-input__group"
|
|
10328
|
+
role="radiogroup"
|
|
10329
|
+
[attr.aria-label]="groupLabel()"
|
|
10330
|
+
[attr.aria-disabled]="isDisabled() ? 'true' : null"
|
|
10331
|
+
[attr.aria-readonly]="readOnly() ? 'true' : null"
|
|
10332
|
+
[attr.aria-invalid]="error() ? 'true' : null"
|
|
10333
|
+
[attr.aria-describedby]="error() ? errorId : null"
|
|
10334
|
+
(keydown)="onKeydown($event)"
|
|
10335
|
+
(focusout)="markTouched()"
|
|
10336
|
+
(mouseleave)="clearPreview()"
|
|
10337
|
+
>
|
|
10338
|
+
@for (star of stars; track star) {
|
|
10339
|
+
<button
|
|
10340
|
+
#starRef
|
|
10341
|
+
type="button"
|
|
10342
|
+
class="sol-rating-input__star"
|
|
10343
|
+
[class.sol-rating-input__star--on]="isFilled(star)"
|
|
10344
|
+
role="radio"
|
|
10345
|
+
[attr.aria-checked]="isChecked(star)"
|
|
10346
|
+
[attr.aria-label]="optionLabel(star)"
|
|
10347
|
+
[attr.tabindex]="tabIndexFor(star)"
|
|
10348
|
+
[disabled]="isDisabled()"
|
|
10349
|
+
(click)="select(star)"
|
|
10350
|
+
(focus)="onStarFocus(star)"
|
|
10351
|
+
(mouseenter)="preview(star)"
|
|
10352
|
+
>
|
|
10353
|
+
<sol-icon
|
|
10354
|
+
name="star"
|
|
10355
|
+
[variant]="isFilled(star) ? 'fill' : 'outline'"
|
|
10356
|
+
[size]="size()"
|
|
10357
|
+
/>
|
|
10358
|
+
</button>
|
|
10359
|
+
}
|
|
10360
|
+
</div>
|
|
10361
|
+
|
|
10362
|
+
@if (canClear()) {
|
|
10363
|
+
<button
|
|
10364
|
+
type="button"
|
|
10365
|
+
class="sol-rating-input__clear"
|
|
10366
|
+
[attr.aria-label]="clearLabel()"
|
|
10367
|
+
(click)="clear()"
|
|
10368
|
+
>
|
|
10369
|
+
<sol-icon name="x-mark" size="sm" />
|
|
10370
|
+
</button>
|
|
10371
|
+
}
|
|
10372
|
+
</div>
|
|
10373
|
+
|
|
10374
|
+
@if (error()) {
|
|
10375
|
+
<span class="sol-rating-input__error" [id]="errorId" role="alert">{{ error() }}</span>
|
|
10376
|
+
}
|
|
10377
|
+
</div>
|
|
10378
|
+
`, isInline: true, styles: [":host{display:inline-block;--sol-rating-input-on: var(--sol-color-warning);--sol-rating-input-off: var(--sol-color-text-muted, #94a3b8);--sol-rating-input-danger: var(--sol-color-danger, #ef4444);--sol-rating-input-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-rating-input-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-rating-input-focus-ring: var(--sol-color-primary, #6366f1);--sol-rating-input-hit: 44px}.sol-rating-input{display:flex;flex-direction:column;gap:var(--sol-space-xs, .25rem)}.sol-rating-input__row{display:flex;align-items:center;gap:var(--sol-space-xs, .25rem)}.sol-rating-input__group{display:inline-flex;align-items:center}.sol-rating-input__star{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-rating-input-hit);min-height:var(--sol-rating-input-hit);padding:0;border:none;background:transparent;color:var(--sol-rating-input-off);cursor:pointer;border-radius:var(--sol-border-radius-sm, .25rem);transition:color var(--sol-rating-input-transition),transform var(--sol-rating-input-transition);-webkit-tap-highlight-color:transparent}.sol-rating-input__star--on{color:var(--sol-rating-input-on)}.sol-rating-input__star:focus-visible{outline:2px solid var(--sol-rating-input-focus-ring);outline-offset:-2px}.sol-rating-input__star:disabled{cursor:not-allowed}.sol-rating-input__group:not([aria-disabled]):not([aria-readonly]) .sol-rating-input__star:hover{transform:scale(1.08)}.sol-rating-input__group[aria-disabled]{opacity:var(--sol-rating-input-disabled-opacity)}.sol-rating-input__group[aria-readonly] .sol-rating-input__star{cursor:default}.sol-rating-input--error .sol-rating-input__star:not(.sol-rating-input__star--on){color:var(--sol-rating-input-danger)}.sol-rating-input__clear{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-rating-input-hit);min-height:var(--sol-rating-input-hit);padding:0;border:none;background:transparent;color:var(--sol-color-text-secondary, #475569);cursor:pointer;border-radius:var(--sol-border-radius-sm, .25rem);transition:color var(--sol-rating-input-transition)}.sol-rating-input__clear:hover{color:var(--sol-color-text-primary, #1e293b)}.sol-rating-input__clear:focus-visible{outline:2px solid var(--sol-rating-input-focus-ring);outline-offset:-2px}.sol-rating-input__error{font-size:var(--sol-font-size-sm, .75rem);color:var(--sol-rating-input-danger);line-height:1.3}@media(prefers-reduced-motion:reduce){.sol-rating-input__star,.sol-rating-input__clear{transition:none}.sol-rating-input__group:not([aria-disabled]):not([aria-readonly]) .sol-rating-input__star:hover{transform:none}}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10379
|
+
}
|
|
10380
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolRatingInputComponent, decorators: [{
|
|
10381
|
+
type: Component,
|
|
10382
|
+
args: [{ selector: 'sol-rating-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent], providers: [
|
|
10383
|
+
{
|
|
10384
|
+
provide: NG_VALUE_ACCESSOR,
|
|
10385
|
+
useExisting: forwardRef(() => SolRatingInputComponent),
|
|
10386
|
+
multi: true,
|
|
10387
|
+
},
|
|
10388
|
+
], template: `
|
|
10389
|
+
<div class="sol-rating-input" [class.sol-rating-input--error]="!!error()">
|
|
10390
|
+
<div class="sol-rating-input__row">
|
|
10391
|
+
<div
|
|
10392
|
+
class="sol-rating-input__group"
|
|
10393
|
+
role="radiogroup"
|
|
10394
|
+
[attr.aria-label]="groupLabel()"
|
|
10395
|
+
[attr.aria-disabled]="isDisabled() ? 'true' : null"
|
|
10396
|
+
[attr.aria-readonly]="readOnly() ? 'true' : null"
|
|
10397
|
+
[attr.aria-invalid]="error() ? 'true' : null"
|
|
10398
|
+
[attr.aria-describedby]="error() ? errorId : null"
|
|
10399
|
+
(keydown)="onKeydown($event)"
|
|
10400
|
+
(focusout)="markTouched()"
|
|
10401
|
+
(mouseleave)="clearPreview()"
|
|
10402
|
+
>
|
|
10403
|
+
@for (star of stars; track star) {
|
|
10404
|
+
<button
|
|
10405
|
+
#starRef
|
|
10406
|
+
type="button"
|
|
10407
|
+
class="sol-rating-input__star"
|
|
10408
|
+
[class.sol-rating-input__star--on]="isFilled(star)"
|
|
10409
|
+
role="radio"
|
|
10410
|
+
[attr.aria-checked]="isChecked(star)"
|
|
10411
|
+
[attr.aria-label]="optionLabel(star)"
|
|
10412
|
+
[attr.tabindex]="tabIndexFor(star)"
|
|
10413
|
+
[disabled]="isDisabled()"
|
|
10414
|
+
(click)="select(star)"
|
|
10415
|
+
(focus)="onStarFocus(star)"
|
|
10416
|
+
(mouseenter)="preview(star)"
|
|
10417
|
+
>
|
|
10418
|
+
<sol-icon
|
|
10419
|
+
name="star"
|
|
10420
|
+
[variant]="isFilled(star) ? 'fill' : 'outline'"
|
|
10421
|
+
[size]="size()"
|
|
10422
|
+
/>
|
|
10423
|
+
</button>
|
|
10424
|
+
}
|
|
10425
|
+
</div>
|
|
10426
|
+
|
|
10427
|
+
@if (canClear()) {
|
|
10428
|
+
<button
|
|
10429
|
+
type="button"
|
|
10430
|
+
class="sol-rating-input__clear"
|
|
10431
|
+
[attr.aria-label]="clearLabel()"
|
|
10432
|
+
(click)="clear()"
|
|
10433
|
+
>
|
|
10434
|
+
<sol-icon name="x-mark" size="sm" />
|
|
10435
|
+
</button>
|
|
10436
|
+
}
|
|
10437
|
+
</div>
|
|
10438
|
+
|
|
10439
|
+
@if (error()) {
|
|
10440
|
+
<span class="sol-rating-input__error" [id]="errorId" role="alert">{{ error() }}</span>
|
|
10441
|
+
}
|
|
10442
|
+
</div>
|
|
10443
|
+
`, styles: [":host{display:inline-block;--sol-rating-input-on: var(--sol-color-warning);--sol-rating-input-off: var(--sol-color-text-muted, #94a3b8);--sol-rating-input-danger: var(--sol-color-danger, #ef4444);--sol-rating-input-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-rating-input-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-rating-input-focus-ring: var(--sol-color-primary, #6366f1);--sol-rating-input-hit: 44px}.sol-rating-input{display:flex;flex-direction:column;gap:var(--sol-space-xs, .25rem)}.sol-rating-input__row{display:flex;align-items:center;gap:var(--sol-space-xs, .25rem)}.sol-rating-input__group{display:inline-flex;align-items:center}.sol-rating-input__star{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-rating-input-hit);min-height:var(--sol-rating-input-hit);padding:0;border:none;background:transparent;color:var(--sol-rating-input-off);cursor:pointer;border-radius:var(--sol-border-radius-sm, .25rem);transition:color var(--sol-rating-input-transition),transform var(--sol-rating-input-transition);-webkit-tap-highlight-color:transparent}.sol-rating-input__star--on{color:var(--sol-rating-input-on)}.sol-rating-input__star:focus-visible{outline:2px solid var(--sol-rating-input-focus-ring);outline-offset:-2px}.sol-rating-input__star:disabled{cursor:not-allowed}.sol-rating-input__group:not([aria-disabled]):not([aria-readonly]) .sol-rating-input__star:hover{transform:scale(1.08)}.sol-rating-input__group[aria-disabled]{opacity:var(--sol-rating-input-disabled-opacity)}.sol-rating-input__group[aria-readonly] .sol-rating-input__star{cursor:default}.sol-rating-input--error .sol-rating-input__star:not(.sol-rating-input__star--on){color:var(--sol-rating-input-danger)}.sol-rating-input__clear{display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-rating-input-hit);min-height:var(--sol-rating-input-hit);padding:0;border:none;background:transparent;color:var(--sol-color-text-secondary, #475569);cursor:pointer;border-radius:var(--sol-border-radius-sm, .25rem);transition:color var(--sol-rating-input-transition)}.sol-rating-input__clear:hover{color:var(--sol-color-text-primary, #1e293b)}.sol-rating-input__clear:focus-visible{outline:2px solid var(--sol-rating-input-focus-ring);outline-offset:-2px}.sol-rating-input__error{font-size:var(--sol-font-size-sm, .75rem);color:var(--sol-rating-input-danger);line-height:1.3}@media(prefers-reduced-motion:reduce){.sol-rating-input__star,.sol-rating-input__clear{transition:none}.sol-rating-input__group:not([aria-disabled]):not([aria-readonly]) .sol-rating-input__star:hover{transform:none}}\n"] }]
|
|
10444
|
+
}], propDecorators: { starRefs: [{ type: i0.ViewChildren, args: ['starRef', { isSignal: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readOnly", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], allowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowClear", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: false }] }], optionLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabelKey", required: false }] }], clearLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearLabelKey", required: false }] }], ratingChanged: [{ type: i0.Output, args: ["ratingChanged"] }] } });
|
|
10445
|
+
/** Recorta cualquier entrada a una calificación válida (`1..5`) o a `null`. */
|
|
10446
|
+
function normalizeRating(raw) {
|
|
10447
|
+
if (raw === null || raw === undefined || !Number.isFinite(raw))
|
|
10448
|
+
return null;
|
|
10449
|
+
const rounded = Math.round(raw);
|
|
10450
|
+
if (rounded < 1)
|
|
10451
|
+
return null;
|
|
10452
|
+
return Math.min(rounded, MAX_STARS);
|
|
10453
|
+
}
|
|
10454
|
+
|
|
9578
10455
|
/** Color CSS (`var(--sol-color-*)` con fallback) por tono — fuente única para toda la lib. */
|
|
9579
10456
|
const TONE_COLOR = {
|
|
9580
10457
|
success: 'var(--sol-color-success, #10b981)',
|
|
@@ -15894,6 +16771,282 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
15894
16771
|
args: ['document:click', ['$event']]
|
|
15895
16772
|
}] } });
|
|
15896
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
|
+
|
|
15897
17050
|
// Shared UI — atomic design system components
|
|
15898
17051
|
|
|
15899
17052
|
/*
|
|
@@ -15904,5 +17057,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
15904
17057
|
* Generated bundle index. Do not edit.
|
|
15905
17058
|
*/
|
|
15906
17059
|
|
|
15907
|
-
export { DEFAULT_SCORE_THRESHOLDS, EMIT_TABLE, KANBAN_ADD_ACTION, KanbanReorderService, NEUTRAL_CALENDAR_COLOR, SOL_CALENDAR_COLOR, SOL_CHART_ENGINE, SOL_DEFAULT_THEME, SOL_I18N, 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, 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, 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 };
|
|
15908
17061
|
//# sourceMappingURL=solercia-ui.mjs.map
|