@solercia/ui 0.3.0 → 0.4.0
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 +52 -0
- package/fesm2022/solercia-ui.mjs +2007 -116
- package/fesm2022/solercia-ui.mjs.map +1 -1
- package/package.json +3 -2
- package/types/solercia-ui.d.ts +642 -26
package/fesm2022/solercia-ui.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, computed, ChangeDetectionStrategy, Component, signal, forwardRef, inject,
|
|
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';
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
5
|
import { NgTemplateOutlet } from '@angular/common';
|
|
@@ -64,7 +64,7 @@ class SolButtonComponent {
|
|
|
64
64
|
}
|
|
65
65
|
<ng-content />
|
|
66
66
|
</button>
|
|
67
|
-
`, isInline: true, styles: [":host{display:inline-block;--sol-btn-primary-bg: var(--sol-color-primary, #6366f1);--sol-btn-primary-text: var(--sol-color-primary-contrast, #ffffff);--sol-btn-secondary-bg: var(--sol-color-secondary, #e2e8f0);--sol-btn-secondary-text: var(--sol-color-secondary-contrast, #1e293b);--sol-btn-danger-bg: var(--sol-color-danger, #ef4444);--sol-btn-danger-text: var(--sol-color-danger-contrast, #ffffff);--sol-btn-ghost-bg: transparent;--sol-btn-ghost-text: var(--sol-color-primary, #6366f1);--sol-btn-font-sm: var(--sol-font-size-sm, .75rem);--sol-btn-font-md: var(--sol-font-size-md, .875rem);--sol-btn-font-lg: var(--sol-font-size-lg, 1rem);--sol-btn-padding-sm: var(--sol-spacing-xs, .25rem) var(--sol-spacing-sm, .5rem);--sol-btn-padding-md: var(--sol-spacing-sm, .5rem) var(--sol-spacing-md, 1rem);--sol-btn-padding-lg: var(--sol-spacing-md, .75rem) var(--sol-spacing-lg, 1.5rem);--sol-btn-radius: var(--sol-button-radius, var(--sol-border-radius-md, .5rem));--sol-btn-font-weight: var(--sol-button-weight, 500);--sol-btn-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-btn-focus-ring: var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-btn-disabled-opacity: var(--sol-disabled-opacity, .55)}.sol-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5em;border:none;border-radius:var(--sol-btn-radius);box-shadow:var(--sol-button-shadow, none);font-family:inherit;font-weight:var(--sol-btn-font-weight);text-transform:var(--sol-button-transform, none);line-height:1;cursor:pointer;transition:background-color var(--sol-btn-transition),box-shadow var(--sol-btn-transition),transform var(--sol-btn-transition),filter var(--sol-btn-transition),opacity var(--sol-btn-transition);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .98))}.sol-btn:focus-visible{outline:none;box-shadow:var(--sol-btn-focus-ring)}.sol-btn:disabled{cursor:not-allowed;opacity:var(--sol-btn-disabled-opacity)}.sol-btn--primary{background-color:var(--sol-btn-primary-bg);color:var(--sol-btn-primary-text)}.sol-btn--primary:hover:not(:disabled){filter:brightness(1.1)}.sol-btn--primary:active:not(:disabled){filter:brightness(.95)}.sol-btn--secondary{background-color:var(--sol-btn-secondary-bg);color:var(--sol-btn-secondary-text)}.sol-btn--secondary:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 80%,black)}.sol-btn--secondary:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 70%,black)}.sol-btn--danger{background-color:var(--sol-btn-danger-bg);color:var(--sol-btn-danger-text)}.sol-btn--danger:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 85%,black)}.sol-btn--danger:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 75%,black)}.sol-btn--ghost{background-color:var(--sol-btn-ghost-bg);color:var(--sol-btn-ghost-text)}.sol-btn--ghost:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 10%,transparent)}.sol-btn--ghost:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 18%,transparent)}.sol-btn--sm{font-size:var(--sol-font-size-sm, 12px);height:32px;padding:0 12px}.sol-btn--md{font-size:var(--sol-font-size-base, 14px);height:36px;padding:0 16px}.sol-btn--lg{font-size:var(--sol-font-size-base, 14px);height:40px;padding:0 20px}.sol-btn__spinner{width:1em;height:1em;flex-shrink:0;animation:sol-spin .75s linear infinite}@keyframes sol-spin{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
67
|
+
`, isInline: true, styles: [":host{display:inline-block;--sol-btn-primary-bg: var(--sol-color-primary, #6366f1);--sol-btn-primary-text: var(--sol-color-primary-contrast, #ffffff);--sol-btn-secondary-bg: var(--sol-color-secondary, #e2e8f0);--sol-btn-secondary-text: var(--sol-color-secondary-contrast, #1e293b);--sol-btn-danger-bg: var(--sol-color-danger, #ef4444);--sol-btn-danger-text: var(--sol-color-danger-contrast, #ffffff);--sol-btn-ghost-bg: transparent;--sol-btn-ghost-text: var(--sol-color-primary, #6366f1);--sol-btn-font-sm: var(--sol-font-size-sm, .75rem);--sol-btn-font-md: var(--sol-font-size-md, .875rem);--sol-btn-font-lg: var(--sol-font-size-lg, 1rem);--sol-btn-padding-sm: var(--sol-spacing-xs, .25rem) var(--sol-spacing-sm, .5rem);--sol-btn-padding-md: var(--sol-spacing-sm, .5rem) var(--sol-spacing-md, 1rem);--sol-btn-padding-lg: var(--sol-spacing-md, .75rem) var(--sol-spacing-lg, 1.5rem);--sol-btn-radius: var(--sol-button-radius, var(--sol-border-radius-md, .5rem));--sol-btn-font-weight: var(--sol-button-weight, 500);--sol-btn-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-btn-focus-ring: var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-btn-disabled-opacity: var(--sol-disabled-opacity, .55)}.sol-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5em;border:none;border-radius:var(--sol-btn-radius);box-shadow:var(--sol-button-shadow, none);font-family:inherit;font-weight:var(--sol-btn-font-weight);text-transform:var(--sol-button-transform, none);line-height:1;cursor:pointer;transition:background-color var(--sol-btn-transition),box-shadow var(--sol-btn-transition),transform var(--sol-btn-transition),filter var(--sol-btn-transition),opacity var(--sol-btn-transition);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .98))}.sol-btn:focus-visible{outline:none;box-shadow:var(--sol-btn-focus-ring)}.sol-btn:disabled{cursor:not-allowed;opacity:var(--sol-btn-disabled-opacity)}.sol-btn--primary{background-color:var(--sol-btn-primary-bg);color:var(--sol-btn-primary-text)}.sol-btn--primary:hover:not(:disabled){filter:brightness(1.1)}.sol-btn--primary:active:not(:disabled){filter:brightness(.95)}.sol-btn--secondary{background-color:var(--sol-btn-secondary-bg);color:var(--sol-btn-secondary-text)}.sol-btn--secondary:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 80%,black)}.sol-btn--secondary:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 70%,black)}.sol-btn--danger{background-color:var(--sol-btn-danger-bg);color:var(--sol-btn-danger-text)}.sol-btn--danger:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 85%,black)}.sol-btn--danger:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 75%,black)}.sol-btn--ghost{background-color:var(--sol-btn-ghost-bg);color:var(--sol-btn-ghost-text)}.sol-btn--ghost:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 10%,transparent)}.sol-btn--ghost:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 18%,transparent)}.sol-btn--sm{font-size:var(--sol-font-size-sm, 12px);height:32px;padding:0 12px}.sol-btn--md{font-size:var(--sol-font-size-base, 14px);height:36px;padding:0 16px}.sol-btn--lg{font-size:var(--sol-font-size-base, 14px);height:40px;padding:0 20px}.sol-btn--touch{font-size:var(--sol-font-size-base, 14px);height:44px;padding:0 20px}.sol-btn__spinner{width:1em;height:1em;flex-shrink:0;animation:sol-spin .75s linear infinite}@keyframes sol-spin{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
68
68
|
}
|
|
69
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolButtonComponent, decorators: [{
|
|
70
70
|
type: Component,
|
|
@@ -95,7 +95,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
95
95
|
}
|
|
96
96
|
<ng-content />
|
|
97
97
|
</button>
|
|
98
|
-
`, styles: [":host{display:inline-block;--sol-btn-primary-bg: var(--sol-color-primary, #6366f1);--sol-btn-primary-text: var(--sol-color-primary-contrast, #ffffff);--sol-btn-secondary-bg: var(--sol-color-secondary, #e2e8f0);--sol-btn-secondary-text: var(--sol-color-secondary-contrast, #1e293b);--sol-btn-danger-bg: var(--sol-color-danger, #ef4444);--sol-btn-danger-text: var(--sol-color-danger-contrast, #ffffff);--sol-btn-ghost-bg: transparent;--sol-btn-ghost-text: var(--sol-color-primary, #6366f1);--sol-btn-font-sm: var(--sol-font-size-sm, .75rem);--sol-btn-font-md: var(--sol-font-size-md, .875rem);--sol-btn-font-lg: var(--sol-font-size-lg, 1rem);--sol-btn-padding-sm: var(--sol-spacing-xs, .25rem) var(--sol-spacing-sm, .5rem);--sol-btn-padding-md: var(--sol-spacing-sm, .5rem) var(--sol-spacing-md, 1rem);--sol-btn-padding-lg: var(--sol-spacing-md, .75rem) var(--sol-spacing-lg, 1.5rem);--sol-btn-radius: var(--sol-button-radius, var(--sol-border-radius-md, .5rem));--sol-btn-font-weight: var(--sol-button-weight, 500);--sol-btn-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-btn-focus-ring: var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-btn-disabled-opacity: var(--sol-disabled-opacity, .55)}.sol-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5em;border:none;border-radius:var(--sol-btn-radius);box-shadow:var(--sol-button-shadow, none);font-family:inherit;font-weight:var(--sol-btn-font-weight);text-transform:var(--sol-button-transform, none);line-height:1;cursor:pointer;transition:background-color var(--sol-btn-transition),box-shadow var(--sol-btn-transition),transform var(--sol-btn-transition),filter var(--sol-btn-transition),opacity var(--sol-btn-transition);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .98))}.sol-btn:focus-visible{outline:none;box-shadow:var(--sol-btn-focus-ring)}.sol-btn:disabled{cursor:not-allowed;opacity:var(--sol-btn-disabled-opacity)}.sol-btn--primary{background-color:var(--sol-btn-primary-bg);color:var(--sol-btn-primary-text)}.sol-btn--primary:hover:not(:disabled){filter:brightness(1.1)}.sol-btn--primary:active:not(:disabled){filter:brightness(.95)}.sol-btn--secondary{background-color:var(--sol-btn-secondary-bg);color:var(--sol-btn-secondary-text)}.sol-btn--secondary:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 80%,black)}.sol-btn--secondary:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 70%,black)}.sol-btn--danger{background-color:var(--sol-btn-danger-bg);color:var(--sol-btn-danger-text)}.sol-btn--danger:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 85%,black)}.sol-btn--danger:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 75%,black)}.sol-btn--ghost{background-color:var(--sol-btn-ghost-bg);color:var(--sol-btn-ghost-text)}.sol-btn--ghost:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 10%,transparent)}.sol-btn--ghost:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 18%,transparent)}.sol-btn--sm{font-size:var(--sol-font-size-sm, 12px);height:32px;padding:0 12px}.sol-btn--md{font-size:var(--sol-font-size-base, 14px);height:36px;padding:0 16px}.sol-btn--lg{font-size:var(--sol-font-size-base, 14px);height:40px;padding:0 20px}.sol-btn__spinner{width:1em;height:1em;flex-shrink:0;animation:sol-spin .75s linear infinite}@keyframes sol-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
98
|
+
`, styles: [":host{display:inline-block;--sol-btn-primary-bg: var(--sol-color-primary, #6366f1);--sol-btn-primary-text: var(--sol-color-primary-contrast, #ffffff);--sol-btn-secondary-bg: var(--sol-color-secondary, #e2e8f0);--sol-btn-secondary-text: var(--sol-color-secondary-contrast, #1e293b);--sol-btn-danger-bg: var(--sol-color-danger, #ef4444);--sol-btn-danger-text: var(--sol-color-danger-contrast, #ffffff);--sol-btn-ghost-bg: transparent;--sol-btn-ghost-text: var(--sol-color-primary, #6366f1);--sol-btn-font-sm: var(--sol-font-size-sm, .75rem);--sol-btn-font-md: var(--sol-font-size-md, .875rem);--sol-btn-font-lg: var(--sol-font-size-lg, 1rem);--sol-btn-padding-sm: var(--sol-spacing-xs, .25rem) var(--sol-spacing-sm, .5rem);--sol-btn-padding-md: var(--sol-spacing-sm, .5rem) var(--sol-spacing-md, 1rem);--sol-btn-padding-lg: var(--sol-spacing-md, .75rem) var(--sol-spacing-lg, 1.5rem);--sol-btn-radius: var(--sol-button-radius, var(--sol-border-radius-md, .5rem));--sol-btn-font-weight: var(--sol-button-weight, 500);--sol-btn-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-btn-focus-ring: var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-btn-disabled-opacity: var(--sol-disabled-opacity, .55)}.sol-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5em;border:none;border-radius:var(--sol-btn-radius);box-shadow:var(--sol-button-shadow, none);font-family:inherit;font-weight:var(--sol-btn-font-weight);text-transform:var(--sol-button-transform, none);line-height:1;cursor:pointer;transition:background-color var(--sol-btn-transition),box-shadow var(--sol-btn-transition),transform var(--sol-btn-transition),filter var(--sol-btn-transition),opacity var(--sol-btn-transition);white-space:nowrap;-webkit-user-select:none;user-select:none}.sol-btn:active:not(:disabled){transform:scale(var(--sol-press-scale, .98))}.sol-btn:focus-visible{outline:none;box-shadow:var(--sol-btn-focus-ring)}.sol-btn:disabled{cursor:not-allowed;opacity:var(--sol-btn-disabled-opacity)}.sol-btn--primary{background-color:var(--sol-btn-primary-bg);color:var(--sol-btn-primary-text)}.sol-btn--primary:hover:not(:disabled){filter:brightness(1.1)}.sol-btn--primary:active:not(:disabled){filter:brightness(.95)}.sol-btn--secondary{background-color:var(--sol-btn-secondary-bg);color:var(--sol-btn-secondary-text)}.sol-btn--secondary:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 80%,black)}.sol-btn--secondary:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-secondary-bg) 70%,black)}.sol-btn--danger{background-color:var(--sol-btn-danger-bg);color:var(--sol-btn-danger-text)}.sol-btn--danger:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 85%,black)}.sol-btn--danger:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-danger-bg) 75%,black)}.sol-btn--ghost{background-color:var(--sol-btn-ghost-bg);color:var(--sol-btn-ghost-text)}.sol-btn--ghost:hover:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 10%,transparent)}.sol-btn--ghost:active:not(:disabled){background-color:color-mix(in srgb,var(--sol-btn-ghost-text) 18%,transparent)}.sol-btn--sm{font-size:var(--sol-font-size-sm, 12px);height:32px;padding:0 12px}.sol-btn--md{font-size:var(--sol-font-size-base, 14px);height:36px;padding:0 16px}.sol-btn--lg{font-size:var(--sol-font-size-base, 14px);height:40px;padding:0 20px}.sol-btn--touch{font-size:var(--sol-font-size-base, 14px);height:44px;padding:0 20px}.sol-btn__spinner{width:1em;height:1em;flex-shrink:0;animation:sol-spin .75s linear infinite}@keyframes sol-spin{to{transform:rotate(360deg)}}\n"] }]
|
|
99
99
|
}], propDecorators: { 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 }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
100
100
|
|
|
101
101
|
class SolInputComponent {
|
|
@@ -343,6 +343,13 @@ const ICON_REGISTRY = {
|
|
|
343
343
|
fill: `<path d="M4.5 3.75a3 3 0 0 0-3 3v.75h21v-.75a3 3 0 0 0-3-3h-15Z" /><path fill-rule="evenodd" d="M22.5 9.75h-21v7.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3v-7.5Zm-18 3.75a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-3Z" clip-rule="evenodd" />`,
|
|
344
344
|
},
|
|
345
345
|
// ── UI / Feedback ─────────────────────────────────────────────────────────────
|
|
346
|
+
// Calificaciones (reseñas de Google en la ficha pública). `outline` es la
|
|
347
|
+
// estrella vacía y `fill` la llena: la misma clave sirve para pintar la
|
|
348
|
+
// parte cubierta y la descubierta de una calificación.
|
|
349
|
+
star: {
|
|
350
|
+
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z" />`,
|
|
351
|
+
fill: `<path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z" clip-rule="evenodd" />`,
|
|
352
|
+
},
|
|
346
353
|
settings: {
|
|
347
354
|
outline: `<path stroke-linecap="round" stroke-linejoin="round" d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />`,
|
|
348
355
|
fill: `<path fill-rule="evenodd" d="M11.078 2.25c-.917 0-1.699.663-1.85 1.567L9.05 4.889c-.02.12-.115.26-.297.348a7.493 7.493 0 0 0-.986.57c-.166.115-.334.126-.45.083L6.3 5.508a1.875 1.875 0 0 0-2.282.819l-.922 1.597a1.875 1.875 0 0 0 .432 2.385l.84.692c.095.078.17.229.154.43a7.598 7.598 0 0 0 0 1.139c.015.2-.059.352-.153.43l-.841.692a1.875 1.875 0 0 0-.432 2.385l.922 1.597a1.875 1.875 0 0 0 2.282.818l1.019-.382c.115-.043.283-.031.45.082.312.214.641.405.986.57.182.088.277.228.297.35l.178 1.071c.151.904.933 1.567 1.85 1.567h1.844c.916 0 1.699-.663 1.85-1.567l.178-1.072c.02-.12.114-.26.297-.349.344-.165.673-.356.985-.57.167-.114.335-.125.45-.082l1.02.382a1.875 1.875 0 0 0 2.28-.819l.923-1.597a1.875 1.875 0 0 0-.432-2.385l-.84-.692c-.095-.078-.17-.229-.154-.43a7.614 7.614 0 0 0 0-1.139c-.016-.2.059-.352.153-.43l.84-.692c.708-.582.891-1.59.433-2.385l-.922-1.597a1.875 1.875 0 0 0-2.282-.818l-1.02.382c-.114.043-.282.031-.449-.083a7.49 7.49 0 0 0-.985-.57c-.183-.087-.277-.227-.297-.348l-.179-1.072a1.875 1.875 0 0 0-1.85-1.567h-1.843ZM12 15.75a3.75 3.75 0 1 0 0-7.5 3.75 3.75 0 0 0 0 7.5Z" clip-rule="evenodd" />`,
|
|
@@ -722,11 +729,18 @@ class SolIconComponent {
|
|
|
722
729
|
const paths = def
|
|
723
730
|
? (renderAsFill ? def.fill : def.outline)
|
|
724
731
|
: '<circle cx="12" cy="12" r="4" />'; // fallback dot for unknown icons
|
|
732
|
+
// `width`/`height` van como atributos y no solo por CSS: un <svg> sin
|
|
733
|
+
// dimensiones intrínsecas, usado como flex item, colapsa a alto 0 en WebKit
|
|
734
|
+
// (Safari iOS) y el ícono desaparece dejando visible únicamente el texto.
|
|
735
|
+
// Con los atributos presentes el tamaño no depende de que la hoja de
|
|
736
|
+
// estilos del componente alcance al nodo inyectado.
|
|
725
737
|
const markup = renderAsFill
|
|
726
738
|
? `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
|
|
739
|
+
width="100%" height="100%"
|
|
727
740
|
fill="currentColor" stroke="none"
|
|
728
741
|
aria-hidden="true">${paths}</svg>`
|
|
729
742
|
: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
|
|
743
|
+
width="100%" height="100%"
|
|
730
744
|
fill="none" stroke="currentColor"
|
|
731
745
|
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"
|
|
732
746
|
aria-hidden="true">${paths}</svg>`;
|
|
@@ -734,13 +748,176 @@ class SolIconComponent {
|
|
|
734
748
|
}, /* @ts-ignore */
|
|
735
749
|
...(ngDevMode ? [{ debugName: "svg" }] : /* istanbul ignore next */ []));
|
|
736
750
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
737
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: SolIconComponent, isStandalone: true, selector: "sol-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<span class="sol-icon" [class]="sizeClass()" [innerHTML]="svg()"></span>`, isInline: true, styles: [".sol-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sol-icon
|
|
751
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: SolIconComponent, isStandalone: true, selector: "sol-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<span class="sol-icon" [class]="sizeClass()" [innerHTML]="svg()"></span>`, isInline: true, styles: [".sol-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sol-icon ::ng-deep svg{width:100%;height:100%;display:block}.sol-icon-sm{width:16px;height:16px}.sol-icon-md{width:20px;height:20px}.sol-icon-lg{width:24px;height:24px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
738
752
|
}
|
|
739
753
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolIconComponent, decorators: [{
|
|
740
754
|
type: Component,
|
|
741
|
-
args: [{ selector: 'sol-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<span class="sol-icon" [class]="sizeClass()" [innerHTML]="svg()"></span>`, styles: [".sol-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sol-icon
|
|
755
|
+
args: [{ selector: 'sol-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<span class="sol-icon" [class]="sizeClass()" [innerHTML]="svg()"></span>`, styles: [".sol-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sol-icon ::ng-deep svg{width:100%;height:100%;display:block}.sol-icon-sm{width:16px;height:16px}.sol-icon-md{width:20px;height:20px}.sol-icon-lg{width:24px;height:24px}\n"] }]
|
|
742
756
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
743
757
|
|
|
758
|
+
/**
|
|
759
|
+
* `solFloatingPanel` — portal manual de paneles flotantes (CP-2).
|
|
760
|
+
*
|
|
761
|
+
* Extraído del código inline de `sol-select` para compartirlo con cualquier
|
|
762
|
+
* componente cuyo panel deba flotar POR ENCIMA de un `sol-modal` o un
|
|
763
|
+
* `sol-drawer`. El panel se mueve a `document.body` y se posiciona con
|
|
764
|
+
* `position: fixed` sobre coordenadas del viewport, de modo que ningún
|
|
765
|
+
* ancestro con `overflow` o `backdrop-filter` (típicamente `.sol-modal-body`)
|
|
766
|
+
* lo recorte.
|
|
767
|
+
*
|
|
768
|
+
* Cálculo de posición 100% manual: el proyecto prohíbe librerías de
|
|
769
|
+
* posicionamiento externas (`@floating-ui/dom`, `popper.js`).
|
|
770
|
+
*
|
|
771
|
+
* NO aplica a popovers deliberadamente clampados dentro de su host
|
|
772
|
+
* (p. ej. `sol-rich-editor`), que no desbordan y no deben portalearse.
|
|
773
|
+
*/
|
|
774
|
+
/** Id del `<style>` compartido inyectado una sola vez en `document.head`. */
|
|
775
|
+
const FLOATING_PANEL_STYLE_ID = 'sol-floating-panel-styles';
|
|
776
|
+
/**
|
|
777
|
+
* Clase compartida de todo panel portaleado: el `z-index` supera al del modal
|
|
778
|
+
* para que el panel nunca quede debajo del overlay. Vive en un `<style>`
|
|
779
|
+
* global porque el panel deja de heredar del host al portalearse, y los
|
|
780
|
+
* estilos encapsulados por componente no deben competir por especificidad.
|
|
781
|
+
*/
|
|
782
|
+
function ensureFloatingPanelStyles() {
|
|
783
|
+
if (typeof document === 'undefined')
|
|
784
|
+
return;
|
|
785
|
+
if (document.getElementById(FLOATING_PANEL_STYLE_ID))
|
|
786
|
+
return;
|
|
787
|
+
const style = document.createElement('style');
|
|
788
|
+
style.id = FLOATING_PANEL_STYLE_ID;
|
|
789
|
+
style.textContent =
|
|
790
|
+
'.sol-floating-panel { z-index: calc(var(--sol-z-modal, 1050) + 10); }';
|
|
791
|
+
document.head.appendChild(style);
|
|
792
|
+
}
|
|
793
|
+
class SolFloatingPanelDirective {
|
|
794
|
+
/** Elemento disparador cuyo rectángulo ancla el panel (requerido). */
|
|
795
|
+
trigger = input.required({ ...(ngDevMode ? { debugName: "trigger" } : /* istanbul ignore next */ {}), alias: 'solFloatingPanel' });
|
|
796
|
+
/** Separación en px entre el disparador y el panel. */
|
|
797
|
+
gap = input(4, /* @ts-ignore */
|
|
798
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
799
|
+
/**
|
|
800
|
+
* Espacio mínimo (px) que debe quedar bajo el disparador para abrir hacia
|
|
801
|
+
* abajo. Si no alcanza —y sí hay espacio arriba— el panel voltea (`dropUp`).
|
|
802
|
+
*/
|
|
803
|
+
flipThreshold = input(300, /* @ts-ignore */
|
|
804
|
+
...(ngDevMode ? [{ debugName: "flipThreshold" }] : /* istanbul ignore next */ []));
|
|
805
|
+
/** Iguala el ancho del panel al del disparador (falso = ancho propio). */
|
|
806
|
+
matchTriggerWidth = input(true, /* @ts-ignore */
|
|
807
|
+
...(ngDevMode ? [{ debugName: "matchTriggerWidth" }] : /* istanbul ignore next */ []));
|
|
808
|
+
/** Alineación horizontal contra el borde `start` o `end` del disparador. */
|
|
809
|
+
align = input('start', /* @ts-ignore */
|
|
810
|
+
...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
811
|
+
_dropUp = signal(false, /* @ts-ignore */
|
|
812
|
+
...(ngDevMode ? [{ debugName: "_dropUp" }] : /* istanbul ignore next */ []));
|
|
813
|
+
/** Verdadero cuando el panel abrió hacia arriba (el host aplica su clase). */
|
|
814
|
+
dropUp = this._dropUp.asReadonly();
|
|
815
|
+
/** Emite solo cuando la orientación cambia, para enlazarlo desde el template. */
|
|
816
|
+
dropUpChange = output();
|
|
817
|
+
panel = inject(ElementRef).nativeElement;
|
|
818
|
+
/** Disparador vigente mientras el panel está portaleado. */
|
|
819
|
+
activeTrigger = null;
|
|
820
|
+
/** Última orientación emitida (`null` = todavía no se emitió ninguna). */
|
|
821
|
+
lastEmittedDropUp = null;
|
|
822
|
+
/** Misma referencia para `addEventListener` / `removeEventListener`. */
|
|
823
|
+
repositionHandler = () => this.reposition();
|
|
824
|
+
constructor() {
|
|
825
|
+
ensureFloatingPanelStyles();
|
|
826
|
+
// El ciclo de vida del portal se ata al de la directiva: Angular la crea
|
|
827
|
+
// cuando el `@if` del host materializa el panel y la destruye al cerrarlo,
|
|
828
|
+
// así que el `onCleanup` retira listeners y nodo sin fugas.
|
|
829
|
+
effect(onCleanup => {
|
|
830
|
+
this.attach(this.trigger());
|
|
831
|
+
onCleanup(() => this.detach());
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
/** Adhiere el panel a `document.body` y lo posiciona siguiendo al disparador. */
|
|
835
|
+
attach(trigger) {
|
|
836
|
+
this.activeTrigger = trigger;
|
|
837
|
+
document.body.appendChild(this.panel);
|
|
838
|
+
this.reposition();
|
|
839
|
+
// `capture: true` es OBLIGATORIO: sin él, el listener no se entera del
|
|
840
|
+
// scroll de contenedores internos como `.sol-modal-body` (los eventos de
|
|
841
|
+
// scroll no burbujean), que es justo el caso que motiva este portal.
|
|
842
|
+
window.addEventListener('scroll', this.repositionHandler, { capture: true, passive: true });
|
|
843
|
+
window.addEventListener('resize', this.repositionHandler, { passive: true });
|
|
844
|
+
}
|
|
845
|
+
/** Retira listeners y el nodo portaleado. */
|
|
846
|
+
detach() {
|
|
847
|
+
window.removeEventListener('scroll', this.repositionHandler, { capture: true });
|
|
848
|
+
window.removeEventListener('resize', this.repositionHandler);
|
|
849
|
+
// Guarda necesaria: Angular puede haber destruido el nodo por su cuenta
|
|
850
|
+
// (el `removeChild` sobre un nodo ya desprendido lanzaría).
|
|
851
|
+
if (this.panel.parentNode === document.body) {
|
|
852
|
+
document.body.removeChild(this.panel);
|
|
853
|
+
}
|
|
854
|
+
this.activeTrigger = null;
|
|
855
|
+
this.lastEmittedDropUp = null;
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Recalcula la posición del panel en coordenadas fijas del viewport.
|
|
859
|
+
* Público para que el host pueda forzar el recálculo tras cambios de
|
|
860
|
+
* contenido que alteren el tamaño del panel.
|
|
861
|
+
*/
|
|
862
|
+
reposition() {
|
|
863
|
+
const trigger = this.activeTrigger;
|
|
864
|
+
if (!trigger)
|
|
865
|
+
return;
|
|
866
|
+
const rect = trigger.getBoundingClientRect();
|
|
867
|
+
const gap = this.gap();
|
|
868
|
+
const threshold = this.flipThreshold();
|
|
869
|
+
// Voltea solo si abajo no cabe Y arriba sí: sin la segunda condición, en
|
|
870
|
+
// viewports muy bajos el panel se iría hacia arriba a un espacio igual de
|
|
871
|
+
// insuficiente.
|
|
872
|
+
const spaceBelow = window.innerHeight - rect.bottom;
|
|
873
|
+
const dropUp = spaceBelow < threshold && rect.top > threshold;
|
|
874
|
+
this.setDropUp(dropUp);
|
|
875
|
+
const panel = this.panel;
|
|
876
|
+
panel.style.position = 'fixed';
|
|
877
|
+
panel.style.right = 'auto';
|
|
878
|
+
if (this.matchTriggerWidth()) {
|
|
879
|
+
panel.style.width = `${rect.width}px`;
|
|
880
|
+
}
|
|
881
|
+
panel.style.left = `${this.resolveLeft(rect, gap)}px`;
|
|
882
|
+
if (dropUp) {
|
|
883
|
+
panel.style.top = 'auto';
|
|
884
|
+
panel.style.bottom = `${window.innerHeight - rect.top + gap}px`;
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
panel.style.top = `${rect.bottom + gap}px`;
|
|
888
|
+
panel.style.bottom = 'auto';
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
/** Coordenada X según la alineación, acotada al viewport cuando hay margen. */
|
|
892
|
+
resolveLeft(rect, gap) {
|
|
893
|
+
const width = this.matchTriggerWidth() ? rect.width : this.panel.offsetWidth;
|
|
894
|
+
let left = this.align() === 'end' ? rect.right - width : rect.left;
|
|
895
|
+
const maxLeft = window.innerWidth - width - gap;
|
|
896
|
+
if (maxLeft > gap)
|
|
897
|
+
left = Math.min(left, maxLeft);
|
|
898
|
+
return Math.max(gap, left);
|
|
899
|
+
}
|
|
900
|
+
/** Publica la orientación evitando emisiones repetidas en cada scroll. */
|
|
901
|
+
setDropUp(dropUp) {
|
|
902
|
+
this._dropUp.set(dropUp);
|
|
903
|
+
if (this.lastEmittedDropUp === dropUp)
|
|
904
|
+
return;
|
|
905
|
+
this.lastEmittedDropUp = dropUp;
|
|
906
|
+
this.dropUpChange.emit(dropUp);
|
|
907
|
+
}
|
|
908
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolFloatingPanelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
909
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: SolFloatingPanelDirective, isStandalone: true, selector: "[solFloatingPanel]", inputs: { trigger: { classPropertyName: "trigger", publicName: "solFloatingPanel", isSignal: true, isRequired: true, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, flipThreshold: { classPropertyName: "flipThreshold", publicName: "flipThreshold", isSignal: true, isRequired: false, transformFunction: null }, matchTriggerWidth: { classPropertyName: "matchTriggerWidth", publicName: "matchTriggerWidth", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dropUpChange: "dropUpChange" }, host: { classAttribute: "sol-floating-panel" }, exportAs: ["solFloatingPanel"], ngImport: i0 });
|
|
910
|
+
}
|
|
911
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolFloatingPanelDirective, decorators: [{
|
|
912
|
+
type: Directive,
|
|
913
|
+
args: [{
|
|
914
|
+
selector: '[solFloatingPanel]',
|
|
915
|
+
standalone: true,
|
|
916
|
+
exportAs: 'solFloatingPanel',
|
|
917
|
+
host: { class: 'sol-floating-panel' },
|
|
918
|
+
}]
|
|
919
|
+
}], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "solFloatingPanel", required: true }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], flipThreshold: [{ type: i0.Input, args: [{ isSignal: true, alias: "flipThreshold", required: false }] }], matchTriggerWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "matchTriggerWidth", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], dropUpChange: [{ type: i0.Output, args: ["dropUpChange"] }] } });
|
|
920
|
+
|
|
744
921
|
class SolSelectComponent {
|
|
745
922
|
hostEl;
|
|
746
923
|
/** Placeholder text when nothing is selected. */
|
|
@@ -783,17 +960,11 @@ class SolSelectComponent {
|
|
|
783
960
|
...(ngDevMode ? [{ debugName: "multiValues" }] : /* istanbul ignore next */ []));
|
|
784
961
|
searchInput = viewChild('searchInput', /* @ts-ignore */
|
|
785
962
|
...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
|
|
786
|
-
triggerBtn = viewChild('triggerBtn', /* @ts-ignore */
|
|
787
|
-
...(ngDevMode ? [{ debugName: "triggerBtn" }] : /* istanbul ignore next */ []));
|
|
788
963
|
dropdownPanel = viewChild('dropdownPanel', /* @ts-ignore */
|
|
789
964
|
...(ngDevMode ? [{ debugName: "dropdownPanel" }] : /* istanbul ignore next */ []));
|
|
790
965
|
/** Id único que enlaza el trigger (aria-controls) con el listbox portaleado. */
|
|
791
966
|
static nextId = 0;
|
|
792
967
|
panelId = `sol-select-panel-${SolSelectComponent.nextId++}`;
|
|
793
|
-
/** Nodo del panel mientras vive portaleado en document.body. */
|
|
794
|
-
portalPanel = null;
|
|
795
|
-
/** Reposiciona el panel; misma referencia para add/removeEventListener. */
|
|
796
|
-
reposition = () => this.positionPanel();
|
|
797
968
|
filteredOptions = computed(() => {
|
|
798
969
|
const term = this.searchTerm().toLowerCase();
|
|
799
970
|
const opts = this.options();
|
|
@@ -835,23 +1006,13 @@ class SolSelectComponent {
|
|
|
835
1006
|
const target = event.target;
|
|
836
1007
|
const insideHost = this.hostEl.nativeElement.contains(target);
|
|
837
1008
|
// El panel vive portaleado en document.body: también cuenta como "dentro".
|
|
838
|
-
const insidePanel = this.
|
|
1009
|
+
const insidePanel = this.dropdownPanel()?.nativeElement.contains(target) ?? false;
|
|
839
1010
|
if (!insideHost && !insidePanel) {
|
|
840
1011
|
this.closeDropdown();
|
|
841
1012
|
}
|
|
842
1013
|
}
|
|
843
1014
|
constructor(hostEl) {
|
|
844
1015
|
this.hostEl = hostEl;
|
|
845
|
-
// Portal manual (CP-2): cuando @if crea el panel, se mueve a document.body
|
|
846
|
-
// con position:fixed y coordenadas del trigger; el cleanup del effect
|
|
847
|
-
// retira listeners y el nodo al cerrar o destruir, sin fugas.
|
|
848
|
-
effect(onCleanup => {
|
|
849
|
-
const panel = this.dropdownPanel()?.nativeElement ?? null;
|
|
850
|
-
if (!panel)
|
|
851
|
-
return;
|
|
852
|
-
this.attachPanel(panel);
|
|
853
|
-
onCleanup(() => this.detachPanel());
|
|
854
|
-
});
|
|
855
1016
|
}
|
|
856
1017
|
toggleDropdown() {
|
|
857
1018
|
if (this.disabled())
|
|
@@ -862,49 +1023,6 @@ class SolSelectComponent {
|
|
|
862
1023
|
setTimeout(() => this.searchInput()?.nativeElement?.focus(), 50);
|
|
863
1024
|
}
|
|
864
1025
|
}
|
|
865
|
-
/** Adhiere el panel a document.body y lo posiciona siguiendo al trigger. */
|
|
866
|
-
attachPanel(panel) {
|
|
867
|
-
this.portalPanel = panel;
|
|
868
|
-
document.body.appendChild(panel);
|
|
869
|
-
this.positionPanel();
|
|
870
|
-
window.addEventListener('scroll', this.reposition, { capture: true, passive: true });
|
|
871
|
-
window.addEventListener('resize', this.reposition, { passive: true });
|
|
872
|
-
}
|
|
873
|
-
/** Retira listeners y el nodo portaleado (si Angular no lo removió ya). */
|
|
874
|
-
detachPanel() {
|
|
875
|
-
window.removeEventListener('scroll', this.reposition, { capture: true });
|
|
876
|
-
window.removeEventListener('resize', this.reposition);
|
|
877
|
-
if (this.portalPanel && this.portalPanel.parentNode === document.body) {
|
|
878
|
-
document.body.removeChild(this.portalPanel);
|
|
879
|
-
}
|
|
880
|
-
this.portalPanel = null;
|
|
881
|
-
}
|
|
882
|
-
/**
|
|
883
|
-
* Posiciona el panel con coordenadas fixed del viewport: ancho y eje X del
|
|
884
|
-
* trigger; hacia abajo por defecto o anclado por bottom (dropUp) cuando el
|
|
885
|
-
* espacio real bajo el trigger es menor a 300px.
|
|
886
|
-
*/
|
|
887
|
-
positionPanel() {
|
|
888
|
-
const panel = this.portalPanel;
|
|
889
|
-
const trigger = this.triggerBtn()?.nativeElement;
|
|
890
|
-
if (!panel || !trigger)
|
|
891
|
-
return;
|
|
892
|
-
const rect = trigger.getBoundingClientRect();
|
|
893
|
-
const spaceBelow = window.innerHeight - rect.bottom;
|
|
894
|
-
this.dropUp.set(spaceBelow < 300);
|
|
895
|
-
panel.style.position = 'fixed';
|
|
896
|
-
panel.style.left = `${rect.left}px`;
|
|
897
|
-
panel.style.width = `${rect.width}px`;
|
|
898
|
-
panel.style.right = 'auto';
|
|
899
|
-
if (this.dropUp()) {
|
|
900
|
-
panel.style.top = 'auto';
|
|
901
|
-
panel.style.bottom = `${window.innerHeight - rect.top + 4}px`;
|
|
902
|
-
}
|
|
903
|
-
else {
|
|
904
|
-
panel.style.top = `${rect.bottom + 4}px`;
|
|
905
|
-
panel.style.bottom = 'auto';
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
1026
|
closeDropdown() {
|
|
909
1027
|
this.isOpen.set(false);
|
|
910
1028
|
}
|
|
@@ -973,7 +1091,7 @@ class SolSelectComponent {
|
|
|
973
1091
|
useExisting: forwardRef(() => SolSelectComponent),
|
|
974
1092
|
multi: true,
|
|
975
1093
|
},
|
|
976
|
-
], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "
|
|
1094
|
+
], viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "dropdownPanel", first: true, predicate: ["dropdownPanel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
977
1095
|
@if (label()) {
|
|
978
1096
|
<label class="sol-select__label">{{ label() }}</label>
|
|
979
1097
|
}
|
|
@@ -997,15 +1115,18 @@ class SolSelectComponent {
|
|
|
997
1115
|
</button>
|
|
998
1116
|
|
|
999
1117
|
<!-- Panel del dropdown: al abrirse se portalea a document.body con
|
|
1000
|
-
position:fixed (CP-2
|
|
1001
|
-
recorte (ej. .sol-modal-body).
|
|
1002
|
-
aria-controls porque input y listbox
|
|
1118
|
+
position:fixed (CP-2, directiva compartida solFloatingPanel) para
|
|
1119
|
+
que ningún ancestro con overflow lo recorte (ej. .sol-modal-body).
|
|
1120
|
+
El trigger queda enlazado por aria-controls porque input y listbox
|
|
1121
|
+
viven en árboles distintos. -->
|
|
1003
1122
|
@if (isOpen()) {
|
|
1004
1123
|
<div
|
|
1005
1124
|
#dropdownPanel
|
|
1006
1125
|
class="sol-select__dropdown"
|
|
1007
1126
|
role="listbox"
|
|
1008
1127
|
[id]="panelId"
|
|
1128
|
+
[solFloatingPanel]="triggerBtn"
|
|
1129
|
+
(dropUpChange)="dropUp.set($event)"
|
|
1009
1130
|
[class.sol-select__dropdown--up]="dropUp()"
|
|
1010
1131
|
>
|
|
1011
1132
|
<!-- Search -->
|
|
@@ -1068,11 +1189,11 @@ class SolSelectComponent {
|
|
|
1068
1189
|
@if (error()) {
|
|
1069
1190
|
<p class="sol-select__error">{{ error() }}</p>
|
|
1070
1191
|
}
|
|
1071
|
-
`, 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;
|
|
1192
|
+
`, 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 });
|
|
1072
1193
|
}
|
|
1073
1194
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolSelectComponent, decorators: [{
|
|
1074
1195
|
type: Component,
|
|
1075
|
-
args: [{ selector: 'sol-select', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent], providers: [
|
|
1196
|
+
args: [{ selector: 'sol-select', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent, SolFloatingPanelDirective], providers: [
|
|
1076
1197
|
{
|
|
1077
1198
|
provide: NG_VALUE_ACCESSOR,
|
|
1078
1199
|
useExisting: forwardRef(() => SolSelectComponent),
|
|
@@ -1102,15 +1223,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1102
1223
|
</button>
|
|
1103
1224
|
|
|
1104
1225
|
<!-- Panel del dropdown: al abrirse se portalea a document.body con
|
|
1105
|
-
position:fixed (CP-2
|
|
1106
|
-
recorte (ej. .sol-modal-body).
|
|
1107
|
-
aria-controls porque input y listbox
|
|
1226
|
+
position:fixed (CP-2, directiva compartida solFloatingPanel) para
|
|
1227
|
+
que ningún ancestro con overflow lo recorte (ej. .sol-modal-body).
|
|
1228
|
+
El trigger queda enlazado por aria-controls porque input y listbox
|
|
1229
|
+
viven en árboles distintos. -->
|
|
1108
1230
|
@if (isOpen()) {
|
|
1109
1231
|
<div
|
|
1110
1232
|
#dropdownPanel
|
|
1111
1233
|
class="sol-select__dropdown"
|
|
1112
1234
|
role="listbox"
|
|
1113
1235
|
[id]="panelId"
|
|
1236
|
+
[solFloatingPanel]="triggerBtn"
|
|
1237
|
+
(dropUpChange)="dropUp.set($event)"
|
|
1114
1238
|
[class.sol-select__dropdown--up]="dropUp()"
|
|
1115
1239
|
>
|
|
1116
1240
|
<!-- Search -->
|
|
@@ -1173,8 +1297,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1173
1297
|
@if (error()) {
|
|
1174
1298
|
<p class="sol-select__error">{{ error() }}</p>
|
|
1175
1299
|
}
|
|
1176
|
-
`, 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;
|
|
1177
|
-
}], 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 }] }],
|
|
1300
|
+
`, 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"] }]
|
|
1301
|
+
}], 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: [{
|
|
1178
1302
|
type: HostListener,
|
|
1179
1303
|
args: ['document:click', ['$event']]
|
|
1180
1304
|
}] } });
|
|
@@ -1287,6 +1411,17 @@ class SolToggleComponent {
|
|
|
1287
1411
|
/** Optional label displayed beside the toggle. */
|
|
1288
1412
|
label = input('', /* @ts-ignore */
|
|
1289
1413
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1414
|
+
/**
|
|
1415
|
+
* Accessible name applied to the inner `button[role="switch"]`.
|
|
1416
|
+
*
|
|
1417
|
+
* The host element is not the switch, so an `aria-label` bound on
|
|
1418
|
+
* `<sol-toggle>` never reaches the control that screen readers announce.
|
|
1419
|
+
* Use this input whenever the toggle ships without a visible `label`
|
|
1420
|
+
* (e.g. a switch inside a table row, where the row already carries the
|
|
1421
|
+
* visible text). Empty string renders no attribute.
|
|
1422
|
+
*/
|
|
1423
|
+
ariaLabel = input('', /* @ts-ignore */
|
|
1424
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1290
1425
|
/** Whether the toggle is disabled. */
|
|
1291
1426
|
disabled = input(false, /* @ts-ignore */
|
|
1292
1427
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
@@ -1356,7 +1491,7 @@ class SolToggleComponent {
|
|
|
1356
1491
|
// if the form sets disabled state, we reflect it through the template binding
|
|
1357
1492
|
}
|
|
1358
1493
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1359
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolToggleComponent, isStandalone: true, selector: "sol-toggle", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, onText: { classPropertyName: "onText", publicName: "onText", isSignal: true, isRequired: false, transformFunction: null }, offText: { classPropertyName: "offText", publicName: "offText", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1494
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolToggleComponent, isStandalone: true, selector: "sol-toggle", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, onText: { classPropertyName: "onText", publicName: "onText", isSignal: true, isRequired: false, transformFunction: null }, offText: { classPropertyName: "offText", publicName: "offText", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
1360
1495
|
{
|
|
1361
1496
|
provide: NG_VALUE_ACCESSOR,
|
|
1362
1497
|
useExisting: forwardRef(() => SolToggleComponent),
|
|
@@ -1368,6 +1503,7 @@ class SolToggleComponent {
|
|
|
1368
1503
|
type="button"
|
|
1369
1504
|
role="switch"
|
|
1370
1505
|
[attr.aria-checked]="checked()"
|
|
1506
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
1371
1507
|
[class]="trackClass()"
|
|
1372
1508
|
[disabled]="disabled()"
|
|
1373
1509
|
(click)="toggle()"
|
|
@@ -1400,6 +1536,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1400
1536
|
type="button"
|
|
1401
1537
|
role="switch"
|
|
1402
1538
|
[attr.aria-checked]="checked()"
|
|
1539
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
1403
1540
|
[class]="trackClass()"
|
|
1404
1541
|
[disabled]="disabled()"
|
|
1405
1542
|
(click)="toggle()"
|
|
@@ -1417,7 +1554,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1417
1554
|
}
|
|
1418
1555
|
</label>
|
|
1419
1556
|
`, styles: [":host{display:inline-block;--sol-toggle-track-off: var(--sol-color-text-muted, #cbd5e1);--sol-toggle-track-on: var(--sol-color-primary, #6366f1);--sol-toggle-thumb: var(--sol-bg-surface, #ffffff);--sol-toggle-label-color: var(--sol-color-text-primary, #1e293b);--sol-toggle-state-color: var(--sol-color-text-secondary, #475569);--sol-toggle-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-toggle-focus-ring: var(--sol-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 40%, transparent));--sol-toggle-transition: var(--sol-transition-fast, .15s ease);--sol-toggle-shadow: var(--sol-shadow-sm, 0 1px 2px rgba(0,0,0,.1));--sol-toggle-md-width: 2.75rem;--sol-toggle-md-height: 1.5rem;--sol-toggle-md-thumb: 1.25rem;--sol-toggle-md-offset: .125rem;--sol-toggle-md-label-font: var(--sol-font-size-base, .875rem);--sol-toggle-sm-width: 2rem;--sol-toggle-sm-height: 1.125rem;--sol-toggle-sm-thumb: .875rem;--sol-toggle-sm-offset: .125rem;--sol-toggle-sm-label-font: var(--sol-font-size-sm, .75rem)}.sol-toggle{display:inline-flex;align-items:center;gap:.5rem;cursor:pointer}.sol-toggle--disabled{cursor:not-allowed;opacity:var(--sol-toggle-disabled-opacity)}.sol-toggle__track{position:relative;display:inline-flex;align-items:center;flex-shrink:0;border:none;padding:0;cursor:pointer;border-radius:9999px;background-color:var(--sol-toggle-track-off);transition:background-color var(--sol-toggle-transition)}.sol-toggle__track:focus-visible{outline:none;box-shadow:var(--sol-toggle-focus-ring)}.sol-toggle__track:disabled{cursor:not-allowed}.sol-toggle__track--on{background-color:var(--sol-toggle-track-on)}.sol-toggle__track--md{width:var(--sol-toggle-md-width);height:var(--sol-toggle-md-height)}.sol-toggle__track--sm{width:var(--sol-toggle-sm-width);height:var(--sol-toggle-sm-height)}.sol-toggle__thumb{display:block;border-radius:9999px;background-color:var(--sol-toggle-thumb);box-shadow:var(--sol-toggle-shadow);transition:transform var(--sol-toggle-transition)}.sol-toggle__thumb--md{width:var(--sol-toggle-md-thumb);height:var(--sol-toggle-md-thumb);transform:translate(var(--sol-toggle-md-offset))}.sol-toggle__thumb--md-on{transform:translate(calc(var(--sol-toggle-md-width) - var(--sol-toggle-md-thumb) - var(--sol-toggle-md-offset)))}.sol-toggle__thumb--sm{width:var(--sol-toggle-sm-thumb);height:var(--sol-toggle-sm-thumb);transform:translate(var(--sol-toggle-sm-offset))}.sol-toggle__thumb--sm-on{transform:translate(calc(var(--sol-toggle-sm-width) - var(--sol-toggle-sm-thumb) - var(--sol-toggle-sm-offset)))}.sol-toggle__state{min-width:1.75rem;font-weight:var(--sol-font-weight-bold, 600);text-transform:uppercase;letter-spacing:.04em;color:var(--sol-toggle-state-color);-webkit-user-select:none;user-select:none}.sol-toggle--sm .sol-toggle__state,.sol-toggle--md .sol-toggle__state{font-size:var(--sol-font-size-sm, .75rem)}.sol-toggle__label{color:var(--sol-toggle-label-color);-webkit-user-select:none;user-select:none}.sol-toggle--sm .sol-toggle__label{font-size:var(--sol-toggle-sm-label-font)}.sol-toggle--md .sol-toggle__label{font-size:var(--sol-toggle-md-label-font)}\n"] }]
|
|
1420
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onText: [{ type: i0.Input, args: [{ isSignal: true, alias: "onText", required: false }] }], offText: [{ type: i0.Input, args: [{ isSignal: true, alias: "offText", required: false }] }] } });
|
|
1557
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], onText: [{ type: i0.Input, args: [{ isSignal: true, alias: "onText", required: false }] }], offText: [{ type: i0.Input, args: [{ isSignal: true, alias: "offText", required: false }] }] } });
|
|
1421
1558
|
|
|
1422
1559
|
/**
|
|
1423
1560
|
* Predicados puros compartidos por los overlays de la casa (`sol-modal`,
|
|
@@ -1673,6 +1810,9 @@ class SolDrawerComponent {
|
|
|
1673
1810
|
/** Width preset for the drawer panel. */
|
|
1674
1811
|
size = input('md', /* @ts-ignore */
|
|
1675
1812
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1813
|
+
/** Visual variant — `panel` (default, unchanged) or `sheet` (PR-C4, bottom sheet on mobile only). See {@link SolDrawerVariant}. */
|
|
1814
|
+
variant = input('panel', /* @ts-ignore */
|
|
1815
|
+
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1676
1816
|
/** Whether the drawer can be closed by the user. */
|
|
1677
1817
|
closeable = input(true, /* @ts-ignore */
|
|
1678
1818
|
...(ngDevMode ? [{ debugName: "closeable" }] : /* istanbul ignore next */ []));
|
|
@@ -1690,9 +1830,11 @@ class SolDrawerComponent {
|
|
|
1690
1830
|
...(ngDevMode ? [{ debugName: "panelEl" }] : /* istanbul ignore next */ []));
|
|
1691
1831
|
/** Unique id consumed by `aria-labelledby`. */
|
|
1692
1832
|
titleId = `sol-drawer-title-${SolDrawerComponent.nextId++}`;
|
|
1693
|
-
overlayClasses = computed(() => `sol-drawer-overlay sol-drawer-overlay--${this.side()}
|
|
1833
|
+
overlayClasses = computed(() => `sol-drawer-overlay sol-drawer-overlay--${this.side()}` +
|
|
1834
|
+
(this.variant() === 'sheet' ? ' sol-drawer-overlay--sheet' : ''), /* @ts-ignore */
|
|
1694
1835
|
...(ngDevMode ? [{ debugName: "overlayClasses" }] : /* istanbul ignore next */ []));
|
|
1695
|
-
panelClasses = computed(() => `sol-drawer-panel sol-drawer-panel--${this.side()} sol-drawer-${this.size()}
|
|
1836
|
+
panelClasses = computed(() => `sol-drawer-panel sol-drawer-panel--${this.side()} sol-drawer-${this.size()}` +
|
|
1837
|
+
(this.variant() === 'sheet' ? ' sol-drawer-panel--sheet' : ''), /* @ts-ignore */
|
|
1696
1838
|
...(ngDevMode ? [{ debugName: "panelClasses" }] : /* istanbul ignore next */ []));
|
|
1697
1839
|
closeLabel = computed(() => {
|
|
1698
1840
|
this.i18n.activeLang();
|
|
@@ -1732,7 +1874,7 @@ class SolDrawerComponent {
|
|
|
1732
1874
|
this.closed.emit();
|
|
1733
1875
|
}
|
|
1734
1876
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolDrawerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1735
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolDrawerComponent, isStandalone: true, selector: "sol-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closeable: { classPropertyName: "closeable", publicName: "closeable", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, viewQueries: [{ propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1877
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolDrawerComponent, isStandalone: true, selector: "sol-drawer", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, closeable: { classPropertyName: "closeable", publicName: "closeable", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { listeners: { "document:keydown.escape": "onEscapeKey()" } }, viewQueries: [{ propertyName: "panelEl", first: true, predicate: ["panel"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
1736
1878
|
@if (open()) {
|
|
1737
1879
|
<div
|
|
1738
1880
|
[class]="overlayClasses()"
|
|
@@ -1769,7 +1911,7 @@ class SolDrawerComponent {
|
|
|
1769
1911
|
</div>
|
|
1770
1912
|
</div>
|
|
1771
1913
|
}
|
|
1772
|
-
`, isInline: true, styles: [".sol-drawer-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;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-drawer-fade-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-overlay--start{justify-content:flex-start}.sol-drawer-overlay--end{justify-content:flex-end}.sol-drawer-panel{position:relative;display:flex;flex-direction:column;height:100dvh;background:var(--sol-bg-surface, #fff);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));outline:none;animation:sol-drawer-slide-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-panel--start{--sol-drawer-slide-from: -100%;border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-right-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-panel--end{--sol-drawer-slide-from: 100%;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-sm{width:min(20rem,100vw)}.sol-drawer-md{width:min(28rem,100vw)}.sol-drawer-lg{width:min(40rem,100vw)}.sol-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--sol-border-color-default, #e5e7eb);flex:none}.sol-drawer-title{margin:0;font-size:1.125rem;font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-drawer-close{display:inline-flex;align-items:center;justify-content:center;width:
|
|
1914
|
+
`, isInline: true, styles: [".sol-drawer-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;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-drawer-fade-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-overlay--start{justify-content:flex-start}.sol-drawer-overlay--end{justify-content:flex-end}.sol-drawer-panel{position:relative;display:flex;flex-direction:column;height:100dvh;background:var(--sol-bg-surface, #fff);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));outline:none;animation:sol-drawer-slide-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-panel--start{--sol-drawer-slide-from: -100%;border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-right-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-panel--end{--sol-drawer-slide-from: 100%;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-sm{width:min(20rem,100vw)}.sol-drawer-md{width:min(28rem,100vw)}.sol-drawer-lg{width:min(40rem,100vw)}.sol-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--sol-border-color-default, #e5e7eb);flex:none}.sol-drawer-title{margin:0;font-size:1.125rem;font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-drawer-close{display:inline-flex;align-items:center;justify-content:center;min-width:2.75rem;min-height:2.75rem;border:none;border-radius:var(--sol-border-radius-lg, 8px);background:transparent;color:var(--sol-color-text-secondary, #6b7280);cursor:pointer;transition:background var(--sol-dur-fast, .12s) ease,color var(--sol-dur-fast, .12s) ease}.sol-drawer-close:hover{background:var(--sol-color-bg-hover, rgba(0, 0, 0, .06));color:var(--sol-color-text-primary, #111827)}.sol-drawer-body{flex:1 1 auto;overflow-y:auto;padding:1.5rem}@media(max-width:640px){.sol-drawer-sm,.sol-drawer-md,.sol-drawer-lg{width:100vw}.sol-drawer-panel--start,.sol-drawer-panel--end{border-left:none;border-right:none;border-radius:0}}@media(max-width:767px){.sol-drawer-overlay--sheet{align-items:flex-end}.sol-drawer-panel--sheet{width:100vw;height:min(92dvh,100dvh);max-height:92dvh;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:0;border-bottom-right-radius:0;animation:sol-drawer-sheet-slide-up var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}}@keyframes sol-drawer-fade-in{0%{opacity:0}to{opacity:1}}@keyframes sol-drawer-slide-in{0%{transform:translate(var(--sol-drawer-slide-from, 100%))}to{transform:translate(0)}}@keyframes sol-drawer-sheet-slide-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.sol-drawer-overlay,.sol-drawer-panel{animation:none}}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1773
1915
|
}
|
|
1774
1916
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolDrawerComponent, decorators: [{
|
|
1775
1917
|
type: Component,
|
|
@@ -1810,8 +1952,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1810
1952
|
</div>
|
|
1811
1953
|
</div>
|
|
1812
1954
|
}
|
|
1813
|
-
`, styles: [".sol-drawer-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;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-drawer-fade-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-overlay--start{justify-content:flex-start}.sol-drawer-overlay--end{justify-content:flex-end}.sol-drawer-panel{position:relative;display:flex;flex-direction:column;height:100dvh;background:var(--sol-bg-surface, #fff);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));outline:none;animation:sol-drawer-slide-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-panel--start{--sol-drawer-slide-from: -100%;border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-right-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-panel--end{--sol-drawer-slide-from: 100%;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-sm{width:min(20rem,100vw)}.sol-drawer-md{width:min(28rem,100vw)}.sol-drawer-lg{width:min(40rem,100vw)}.sol-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--sol-border-color-default, #e5e7eb);flex:none}.sol-drawer-title{margin:0;font-size:1.125rem;font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-drawer-close{display:inline-flex;align-items:center;justify-content:center;width:
|
|
1814
|
-
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closeable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeable", required: false }] }], closeOnBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdrop", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], panelEl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], onEscapeKey: [{
|
|
1955
|
+
`, styles: [".sol-drawer-overlay{position:fixed;inset:0;z-index:var(--sol-z-modal, 1000);display:flex;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-drawer-fade-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-overlay--start{justify-content:flex-start}.sol-drawer-overlay--end{justify-content:flex-end}.sol-drawer-panel{position:relative;display:flex;flex-direction:column;height:100dvh;background:var(--sol-bg-surface, #fff);box-shadow:var(--sol-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));outline:none;animation:sol-drawer-slide-in var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}.sol-drawer-panel--start{--sol-drawer-slide-from: -100%;border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-right-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-panel--end{--sol-drawer-slide-from: 100%;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:var(--sol-border-radius-lg, 12px)}.sol-drawer-sm{width:min(20rem,100vw)}.sol-drawer-md{width:min(28rem,100vw)}.sol-drawer-lg{width:min(40rem,100vw)}.sol-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.5rem;border-bottom:1px solid var(--sol-border-color-default, #e5e7eb);flex:none}.sol-drawer-title{margin:0;font-size:1.125rem;font-weight:600;color:var(--sol-color-text-primary, #111827)}.sol-drawer-close{display:inline-flex;align-items:center;justify-content:center;min-width:2.75rem;min-height:2.75rem;border:none;border-radius:var(--sol-border-radius-lg, 8px);background:transparent;color:var(--sol-color-text-secondary, #6b7280);cursor:pointer;transition:background var(--sol-dur-fast, .12s) ease,color var(--sol-dur-fast, .12s) ease}.sol-drawer-close:hover{background:var(--sol-color-bg-hover, rgba(0, 0, 0, .06));color:var(--sol-color-text-primary, #111827)}.sol-drawer-body{flex:1 1 auto;overflow-y:auto;padding:1.5rem}@media(max-width:640px){.sol-drawer-sm,.sol-drawer-md,.sol-drawer-lg{width:100vw}.sol-drawer-panel--start,.sol-drawer-panel--end{border-left:none;border-right:none;border-radius:0}}@media(max-width:767px){.sol-drawer-overlay--sheet{align-items:flex-end}.sol-drawer-panel--sheet{width:100vw;height:min(92dvh,100dvh);max-height:92dvh;border-left:1px solid var(--sol-border-color-default, #e5e7eb);border-right:1px solid var(--sol-border-color-default, #e5e7eb);border-top-left-radius:var(--sol-border-radius-lg, 12px);border-top-right-radius:var(--sol-border-radius-lg, 12px);border-bottom-left-radius:0;border-bottom-right-radius:0;animation:sol-drawer-sheet-slide-up var(--sol-dur-base, .24s) var(--sol-ease-entrance, cubic-bezier(.2, 0, 0, 1))}}@keyframes sol-drawer-fade-in{0%{opacity:0}to{opacity:1}}@keyframes sol-drawer-slide-in{0%{transform:translate(var(--sol-drawer-slide-from, 100%))}to{transform:translate(0)}}@keyframes sol-drawer-sheet-slide-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.sol-drawer-overlay,.sol-drawer-panel{animation:none}}\n"] }]
|
|
1956
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], side: [{ type: i0.Input, args: [{ isSignal: true, alias: "side", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], closeable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeable", required: false }] }], closeOnBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdrop", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }], panelEl: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], onEscapeKey: [{
|
|
1815
1957
|
type: HostListener,
|
|
1816
1958
|
args: ['document:keydown.escape']
|
|
1817
1959
|
}] } });
|
|
@@ -1997,7 +2139,7 @@ class SolTabsComponent {
|
|
|
1997
2139
|
}
|
|
1998
2140
|
<div class="sol-tabs__indicator" [style]="indicatorStyle()"></div>
|
|
1999
2141
|
</div>
|
|
2000
|
-
`, isInline: true, styles: [".sol-tabs{display:flex;position:relative;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);gap:0}.sol-tabs__tab{position:relative;padding:10px 16px;border:none;background:transparent;font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 12px);font-weight:500;color:var(--sol-color-text-secondary, #64748B);cursor:pointer;transition:color .2s ease,background-color .2s ease;white-space:nowrap;z-index:1}.sol-tabs__tab:hover{color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active{color:var(--sol-color-primary, #2563EB);font-weight:600;background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active:after{content:\"\";position:absolute;bottom
|
|
2142
|
+
`, isInline: true, styles: [".sol-tabs{display:flex;position:relative;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);gap:0;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--sol-color-text-secondary, #64748B) 35%,transparent) transparent}.sol-tabs::-webkit-scrollbar{height:4px}.sol-tabs::-webkit-scrollbar-track{background:transparent}.sol-tabs::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--sol-color-text-secondary, #64748B) 35%,transparent);border-radius:var(--sol-border-radius-full, 9999px)}.sol-tabs__tab{position:relative;flex-shrink:0;padding:10px 16px;border:none;background:transparent;font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 12px);font-weight:500;color:var(--sol-color-text-secondary, #64748B);cursor:pointer;transition:color .2s ease,background-color .2s ease;white-space:nowrap;z-index:1}.sol-tabs__tab:hover{color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active{color:var(--sol-color-primary, #2563EB);font-weight:600;background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active:after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--sol-color-primary, #2563EB);border-radius:2px 2px 0 0}.sol-tabs__indicator{display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2001
2143
|
}
|
|
2002
2144
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolTabsComponent, decorators: [{
|
|
2003
2145
|
type: Component,
|
|
@@ -2017,7 +2159,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
2017
2159
|
}
|
|
2018
2160
|
<div class="sol-tabs__indicator" [style]="indicatorStyle()"></div>
|
|
2019
2161
|
</div>
|
|
2020
|
-
`, styles: [".sol-tabs{display:flex;position:relative;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);gap:0}.sol-tabs__tab{position:relative;padding:10px 16px;border:none;background:transparent;font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 12px);font-weight:500;color:var(--sol-color-text-secondary, #64748B);cursor:pointer;transition:color .2s ease,background-color .2s ease;white-space:nowrap;z-index:1}.sol-tabs__tab:hover{color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active{color:var(--sol-color-primary, #2563EB);font-weight:600;background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active:after{content:\"\";position:absolute;bottom
|
|
2162
|
+
`, styles: [".sol-tabs{display:flex;position:relative;border-bottom:1px solid var(--sol-border-color-default, #E2E8F0);gap:0;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--sol-color-text-secondary, #64748B) 35%,transparent) transparent}.sol-tabs::-webkit-scrollbar{height:4px}.sol-tabs::-webkit-scrollbar-track{background:transparent}.sol-tabs::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--sol-color-text-secondary, #64748B) 35%,transparent);border-radius:var(--sol-border-radius-full, 9999px)}.sol-tabs__tab{position:relative;flex-shrink:0;padding:10px 16px;border:none;background:transparent;font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 12px);font-weight:500;color:var(--sol-color-text-secondary, #64748B);cursor:pointer;transition:color .2s ease,background-color .2s ease;white-space:nowrap;z-index:1}.sol-tabs__tab:hover{color:var(--sol-color-primary, #2563EB);background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active{color:var(--sol-color-primary, #2563EB);font-weight:600;background:color-mix(in srgb,var(--sol-color-primary, #2563EB) 5%,transparent)}.sol-tabs__tab--active:after{content:\"\";position:absolute;bottom:0;left:0;right:0;height:2px;background:var(--sol-color-primary, #2563EB);border-radius:2px 2px 0 0}.sol-tabs__indicator{display:none}\n"] }]
|
|
2021
2163
|
}], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: true }] }], activeTab: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeTab", required: false }] }], tabChange: [{ type: i0.Output, args: ["tabChange"] }] } });
|
|
2022
2164
|
|
|
2023
2165
|
class SolFormFieldComponent {
|
|
@@ -2913,7 +3055,10 @@ const POPOVER_WIDTH$1 = 300;
|
|
|
2913
3055
|
*
|
|
2914
3056
|
* Presentación: un campo de texto de solo lectura con ícono de calendario que,
|
|
2915
3057
|
* al enfocar o hacer clic, abre un popover con posicionamiento manual (arriba
|
|
2916
|
-
* o abajo según el viewport), que cierra con clic-fuera o Escape.
|
|
3058
|
+
* o abajo según el viewport), que cierra con clic-fuera o Escape. El popover
|
|
3059
|
+
* se portalea a `document.body` mediante la directiva compartida
|
|
3060
|
+
* `solFloatingPanel`, de modo que flota por encima de un `sol-modal` o un
|
|
3061
|
+
* `sol-drawer` sin que sus contenedores con `overflow` lo recorten.
|
|
2917
3062
|
*
|
|
2918
3063
|
* API dual: funciona como componente controlado (`value` + `valueChange`) y
|
|
2919
3064
|
* como `ControlValueAccessor` (ngModel / reactive forms). Emite siempre
|
|
@@ -2950,6 +3095,11 @@ class SolDatePickerComponent {
|
|
|
2950
3095
|
// ── Estado interno ──
|
|
2951
3096
|
triggerRef = viewChild('trigger', /* @ts-ignore */
|
|
2952
3097
|
...(ngDevMode ? [{ debugName: "triggerRef" }] : /* istanbul ignore next */ []));
|
|
3098
|
+
/** Popover mientras vive portaleado en document.body (fuera del host). */
|
|
3099
|
+
popRef = viewChild('pop', /* @ts-ignore */
|
|
3100
|
+
...(ngDevMode ? [{ debugName: "popRef" }] : /* istanbul ignore next */ []));
|
|
3101
|
+
/** Alto estimado del popover; umbral de volteo que consume la directiva. */
|
|
3102
|
+
popoverHeight = POPOVER_HEIGHT;
|
|
2953
3103
|
/** Fecha seleccionada canónica (fuente de verdad del display). */
|
|
2954
3104
|
selected = signal(null, /* @ts-ignore */
|
|
2955
3105
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
@@ -3163,15 +3313,24 @@ class SolDatePickerComponent {
|
|
|
3163
3313
|
}
|
|
3164
3314
|
/** Cierra al hacer clic fuera del componente. */
|
|
3165
3315
|
onDocumentClick(event) {
|
|
3166
|
-
if (this.isOpen()
|
|
3316
|
+
if (!this.isOpen())
|
|
3317
|
+
return;
|
|
3318
|
+
const target = event.target;
|
|
3319
|
+
const insideHost = this.hostEl.nativeElement.contains(target);
|
|
3320
|
+
// El popover vive portaleado en document.body: también cuenta como "dentro".
|
|
3321
|
+
const insidePop = this.popRef()?.nativeElement.contains(target) ?? false;
|
|
3322
|
+
if (!insideHost && !insidePop) {
|
|
3167
3323
|
this.close();
|
|
3168
3324
|
}
|
|
3169
3325
|
}
|
|
3170
|
-
/**
|
|
3326
|
+
/**
|
|
3327
|
+
* Decide la alineación horizontal antes de abrir: si el popover no cabe
|
|
3328
|
+
* hacia la derecha del disparador, se ancla por su borde derecho. El eje
|
|
3329
|
+
* vertical (volteo `dropUp`) lo resuelve la directiva `solFloatingPanel`,
|
|
3330
|
+
* que además reposiciona en scroll y resize.
|
|
3331
|
+
*/
|
|
3171
3332
|
positionPopover() {
|
|
3172
3333
|
const rect = this.hostEl.nativeElement.getBoundingClientRect();
|
|
3173
|
-
const spaceBelow = window.innerHeight - rect.bottom;
|
|
3174
|
-
this.dropUp.set(spaceBelow < POPOVER_HEIGHT && rect.top > POPOVER_HEIGHT);
|
|
3175
3334
|
this.alignEnd.set(rect.left + POPOVER_WIDTH$1 > window.innerWidth);
|
|
3176
3335
|
}
|
|
3177
3336
|
// ── Navegación del encabezado ──
|
|
@@ -3326,7 +3485,9 @@ class SolDatePickerComponent {
|
|
|
3326
3485
|
/** Enfoca la celda con foco tras el próximo render (roving tabindex). */
|
|
3327
3486
|
focusActiveCellSoon() {
|
|
3328
3487
|
setTimeout(() => {
|
|
3329
|
-
|
|
3488
|
+
// Se busca dentro del popover, no del host: al portalearse deja de ser
|
|
3489
|
+
// descendiente de `<sol-date-picker>`.
|
|
3490
|
+
const cell = this.popRef()?.nativeElement.querySelector('.sol-date-picker__day.is-focused');
|
|
3330
3491
|
cell?.focus();
|
|
3331
3492
|
});
|
|
3332
3493
|
}
|
|
@@ -3337,10 +3498,11 @@ class SolDatePickerComponent {
|
|
|
3337
3498
|
useExisting: forwardRef(() => SolDatePickerComponent),
|
|
3338
3499
|
multi: true,
|
|
3339
3500
|
},
|
|
3340
|
-
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3501
|
+
], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "popRef", first: true, predicate: ["pop"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
3341
3502
|
<div class="sol-date-picker" [class.sol-date-picker--sm]="size() === 'sm'">
|
|
3342
3503
|
<!-- Campo disparador -->
|
|
3343
3504
|
<div
|
|
3505
|
+
#field
|
|
3344
3506
|
class="sol-date-picker__field"
|
|
3345
3507
|
[class.sol-date-picker__field--open]="isOpen()"
|
|
3346
3508
|
[class.sol-date-picker__field--disabled]="isDisabled()"
|
|
@@ -3374,12 +3536,21 @@ class SolDatePickerComponent {
|
|
|
3374
3536
|
</button>
|
|
3375
3537
|
</div>
|
|
3376
3538
|
|
|
3377
|
-
<!-- Popover
|
|
3539
|
+
<!-- Popover: se portalea a document.body con position:fixed (directiva
|
|
3540
|
+
compartida solFloatingPanel) para que ningún ancestro con overflow
|
|
3541
|
+
o backdrop-filter lo recorte — típicamente .sol-modal-body o el
|
|
3542
|
+
cuerpo de un sol-drawer. Ancho propio (matchTriggerWidth:false) y
|
|
3543
|
+
alineación por el borde derecho cuando no cabe hacia la derecha. -->
|
|
3378
3544
|
@if (isOpen()) {
|
|
3379
3545
|
<div
|
|
3546
|
+
#pop
|
|
3380
3547
|
class="sol-date-picker__pop"
|
|
3548
|
+
[solFloatingPanel]="field"
|
|
3549
|
+
[matchTriggerWidth]="false"
|
|
3550
|
+
[flipThreshold]="popoverHeight"
|
|
3551
|
+
[align]="alignEnd() ? 'end' : 'start'"
|
|
3552
|
+
(dropUpChange)="dropUp.set($event)"
|
|
3381
3553
|
[class.sol-date-picker__pop--up]="dropUp()"
|
|
3382
|
-
[class.sol-date-picker__pop--end]="alignEnd()"
|
|
3383
3554
|
role="dialog"
|
|
3384
3555
|
[attr.aria-label]="dialogAria()"
|
|
3385
3556
|
(keydown)="onPopoverKeydown($event)"
|
|
@@ -3491,11 +3662,11 @@ class SolDatePickerComponent {
|
|
|
3491
3662
|
</div>
|
|
3492
3663
|
}
|
|
3493
3664
|
</div>
|
|
3494
|
-
`, isInline: true, styles: [":host{display:block;--sol-dp-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-dp-text: var(--sol-color-text-primary, #1e293b);--sol-dp-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-dp-border: var(--sol-border-color-default, #cbd5e1);--sol-dp-border-focus: var(--sol-color-primary, #2563eb);--sol-dp-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-dp-border-width: var(--sol-border-width-default, 1px);--sol-dp-height: var(--sol-size-input-height, 2.5rem);--sol-dp-font-size: var(--sol-font-size-base, .875rem);--sol-dp-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .05)));--sol-dp-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #2563eb) 40%, transparent));--sol-dp-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-dp-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-dp-pop-bg: var(--sol-card-bg, var(--sol-bg-surface, #ffffff));--sol-dp-pop-radius: var(--sol-card-radius, var(--sol-border-radius-lg, .75rem));--sol-dp-pop-shadow: var(--sol-card-shadow, var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15)));--sol-dp-primary: var(--sol-color-primary, #2563eb);--sol-dp-hover: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-dp-muted: var(--sol-color-text-muted, #94a3b8)}.sol-date-picker{position:relative;display:block}.sol-date-picker__field{display:flex;align-items:center;width:100%;height:var(--sol-dp-height);background:var(--sol-dp-bg);border:var(--sol-input-border, var(--sol-dp-border-width) solid var(--sol-dp-border));border-radius:var(--sol-dp-radius);box-shadow:var(--sol-dp-shadow);transition:border-color var(--sol-dp-transition),box-shadow var(--sol-dp-transition)}.sol-date-picker--sm .sol-date-picker__field{height:2rem}.sol-date-picker__field--open,.sol-date-picker__field:focus-within{border:var(--sol-input-focus-border, var(--sol-dp-border-width) solid var(--sol-dp-border-focus));box-shadow:var(--sol-dp-focus-ring)}.sol-date-picker__field--disabled{cursor:not-allowed;opacity:var(--sol-dp-disabled-opacity)}.sol-date-picker__input{flex:1;min-width:0;height:100%;padding:0 .5rem 0 var(--sol-space-sm, .75rem);border:none;background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;outline:none}.sol-date-picker--sm .sol-date-picker__input{font-size:var(--sol-font-size-sm, .8125rem)}.sol-date-picker__input::placeholder{color:var(--sol-dp-placeholder)}.sol-date-picker__input:disabled{cursor:not-allowed}.sol-date-picker__trigger-btn{display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0 .5rem;border:none;background:transparent;color:var(--sol-dp-muted);cursor:pointer}.sol-date-picker__trigger-btn:disabled{cursor:not-allowed}.sol-date-picker__pop{position:absolute;top:calc(100% + 4px);left:0;
|
|
3665
|
+
`, isInline: true, styles: [":host,.sol-date-picker__pop{display:block;--sol-dp-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-dp-text: var(--sol-color-text-primary, #1e293b);--sol-dp-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-dp-border: var(--sol-border-color-default, #cbd5e1);--sol-dp-border-focus: var(--sol-color-primary, #2563eb);--sol-dp-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-dp-border-width: var(--sol-border-width-default, 1px);--sol-dp-height: var(--sol-size-input-height, 2.5rem);--sol-dp-font-size: var(--sol-font-size-base, .875rem);--sol-dp-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .05)));--sol-dp-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #2563eb) 40%, transparent));--sol-dp-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-dp-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-dp-pop-bg: var(--sol-card-bg, var(--sol-bg-surface, #ffffff));--sol-dp-pop-radius: var(--sol-card-radius, var(--sol-border-radius-lg, .75rem));--sol-dp-pop-shadow: var(--sol-card-shadow, var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15)));--sol-dp-primary: var(--sol-color-primary, #2563eb);--sol-dp-hover: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-dp-muted: var(--sol-color-text-muted, #94a3b8)}.sol-date-picker{position:relative;display:block}.sol-date-picker__field{display:flex;align-items:center;width:100%;height:var(--sol-dp-height);background:var(--sol-dp-bg);border:var(--sol-input-border, var(--sol-dp-border-width) solid var(--sol-dp-border));border-radius:var(--sol-dp-radius);box-shadow:var(--sol-dp-shadow);transition:border-color var(--sol-dp-transition),box-shadow var(--sol-dp-transition)}.sol-date-picker--sm .sol-date-picker__field{height:2rem}.sol-date-picker__field--open,.sol-date-picker__field:focus-within{border:var(--sol-input-focus-border, var(--sol-dp-border-width) solid var(--sol-dp-border-focus));box-shadow:var(--sol-dp-focus-ring)}.sol-date-picker__field--disabled{cursor:not-allowed;opacity:var(--sol-dp-disabled-opacity)}.sol-date-picker__input{flex:1;min-width:0;height:100%;padding:0 .5rem 0 var(--sol-space-sm, .75rem);border:none;background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;outline:none}.sol-date-picker--sm .sol-date-picker__input{font-size:var(--sol-font-size-sm, .8125rem)}.sol-date-picker__input::placeholder{color:var(--sol-dp-placeholder)}.sol-date-picker__input:disabled{cursor:not-allowed}.sol-date-picker__trigger-btn{display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0 .5rem;border:none;background:transparent;color:var(--sol-dp-muted);cursor:pointer}.sol-date-picker__trigger-btn:disabled{cursor:not-allowed}.sol-date-picker__pop{position:absolute;top:calc(100% + 4px);left:0;width:300px;max-width:calc(100vw - 24px);padding:.625rem;background:var(--sol-dp-pop-bg);border:var(--sol-dp-border-width) solid var(--sol-dp-border);border-radius:var(--sol-dp-pop-radius);box-shadow:var(--sol-dp-pop-shadow);animation:sol-dp-fade var(--sol-dur-fast, .15s) var(--sol-ease, ease-out)}.sol-date-picker__pop--up{top:auto;bottom:calc(100% + 4px)}.sol-date-picker__header{display:flex;align-items:center;justify-content:space-between;gap:.25rem;margin-bottom:.5rem}.sol-date-picker__nav{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);cursor:pointer;transition:background var(--sol-dp-transition)}.sol-date-picker__nav:hover{background:var(--sol-dp-hover)}.sol-date-picker__title{flex:1;height:2rem;border:none;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);font-weight:var(--sol-font-weight-bold, 600);cursor:pointer;transition:background var(--sol-dp-transition)}.sol-date-picker__title:hover:not(:disabled){background:var(--sol-dp-hover)}.sol-date-picker__title:disabled{cursor:default}.sol-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.sol-date-picker__weekday{text-align:center;font-size:var(--sol-font-size-sm, .75rem);font-weight:500;color:var(--sol-dp-muted);padding:.25rem 0}.sol-date-picker__grid{display:flex;flex-direction:column;gap:2px}.sol-date-picker__row{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.sol-date-picker__day{display:inline-flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;width:100%;border:1px solid transparent;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;transition:background var(--sol-dp-transition),color var(--sol-dp-transition),border-color var(--sol-dp-transition)}.sol-date-picker__day:hover:not(:disabled):not(.is-selected){background:var(--sol-dp-hover)}.sol-date-picker__day.is-outside{color:var(--sol-dp-muted);opacity:.6}.sol-date-picker__day.is-today:not(.is-selected){border-color:var(--sol-dp-primary);font-weight:600}.sol-date-picker__day.is-selected{background:var(--sol-dp-primary);border-color:var(--sol-dp-primary);color:#fff;font-weight:600}.sol-date-picker__day.is-focused:not(.is-selected){outline:2px solid var(--sol-dp-primary);outline-offset:-2px}.sol-date-picker__day:disabled{opacity:.3;cursor:not-allowed}.sol-date-picker__cells{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.sol-date-picker__cell{display:inline-flex;align-items:center;justify-content:center;height:3rem;border:1px solid transparent;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;transition:background var(--sol-dp-transition),color var(--sol-dp-transition),border-color var(--sol-dp-transition)}.sol-date-picker__cell:hover:not(:disabled):not(.is-selected){background:var(--sol-dp-hover)}.sol-date-picker__cell.is-outside{color:var(--sol-dp-muted);opacity:.6}.sol-date-picker__cell.is-today:not(.is-selected){border-color:var(--sol-dp-primary);font-weight:600}.sol-date-picker__cell.is-selected{background:var(--sol-dp-primary);border-color:var(--sol-dp-primary);color:#fff;font-weight:600}.sol-date-picker__cell:disabled{opacity:.3;cursor:not-allowed}@keyframes sol-dp-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.sol-date-picker__pop--up{animation-name:sol-dp-fade-up}@keyframes sol-dp-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.sol-date-picker__pop{animation:none}}@media(max-width:640px){.sol-date-picker__input,.sol-date-picker--sm .sol-date-picker__input{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 });
|
|
3495
3666
|
}
|
|
3496
3667
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolDatePickerComponent, decorators: [{
|
|
3497
3668
|
type: Component,
|
|
3498
|
-
args: [{ selector: 'sol-date-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent], providers: [
|
|
3669
|
+
args: [{ selector: 'sol-date-picker', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent, SolFloatingPanelDirective], providers: [
|
|
3499
3670
|
{
|
|
3500
3671
|
provide: NG_VALUE_ACCESSOR,
|
|
3501
3672
|
useExisting: forwardRef(() => SolDatePickerComponent),
|
|
@@ -3505,6 +3676,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3505
3676
|
<div class="sol-date-picker" [class.sol-date-picker--sm]="size() === 'sm'">
|
|
3506
3677
|
<!-- Campo disparador -->
|
|
3507
3678
|
<div
|
|
3679
|
+
#field
|
|
3508
3680
|
class="sol-date-picker__field"
|
|
3509
3681
|
[class.sol-date-picker__field--open]="isOpen()"
|
|
3510
3682
|
[class.sol-date-picker__field--disabled]="isDisabled()"
|
|
@@ -3538,12 +3710,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3538
3710
|
</button>
|
|
3539
3711
|
</div>
|
|
3540
3712
|
|
|
3541
|
-
<!-- Popover
|
|
3713
|
+
<!-- Popover: se portalea a document.body con position:fixed (directiva
|
|
3714
|
+
compartida solFloatingPanel) para que ningún ancestro con overflow
|
|
3715
|
+
o backdrop-filter lo recorte — típicamente .sol-modal-body o el
|
|
3716
|
+
cuerpo de un sol-drawer. Ancho propio (matchTriggerWidth:false) y
|
|
3717
|
+
alineación por el borde derecho cuando no cabe hacia la derecha. -->
|
|
3542
3718
|
@if (isOpen()) {
|
|
3543
3719
|
<div
|
|
3720
|
+
#pop
|
|
3544
3721
|
class="sol-date-picker__pop"
|
|
3722
|
+
[solFloatingPanel]="field"
|
|
3723
|
+
[matchTriggerWidth]="false"
|
|
3724
|
+
[flipThreshold]="popoverHeight"
|
|
3725
|
+
[align]="alignEnd() ? 'end' : 'start'"
|
|
3726
|
+
(dropUpChange)="dropUp.set($event)"
|
|
3545
3727
|
[class.sol-date-picker__pop--up]="dropUp()"
|
|
3546
|
-
[class.sol-date-picker__pop--end]="alignEnd()"
|
|
3547
3728
|
role="dialog"
|
|
3548
3729
|
[attr.aria-label]="dialogAria()"
|
|
3549
3730
|
(keydown)="onPopoverKeydown($event)"
|
|
@@ -3655,8 +3836,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
3655
3836
|
</div>
|
|
3656
3837
|
}
|
|
3657
3838
|
</div>
|
|
3658
|
-
`, styles: [":host{display:block;--sol-dp-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-dp-text: var(--sol-color-text-primary, #1e293b);--sol-dp-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-dp-border: var(--sol-border-color-default, #cbd5e1);--sol-dp-border-focus: var(--sol-color-primary, #2563eb);--sol-dp-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-dp-border-width: var(--sol-border-width-default, 1px);--sol-dp-height: var(--sol-size-input-height, 2.5rem);--sol-dp-font-size: var(--sol-font-size-base, .875rem);--sol-dp-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .05)));--sol-dp-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #2563eb) 40%, transparent));--sol-dp-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-dp-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-dp-pop-bg: var(--sol-card-bg, var(--sol-bg-surface, #ffffff));--sol-dp-pop-radius: var(--sol-card-radius, var(--sol-border-radius-lg, .75rem));--sol-dp-pop-shadow: var(--sol-card-shadow, var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15)));--sol-dp-primary: var(--sol-color-primary, #2563eb);--sol-dp-hover: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-dp-muted: var(--sol-color-text-muted, #94a3b8)}.sol-date-picker{position:relative;display:block}.sol-date-picker__field{display:flex;align-items:center;width:100%;height:var(--sol-dp-height);background:var(--sol-dp-bg);border:var(--sol-input-border, var(--sol-dp-border-width) solid var(--sol-dp-border));border-radius:var(--sol-dp-radius);box-shadow:var(--sol-dp-shadow);transition:border-color var(--sol-dp-transition),box-shadow var(--sol-dp-transition)}.sol-date-picker--sm .sol-date-picker__field{height:2rem}.sol-date-picker__field--open,.sol-date-picker__field:focus-within{border:var(--sol-input-focus-border, var(--sol-dp-border-width) solid var(--sol-dp-border-focus));box-shadow:var(--sol-dp-focus-ring)}.sol-date-picker__field--disabled{cursor:not-allowed;opacity:var(--sol-dp-disabled-opacity)}.sol-date-picker__input{flex:1;min-width:0;height:100%;padding:0 .5rem 0 var(--sol-space-sm, .75rem);border:none;background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;outline:none}.sol-date-picker--sm .sol-date-picker__input{font-size:var(--sol-font-size-sm, .8125rem)}.sol-date-picker__input::placeholder{color:var(--sol-dp-placeholder)}.sol-date-picker__input:disabled{cursor:not-allowed}.sol-date-picker__trigger-btn{display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0 .5rem;border:none;background:transparent;color:var(--sol-dp-muted);cursor:pointer}.sol-date-picker__trigger-btn:disabled{cursor:not-allowed}.sol-date-picker__pop{position:absolute;top:calc(100% + 4px);left:0;
|
|
3659
|
-
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], onDocumentClick: [{
|
|
3839
|
+
`, styles: [":host,.sol-date-picker__pop{display:block;--sol-dp-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-dp-text: var(--sol-color-text-primary, #1e293b);--sol-dp-placeholder: var(--sol-color-text-muted, #94a3b8);--sol-dp-border: var(--sol-border-color-default, #cbd5e1);--sol-dp-border-focus: var(--sol-color-primary, #2563eb);--sol-dp-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-dp-border-width: var(--sol-border-width-default, 1px);--sol-dp-height: var(--sol-size-input-height, 2.5rem);--sol-dp-font-size: var(--sol-font-size-base, .875rem);--sol-dp-shadow: var(--sol-input-shadow, var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .05)));--sol-dp-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #2563eb) 40%, transparent));--sol-dp-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease);--sol-dp-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-dp-pop-bg: var(--sol-card-bg, var(--sol-bg-surface, #ffffff));--sol-dp-pop-radius: var(--sol-card-radius, var(--sol-border-radius-lg, .75rem));--sol-dp-pop-shadow: var(--sol-card-shadow, var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15)));--sol-dp-primary: var(--sol-color-primary, #2563eb);--sol-dp-hover: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-dp-muted: var(--sol-color-text-muted, #94a3b8)}.sol-date-picker{position:relative;display:block}.sol-date-picker__field{display:flex;align-items:center;width:100%;height:var(--sol-dp-height);background:var(--sol-dp-bg);border:var(--sol-input-border, var(--sol-dp-border-width) solid var(--sol-dp-border));border-radius:var(--sol-dp-radius);box-shadow:var(--sol-dp-shadow);transition:border-color var(--sol-dp-transition),box-shadow var(--sol-dp-transition)}.sol-date-picker--sm .sol-date-picker__field{height:2rem}.sol-date-picker__field--open,.sol-date-picker__field:focus-within{border:var(--sol-input-focus-border, var(--sol-dp-border-width) solid var(--sol-dp-border-focus));box-shadow:var(--sol-dp-focus-ring)}.sol-date-picker__field--disabled{cursor:not-allowed;opacity:var(--sol-dp-disabled-opacity)}.sol-date-picker__input{flex:1;min-width:0;height:100%;padding:0 .5rem 0 var(--sol-space-sm, .75rem);border:none;background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;outline:none}.sol-date-picker--sm .sol-date-picker__input{font-size:var(--sol-font-size-sm, .8125rem)}.sol-date-picker__input::placeholder{color:var(--sol-dp-placeholder)}.sol-date-picker__input:disabled{cursor:not-allowed}.sol-date-picker__trigger-btn{display:inline-flex;align-items:center;justify-content:center;height:100%;padding:0 .5rem;border:none;background:transparent;color:var(--sol-dp-muted);cursor:pointer}.sol-date-picker__trigger-btn:disabled{cursor:not-allowed}.sol-date-picker__pop{position:absolute;top:calc(100% + 4px);left:0;width:300px;max-width:calc(100vw - 24px);padding:.625rem;background:var(--sol-dp-pop-bg);border:var(--sol-dp-border-width) solid var(--sol-dp-border);border-radius:var(--sol-dp-pop-radius);box-shadow:var(--sol-dp-pop-shadow);animation:sol-dp-fade var(--sol-dur-fast, .15s) var(--sol-ease, ease-out)}.sol-date-picker__pop--up{top:auto;bottom:calc(100% + 4px)}.sol-date-picker__header{display:flex;align-items:center;justify-content:space-between;gap:.25rem;margin-bottom:.5rem}.sol-date-picker__nav{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);cursor:pointer;transition:background var(--sol-dp-transition)}.sol-date-picker__nav:hover{background:var(--sol-dp-hover)}.sol-date-picker__title{flex:1;height:2rem;border:none;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);font-weight:var(--sol-font-weight-bold, 600);cursor:pointer;transition:background var(--sol-dp-transition)}.sol-date-picker__title:hover:not(:disabled){background:var(--sol-dp-hover)}.sol-date-picker__title:disabled{cursor:default}.sol-date-picker__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:.25rem}.sol-date-picker__weekday{text-align:center;font-size:var(--sol-font-size-sm, .75rem);font-weight:500;color:var(--sol-dp-muted);padding:.25rem 0}.sol-date-picker__grid{display:flex;flex-direction:column;gap:2px}.sol-date-picker__row{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.sol-date-picker__day{display:inline-flex;align-items:center;justify-content:center;aspect-ratio:1 / 1;width:100%;border:1px solid transparent;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;transition:background var(--sol-dp-transition),color var(--sol-dp-transition),border-color var(--sol-dp-transition)}.sol-date-picker__day:hover:not(:disabled):not(.is-selected){background:var(--sol-dp-hover)}.sol-date-picker__day.is-outside{color:var(--sol-dp-muted);opacity:.6}.sol-date-picker__day.is-today:not(.is-selected){border-color:var(--sol-dp-primary);font-weight:600}.sol-date-picker__day.is-selected{background:var(--sol-dp-primary);border-color:var(--sol-dp-primary);color:#fff;font-weight:600}.sol-date-picker__day.is-focused:not(.is-selected){outline:2px solid var(--sol-dp-primary);outline-offset:-2px}.sol-date-picker__day:disabled{opacity:.3;cursor:not-allowed}.sol-date-picker__cells{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.sol-date-picker__cell{display:inline-flex;align-items:center;justify-content:center;height:3rem;border:1px solid transparent;border-radius:var(--sol-border-radius-md, .5rem);background:transparent;color:var(--sol-dp-text);font-family:inherit;font-size:var(--sol-dp-font-size);cursor:pointer;transition:background var(--sol-dp-transition),color var(--sol-dp-transition),border-color var(--sol-dp-transition)}.sol-date-picker__cell:hover:not(:disabled):not(.is-selected){background:var(--sol-dp-hover)}.sol-date-picker__cell.is-outside{color:var(--sol-dp-muted);opacity:.6}.sol-date-picker__cell.is-today:not(.is-selected){border-color:var(--sol-dp-primary);font-weight:600}.sol-date-picker__cell.is-selected{background:var(--sol-dp-primary);border-color:var(--sol-dp-primary);color:#fff;font-weight:600}.sol-date-picker__cell:disabled{opacity:.3;cursor:not-allowed}@keyframes sol-dp-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.sol-date-picker__pop--up{animation-name:sol-dp-fade-up}@keyframes sol-dp-fade-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.sol-date-picker__pop{animation:none}}@media(max-width:640px){.sol-date-picker__input,.sol-date-picker--sm .sol-date-picker__input{font-size:16px}}\n"] }]
|
|
3840
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], triggerRef: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], popRef: [{ type: i0.ViewChild, args: ['pop', { isSignal: true }] }], onDocumentClick: [{
|
|
3660
3841
|
type: HostListener,
|
|
3661
3842
|
args: ['document:click', ['$event']]
|
|
3662
3843
|
}] } });
|
|
@@ -7932,7 +8113,7 @@ class SolRichEditorComponent {
|
|
|
7932
8113
|
(change)="onFileSelected($event)" tabindex="-1" aria-hidden="true"
|
|
7933
8114
|
/>
|
|
7934
8115
|
</div>
|
|
7935
|
-
`, isInline: true, styles: [":host{display:block;--sre-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sre-text: var(--sol-color-text-primary, #1e293b);--sre-muted: var(--sol-color-text-muted, #94a3b8);--sre-border: var(--sol-border-color-default, #cbd5e1);--sre-border-focus: var(--sol-color-primary, #6366f1);--sre-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sre-toolbar-bg: var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));--sre-btn-hover: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sre-btn-active: color-mix(in srgb, var(--sol-color-primary, #6366f1) 18%, transparent);--sre-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 30%, transparent));--sre-font: var(--sol-font-family, system-ui, sans-serif);--sre-font-size: var(--sol-font-size-base, .9375rem);--sre-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-rich-editor{position:relative;display:flex;flex-direction:column;border:var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sre-border));border-radius:var(--sre-radius);background:var(--sre-bg);box-shadow:var(--sol-input-shadow, none);
|
|
8116
|
+
`, isInline: true, styles: [":host{display:block;--sre-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sre-text: var(--sol-color-text-primary, #1e293b);--sre-muted: var(--sol-color-text-muted, #94a3b8);--sre-border: var(--sol-border-color-default, #cbd5e1);--sre-border-focus: var(--sol-color-primary, #6366f1);--sre-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sre-toolbar-bg: var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));--sre-btn-hover: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sre-btn-active: color-mix(in srgb, var(--sol-color-primary, #6366f1) 18%, transparent);--sre-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 30%, transparent));--sre-font: var(--sol-font-family, system-ui, sans-serif);--sre-font-size: var(--sol-font-size-base, .9375rem);--sre-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-rich-editor{position:relative;display:flex;flex-direction:column;border:var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sre-border));border-radius:var(--sre-radius);background:var(--sre-bg);box-shadow:var(--sol-input-shadow, none);transition:border-color var(--sre-transition),box-shadow var(--sre-transition)}.sol-rich-editor:focus-within{border-color:var(--sre-border-focus);box-shadow:var(--sre-focus-ring)}.sol-rich-editor--disabled{opacity:var(--sol-disabled-opacity, .55)}.sol-rich-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.125rem;padding:.375rem .5rem;background:var(--sre-toolbar-bg);border-bottom:1px solid var(--sre-border);border-radius:calc(var(--sre-radius) - 1px) calc(var(--sre-radius) - 1px) 0 0}.sol-rich-editor__group{display:flex;align-items:center;gap:.125rem}.sol-rich-editor__group--menu{position:relative;display:inline-flex}.sol-rich-editor__sep{width:1px;align-self:stretch;margin:.125rem .25rem;background:var(--sre-border)}.sol-rich-editor__btn{display:inline-flex;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;padding:0;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);cursor:pointer;transition:background-color var(--sre-transition),color var(--sre-transition)}.sol-rich-editor__btn:hover:not(:disabled){background:var(--sre-btn-hover)}.sol-rich-editor__btn:focus-visible{outline:2px solid var(--sre-border-focus);outline-offset:1px}.sol-rich-editor__btn.is-active{background:var(--sre-btn-active);color:var(--sol-color-primary, #6366f1)}.sol-rich-editor__btn:disabled{cursor:not-allowed;opacity:.5}.sol-rich-editor__menu{position:absolute;top:calc(100% + .25rem);left:0;z-index:var(--sol-z-dropdown, 1000);min-width:9rem;padding:.25rem;background:var(--sol-bg-surface, #ffffff);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-md, .5rem);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .12))}.sol-rich-editor__menu-item{display:block;width:100%;padding:.375rem .625rem;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);text-align:left;cursor:pointer}.sol-rich-editor__menu-item:hover{background:var(--sre-btn-hover)}.sol-rich-editor__menu-item--h1{font-size:1.375rem;font-weight:700}.sol-rich-editor__menu-item--h2{font-size:1.125rem;font-weight:700}.sol-rich-editor__menu-item--h3{font-size:1rem;font-weight:600}.sol-rich-editor__menu--table{min-width:auto}.sol-rich-editor__grid{display:flex;flex-direction:column;gap:2px}.sol-rich-editor__grid-row{display:flex;gap:2px}.sol-rich-editor__grid-cell{width:1rem;height:1rem;padding:0;border:1px solid var(--sre-border);border-radius:2px;background:var(--sol-bg-surface, #ffffff);cursor:pointer}.sol-rich-editor__grid-cell.is-on{background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 45%,transparent);border-color:var(--sol-color-primary, #6366f1)}.sol-rich-editor__grid-label{margin-top:.375rem;text-align:center;font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);color:var(--sre-muted)}.sol-rich-editor__menu--link{min-width:15rem}.sol-rich-editor__link-input{width:100%;height:var(--sol-size-input-height, 2.25rem);padding:0 .5rem;font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);color:var(--sre-text);background:var(--sre-bg);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-sm, .375rem);outline:none;box-sizing:border-box}.sol-rich-editor__link-input:focus{border-color:var(--sre-border-focus)}.sol-rich-editor__link-actions{display:flex;gap:.375rem;margin-top:.375rem}.sol-rich-editor__link-btn{flex:1;padding:.375rem .5rem;border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);cursor:pointer}.sol-rich-editor__link-btn:hover{background:var(--sre-btn-hover)}.sol-rich-editor__link-btn--primary{background:var(--sol-color-primary, #6366f1);border-color:var(--sol-color-primary, #6366f1);color:var(--sol-color-primary-contrast, #ffffff)}.sol-rich-editor__content{flex:1;padding:.75rem .875rem;overflow-y:auto;border-radius:0 0 calc(var(--sre-radius) - 1px) calc(var(--sre-radius) - 1px);font-family:var(--sre-font);font-size:var(--sre-font-size);line-height:var(--sol-line-height, 1.6);color:var(--sre-text);outline:none;word-break:break-word}.sol-rich-editor__content.is-empty:before{content:attr(data-placeholder);color:var(--sre-muted);pointer-events:none}.sol-rich-editor__error{margin:0;padding:.375rem .875rem;font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);color:var(--sol-color-danger, #ef4444)}.sol-rich-editor__file{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sol-rich-editor__popover{position:absolute;z-index:var(--sol-z-dropdown, 1000);min-width:12rem;max-width:18rem;max-height:14rem;overflow-y:auto;padding:.25rem;background:var(--sol-bg-surface, #ffffff);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-md, .5rem);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .12))}.sol-rich-editor__popover--task{min-width:16rem}.sol-rich-editor__popover-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.375rem .5rem;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);text-align:left;cursor:pointer}.sol-rich-editor__popover-item:hover,.sol-rich-editor__popover-item.is-active{background:var(--sre-btn-hover)}.sol-rich-editor__popover-label{flex:1;min-width:0}.sol-rich-editor__popover-label--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-rich-editor__avatar{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:9999px;background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 20%,transparent);color:var(--sol-color-primary, #6366f1);font-size:var(--sol-font-size-sm, .75rem);font-weight:600}.sol-rich-editor__task-key{flex-shrink:0;padding:.0625rem .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-success, #10b981) 14%,transparent);color:var(--sol-color-success, #10b981);font-family:var(--sol-font-family-mono, ui-monospace, monospace);font-size:var(--sol-font-size-sm, .75rem);font-weight:600}.sol-rich-editor__content ::ng-deep span[data-mention-id]{display:inline-block;padding:0 .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 12%,transparent);color:var(--sol-color-primary, #6366f1);font-weight:500;white-space:nowrap}.sol-rich-editor__content ::ng-deep span[data-task-key]{display:inline-block;padding:0 .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-success, #10b981) 14%,transparent);color:var(--sol-color-success, #10b981);font-family:var(--sol-font-family-mono, ui-monospace, monospace);font-weight:600;white-space:nowrap}.sol-rich-editor__content ::ng-deep h1{font-size:1.5rem;font-weight:700;margin:.5rem 0;line-height:1.25}.sol-rich-editor__content ::ng-deep h2{font-size:1.25rem;font-weight:700;margin:.5rem 0;line-height:1.3}.sol-rich-editor__content ::ng-deep h3{font-size:1.0625rem;font-weight:600;margin:.5rem 0;line-height:1.35}.sol-rich-editor__content ::ng-deep p{margin:0 0 .5rem}.sol-rich-editor__content ::ng-deep ul,.sol-rich-editor__content ::ng-deep ol{margin:0 0 .5rem;padding-left:1.5rem}.sol-rich-editor__content ::ng-deep li{margin:.125rem 0}.sol-rich-editor__content ::ng-deep a{color:var(--sol-color-primary, #6366f1);text-decoration:underline}.sol-rich-editor__content ::ng-deep img{max-width:100%;height:auto;border-radius:var(--sol-border-radius-sm, .375rem)}.sol-rich-editor__content ::ng-deep table{border-collapse:collapse;margin:.5rem 0;width:auto}.sol-rich-editor__content ::ng-deep td,.sol-rich-editor__content ::ng-deep th{border:1px solid var(--sre-border);padding:.375rem .5rem;min-width:3rem}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7936
8117
|
}
|
|
7937
8118
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolRichEditorComponent, decorators: [{
|
|
7938
8119
|
type: Component,
|
|
@@ -8191,7 +8372,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
8191
8372
|
(change)="onFileSelected($event)" tabindex="-1" aria-hidden="true"
|
|
8192
8373
|
/>
|
|
8193
8374
|
</div>
|
|
8194
|
-
`, styles: [":host{display:block;--sre-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sre-text: var(--sol-color-text-primary, #1e293b);--sre-muted: var(--sol-color-text-muted, #94a3b8);--sre-border: var(--sol-border-color-default, #cbd5e1);--sre-border-focus: var(--sol-color-primary, #6366f1);--sre-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sre-toolbar-bg: var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));--sre-btn-hover: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sre-btn-active: color-mix(in srgb, var(--sol-color-primary, #6366f1) 18%, transparent);--sre-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 30%, transparent));--sre-font: var(--sol-font-family, system-ui, sans-serif);--sre-font-size: var(--sol-font-size-base, .9375rem);--sre-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-rich-editor{position:relative;display:flex;flex-direction:column;border:var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sre-border));border-radius:var(--sre-radius);background:var(--sre-bg);box-shadow:var(--sol-input-shadow, none);
|
|
8375
|
+
`, styles: [":host{display:block;--sre-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sre-text: var(--sol-color-text-primary, #1e293b);--sre-muted: var(--sol-color-text-muted, #94a3b8);--sre-border: var(--sol-border-color-default, #cbd5e1);--sre-border-focus: var(--sol-color-primary, #6366f1);--sre-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sre-toolbar-bg: var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));--sre-btn-hover: color-mix(in srgb, var(--sol-color-primary, #6366f1) 12%, transparent);--sre-btn-active: color-mix(in srgb, var(--sol-color-primary, #6366f1) 18%, transparent);--sre-focus-ring: var(--sol-input-focus-ring, 0 0 0 3px color-mix(in srgb, var(--sol-color-primary, #6366f1) 30%, transparent));--sre-font: var(--sol-font-family, system-ui, sans-serif);--sre-font-size: var(--sol-font-size-base, .9375rem);--sre-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-rich-editor{position:relative;display:flex;flex-direction:column;border:var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sre-border));border-radius:var(--sre-radius);background:var(--sre-bg);box-shadow:var(--sol-input-shadow, none);transition:border-color var(--sre-transition),box-shadow var(--sre-transition)}.sol-rich-editor:focus-within{border-color:var(--sre-border-focus);box-shadow:var(--sre-focus-ring)}.sol-rich-editor--disabled{opacity:var(--sol-disabled-opacity, .55)}.sol-rich-editor__toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.125rem;padding:.375rem .5rem;background:var(--sre-toolbar-bg);border-bottom:1px solid var(--sre-border);border-radius:calc(var(--sre-radius) - 1px) calc(var(--sre-radius) - 1px) 0 0}.sol-rich-editor__group{display:flex;align-items:center;gap:.125rem}.sol-rich-editor__group--menu{position:relative;display:inline-flex}.sol-rich-editor__sep{width:1px;align-self:stretch;margin:.125rem .25rem;background:var(--sre-border)}.sol-rich-editor__btn{display:inline-flex;align-items:center;justify-content:center;width:1.875rem;height:1.875rem;padding:0;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);cursor:pointer;transition:background-color var(--sre-transition),color var(--sre-transition)}.sol-rich-editor__btn:hover:not(:disabled){background:var(--sre-btn-hover)}.sol-rich-editor__btn:focus-visible{outline:2px solid var(--sre-border-focus);outline-offset:1px}.sol-rich-editor__btn.is-active{background:var(--sre-btn-active);color:var(--sol-color-primary, #6366f1)}.sol-rich-editor__btn:disabled{cursor:not-allowed;opacity:.5}.sol-rich-editor__menu{position:absolute;top:calc(100% + .25rem);left:0;z-index:var(--sol-z-dropdown, 1000);min-width:9rem;padding:.25rem;background:var(--sol-bg-surface, #ffffff);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-md, .5rem);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .12))}.sol-rich-editor__menu-item{display:block;width:100%;padding:.375rem .625rem;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);text-align:left;cursor:pointer}.sol-rich-editor__menu-item:hover{background:var(--sre-btn-hover)}.sol-rich-editor__menu-item--h1{font-size:1.375rem;font-weight:700}.sol-rich-editor__menu-item--h2{font-size:1.125rem;font-weight:700}.sol-rich-editor__menu-item--h3{font-size:1rem;font-weight:600}.sol-rich-editor__menu--table{min-width:auto}.sol-rich-editor__grid{display:flex;flex-direction:column;gap:2px}.sol-rich-editor__grid-row{display:flex;gap:2px}.sol-rich-editor__grid-cell{width:1rem;height:1rem;padding:0;border:1px solid var(--sre-border);border-radius:2px;background:var(--sol-bg-surface, #ffffff);cursor:pointer}.sol-rich-editor__grid-cell.is-on{background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 45%,transparent);border-color:var(--sol-color-primary, #6366f1)}.sol-rich-editor__grid-label{margin-top:.375rem;text-align:center;font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);color:var(--sre-muted)}.sol-rich-editor__menu--link{min-width:15rem}.sol-rich-editor__link-input{width:100%;height:var(--sol-size-input-height, 2.25rem);padding:0 .5rem;font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);color:var(--sre-text);background:var(--sre-bg);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-sm, .375rem);outline:none;box-sizing:border-box}.sol-rich-editor__link-input:focus{border-color:var(--sre-border-focus)}.sol-rich-editor__link-actions{display:flex;gap:.375rem;margin-top:.375rem}.sol-rich-editor__link-btn{flex:1;padding:.375rem .5rem;border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);cursor:pointer}.sol-rich-editor__link-btn:hover{background:var(--sre-btn-hover)}.sol-rich-editor__link-btn--primary{background:var(--sol-color-primary, #6366f1);border-color:var(--sol-color-primary, #6366f1);color:var(--sol-color-primary-contrast, #ffffff)}.sol-rich-editor__content{flex:1;padding:.75rem .875rem;overflow-y:auto;border-radius:0 0 calc(var(--sre-radius) - 1px) calc(var(--sre-radius) - 1px);font-family:var(--sre-font);font-size:var(--sre-font-size);line-height:var(--sol-line-height, 1.6);color:var(--sre-text);outline:none;word-break:break-word}.sol-rich-editor__content.is-empty:before{content:attr(data-placeholder);color:var(--sre-muted);pointer-events:none}.sol-rich-editor__error{margin:0;padding:.375rem .875rem;font-family:var(--sre-font);font-size:var(--sol-font-size-sm, .75rem);color:var(--sol-color-danger, #ef4444)}.sol-rich-editor__file{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sol-rich-editor__popover{position:absolute;z-index:var(--sol-z-dropdown, 1000);min-width:12rem;max-width:18rem;max-height:14rem;overflow-y:auto;padding:.25rem;background:var(--sol-bg-surface, #ffffff);border:1px solid var(--sre-border);border-radius:var(--sol-border-radius-md, .5rem);box-shadow:var(--sol-shadow-lg, 0 10px 25px rgba(0, 0, 0, .12))}.sol-rich-editor__popover--task{min-width:16rem}.sol-rich-editor__popover-item{display:flex;align-items:center;gap:.5rem;width:100%;padding:.375rem .5rem;border:none;border-radius:var(--sol-border-radius-sm, .375rem);background:transparent;color:var(--sre-text);font-family:var(--sre-font);font-size:var(--sol-font-size-base, .9375rem);text-align:left;cursor:pointer}.sol-rich-editor__popover-item:hover,.sol-rich-editor__popover-item.is-active{background:var(--sre-btn-hover)}.sol-rich-editor__popover-label{flex:1;min-width:0}.sol-rich-editor__popover-label--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sol-rich-editor__avatar{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;flex-shrink:0;border-radius:9999px;background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 20%,transparent);color:var(--sol-color-primary, #6366f1);font-size:var(--sol-font-size-sm, .75rem);font-weight:600}.sol-rich-editor__task-key{flex-shrink:0;padding:.0625rem .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-success, #10b981) 14%,transparent);color:var(--sol-color-success, #10b981);font-family:var(--sol-font-family-mono, ui-monospace, monospace);font-size:var(--sol-font-size-sm, .75rem);font-weight:600}.sol-rich-editor__content ::ng-deep span[data-mention-id]{display:inline-block;padding:0 .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-primary, #6366f1) 12%,transparent);color:var(--sol-color-primary, #6366f1);font-weight:500;white-space:nowrap}.sol-rich-editor__content ::ng-deep span[data-task-key]{display:inline-block;padding:0 .375rem;border-radius:var(--sol-border-radius-sm, .375rem);background:color-mix(in srgb,var(--sol-color-success, #10b981) 14%,transparent);color:var(--sol-color-success, #10b981);font-family:var(--sol-font-family-mono, ui-monospace, monospace);font-weight:600;white-space:nowrap}.sol-rich-editor__content ::ng-deep h1{font-size:1.5rem;font-weight:700;margin:.5rem 0;line-height:1.25}.sol-rich-editor__content ::ng-deep h2{font-size:1.25rem;font-weight:700;margin:.5rem 0;line-height:1.3}.sol-rich-editor__content ::ng-deep h3{font-size:1.0625rem;font-weight:600;margin:.5rem 0;line-height:1.35}.sol-rich-editor__content ::ng-deep p{margin:0 0 .5rem}.sol-rich-editor__content ::ng-deep ul,.sol-rich-editor__content ::ng-deep ol{margin:0 0 .5rem;padding-left:1.5rem}.sol-rich-editor__content ::ng-deep li{margin:.125rem 0}.sol-rich-editor__content ::ng-deep a{color:var(--sol-color-primary, #6366f1);text-decoration:underline}.sol-rich-editor__content ::ng-deep img{max-width:100%;height:auto;border-radius:var(--sol-border-radius-sm, .375rem)}.sol-rich-editor__content ::ng-deep table{border-collapse:collapse;margin:.5rem 0;width:auto}.sol-rich-editor__content ::ng-deep td,.sol-rich-editor__content ::ng-deep th{border:1px solid var(--sre-border);padding:.375rem .5rem;min-width:3rem}\n"] }]
|
|
8195
8376
|
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], minHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minHeight", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], imageMaxBytes: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageMaxBytes", required: false }] }], imageUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUpload", required: false }] }], mentionableUsers: [{ type: i0.Input, args: [{ isSignal: true, alias: "mentionableUsers", required: false }] }], linkableTasks: [{ type: i0.Input, args: [{ isSignal: true, alias: "linkableTasks", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], mentionsChange: [{ type: i0.Output, args: ["mentionsChange"] }], taskLinksChange: [{ type: i0.Output, args: ["taskLinksChange"] }], editable: [{ type: i0.ViewChild, args: ['editable', { isSignal: true }] }], fileInput: [{ type: i0.ViewChild, args: ['fileInput', { isSignal: true }] }], linkInput: [{ type: i0.ViewChild, args: ['linkInput', { isSignal: true }] }] } });
|
|
8196
8377
|
|
|
8197
8378
|
/**
|
|
@@ -8280,6 +8461,17 @@ class SolIconButtonComponent {
|
|
|
8280
8461
|
/** Clases CSS combinando variante y tamaño. */
|
|
8281
8462
|
cssClass = computed(() => `sol-icon-btn sol-icon-btn--${this.variant()} sol-icon-btn--${this.size()}`, /* @ts-ignore */
|
|
8282
8463
|
...(ngDevMode ? [{ debugName: "cssClass" }] : /* istanbul ignore next */ []));
|
|
8464
|
+
/**
|
|
8465
|
+
* `sol-icon`'s own size preset ('sm'|'md'|'lg', no 'touch' — el ícono es
|
|
8466
|
+
* SOLO la "tinta" visible, PR-C4/GOAL §4: crece el botón, no el ícono).
|
|
8467
|
+
* `touch` (44px) mapea al ícono 'lg' — el mismo glyph que ya se veía en un
|
|
8468
|
+
* botón `lg` (40px), solo con más padding invisible alrededor.
|
|
8469
|
+
*/
|
|
8470
|
+
iconSize = computed(() => {
|
|
8471
|
+
const current = this.size();
|
|
8472
|
+
return current === 'touch' ? 'lg' : current;
|
|
8473
|
+
}, /* @ts-ignore */
|
|
8474
|
+
...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
8283
8475
|
onClick(event) {
|
|
8284
8476
|
if (this.disabled()) {
|
|
8285
8477
|
event.stopPropagation();
|
|
@@ -8296,9 +8488,9 @@ class SolIconButtonComponent {
|
|
|
8296
8488
|
[attr.aria-label]="ariaLabel()"
|
|
8297
8489
|
(click)="onClick($event)"
|
|
8298
8490
|
>
|
|
8299
|
-
<sol-icon [name]="icon()" [size]="
|
|
8491
|
+
<sol-icon [name]="icon()" [size]="iconSize()" />
|
|
8300
8492
|
</button>
|
|
8301
|
-
`, 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}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
8493
|
+
`, 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 });
|
|
8302
8494
|
}
|
|
8303
8495
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolIconButtonComponent, decorators: [{
|
|
8304
8496
|
type: Component,
|
|
@@ -8310,9 +8502,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
8310
8502
|
[attr.aria-label]="ariaLabel()"
|
|
8311
8503
|
(click)="onClick($event)"
|
|
8312
8504
|
>
|
|
8313
|
-
<sol-icon [name]="icon()" [size]="
|
|
8505
|
+
<sol-icon [name]="icon()" [size]="iconSize()" />
|
|
8314
8506
|
</button>
|
|
8315
|
-
`, 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}\n"] }]
|
|
8507
|
+
`, 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"] }]
|
|
8316
8508
|
}], 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"] }] } });
|
|
8317
8509
|
|
|
8318
8510
|
/**
|
|
@@ -9248,6 +9440,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
9248
9440
|
`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;border-radius:50%;font-family:var(--sol-font-family);font-weight:600;color:#fff;-webkit-user-select:none;user-select:none}:host.sol-avatar--sm{width:1.75rem;height:1.75rem;font-size:var(--sol-font-size-xs, .7rem)}:host.sol-avatar--md{width:2.5rem;height:2.5rem;font-size:var(--sol-font-size-sm, .875rem)}:host.sol-avatar--lg{width:3.5rem;height:3.5rem;font-size:var(--sol-font-size-base, 1rem)}.sol-avatar__image{width:100%;height:100%;object-fit:cover}:host.sol-avatar--palette-0{background:var(--sol-avatar-palette-0, #78716c)}:host.sol-avatar--palette-1{background:var(--sol-avatar-palette-1, #a8756c)}:host.sol-avatar--palette-2{background:var(--sol-avatar-palette-2, #a68a56)}:host.sol-avatar--palette-3{background:var(--sol-avatar-palette-3, #6b9080)}:host.sol-avatar--palette-4{background:var(--sol-avatar-palette-4, #5b8a8a)}:host.sol-avatar--palette-5{background:var(--sol-avatar-palette-5, #6b83a6)}:host.sol-avatar--palette-6{background:var(--sol-avatar-palette-6, #8a75a6)}:host.sol-avatar--palette-7{background:var(--sol-avatar-palette-7, #a6688a)}\n"] }]
|
|
9249
9441
|
}], 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 }] }] } });
|
|
9250
9442
|
|
|
9443
|
+
/** Escala de calificación: 5 estrellas, como la de Google. */
|
|
9444
|
+
const MAX_STARS = 5;
|
|
9445
|
+
/**
|
|
9446
|
+
* `sol-star-rating` — calificación de 1 a 5 en estrellas, de solo lectura.
|
|
9447
|
+
*
|
|
9448
|
+
* Genérico a propósito: no sabe de dónde sale el puntaje (reseñas de Google,
|
|
9449
|
+
* encuestas propias, calificación de un profesional). El consumidor pasa el
|
|
9450
|
+
* valor y decide si además muestra el número y el conteo.
|
|
9451
|
+
*
|
|
9452
|
+
* La media estrella se resuelve recortando la estrella llena con `width`
|
|
9453
|
+
* sobre la vacía, así que un 4.3 se ve como 4 llenas y una parcial — sin
|
|
9454
|
+
* redondear hacia arriba y sin un tercer ícono "media estrella".
|
|
9455
|
+
*
|
|
9456
|
+
* Accesibilidad: las estrellas son decorativas (`aria-hidden`) y el valor
|
|
9457
|
+
* real viaja en el `aria-label` del contenedor, con `role="img"`. Un lector
|
|
9458
|
+
* de pantalla anuncia "4,3 de 5" en vez de leer cinco íconos sueltos.
|
|
9459
|
+
*/
|
|
9460
|
+
class SolStarRatingComponent {
|
|
9461
|
+
i18n = inject(SOL_I18N);
|
|
9462
|
+
/** Calificación de 0 a 5. `null` = sin dato: se pintan 5 estrellas vacías. */
|
|
9463
|
+
value = input(null, /* @ts-ignore */
|
|
9464
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
9465
|
+
/** Tamaño de las estrellas. Hereda la escala de `sol-icon`. */
|
|
9466
|
+
size = input('sm', /* @ts-ignore */
|
|
9467
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
9468
|
+
/** Muestra el número junto a las estrellas (ej. "4,8"). */
|
|
9469
|
+
showValue = input(false, /* @ts-ignore */
|
|
9470
|
+
...(ngDevMode ? [{ debugName: "showValue" }] : /* istanbul ignore next */ []));
|
|
9471
|
+
/** Índices para el `@for`: siempre son 5 estrellas. */
|
|
9472
|
+
stars = Array.from({ length: MAX_STARS }, (_, i) => i);
|
|
9473
|
+
/** Valor recortado al rango válido: un dato raro no rompe el ancho. */
|
|
9474
|
+
safeValue = computed(() => {
|
|
9475
|
+
const raw = this.value();
|
|
9476
|
+
if (raw === null || !Number.isFinite(raw))
|
|
9477
|
+
return 0;
|
|
9478
|
+
return Math.min(Math.max(raw, 0), MAX_STARS);
|
|
9479
|
+
}, /* @ts-ignore */
|
|
9480
|
+
...(ngDevMode ? [{ debugName: "safeValue" }] : /* istanbul ignore next */ []));
|
|
9481
|
+
filledPercent = computed(() => (this.safeValue() / MAX_STARS) * 100, /* @ts-ignore */
|
|
9482
|
+
...(ngDevMode ? [{ debugName: "filledPercent" }] : /* istanbul ignore next */ []));
|
|
9483
|
+
/** Un decimal y coma decimal, como se escribe en español. */
|
|
9484
|
+
formattedValue = computed(() => this.safeValue().toFixed(1).replace('.', ','), /* @ts-ignore */
|
|
9485
|
+
...(ngDevMode ? [{ debugName: "formattedValue" }] : /* istanbul ignore next */ []));
|
|
9486
|
+
ariaLabel = computed(() => {
|
|
9487
|
+
const rating = this.formattedValue();
|
|
9488
|
+
const translated = this.i18n.translate('shared.starRating.label', {
|
|
9489
|
+
rating,
|
|
9490
|
+
max: MAX_STARS,
|
|
9491
|
+
});
|
|
9492
|
+
// El contrato de `SolI18n` devuelve la clave misma cuando falta, así que
|
|
9493
|
+
// ese caso se detecta y se cae a un texto propio en vez de anunciarle la
|
|
9494
|
+
// clave cruda a un lector de pantalla.
|
|
9495
|
+
return translated === 'shared.starRating.label'
|
|
9496
|
+
? `${rating} de ${MAX_STARS}`
|
|
9497
|
+
: translated;
|
|
9498
|
+
}, /* @ts-ignore */
|
|
9499
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
9500
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolStarRatingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9501
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolStarRatingComponent, isStandalone: true, selector: "sol-star-rating", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, showValue: { classPropertyName: "showValue", publicName: "showValue", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
9502
|
+
<span class="sol-star-rating" role="img" [attr.aria-label]="ariaLabel()">
|
|
9503
|
+
<span class="sol-star-rating__stars" aria-hidden="true">
|
|
9504
|
+
<!-- Capa base: las 5 estrellas vacías. -->
|
|
9505
|
+
@for (star of stars; track star) {
|
|
9506
|
+
<sol-icon name="star" [size]="size()" class="sol-star-rating__empty" />
|
|
9507
|
+
}
|
|
9508
|
+
|
|
9509
|
+
<!-- Capa superpuesta: las mismas 5 llenas, recortadas al porcentaje. -->
|
|
9510
|
+
<span class="sol-star-rating__filled" [style.width.%]="filledPercent()">
|
|
9511
|
+
@for (star of stars; track star) {
|
|
9512
|
+
<sol-icon name="star" variant="fill" [size]="size()" />
|
|
9513
|
+
}
|
|
9514
|
+
</span>
|
|
9515
|
+
</span>
|
|
9516
|
+
|
|
9517
|
+
@if (showValue() && value() !== null) {
|
|
9518
|
+
<span class="sol-star-rating__value">{{ formattedValue() }}</span>
|
|
9519
|
+
}
|
|
9520
|
+
</span>
|
|
9521
|
+
`, isInline: true, 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"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
9522
|
+
}
|
|
9523
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolStarRatingComponent, decorators: [{
|
|
9524
|
+
type: Component,
|
|
9525
|
+
args: [{ selector: 'sol-star-rating', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [SolIconComponent], template: `
|
|
9526
|
+
<span class="sol-star-rating" role="img" [attr.aria-label]="ariaLabel()">
|
|
9527
|
+
<span class="sol-star-rating__stars" aria-hidden="true">
|
|
9528
|
+
<!-- Capa base: las 5 estrellas vacías. -->
|
|
9529
|
+
@for (star of stars; track star) {
|
|
9530
|
+
<sol-icon name="star" [size]="size()" class="sol-star-rating__empty" />
|
|
9531
|
+
}
|
|
9532
|
+
|
|
9533
|
+
<!-- Capa superpuesta: las mismas 5 llenas, recortadas al porcentaje. -->
|
|
9534
|
+
<span class="sol-star-rating__filled" [style.width.%]="filledPercent()">
|
|
9535
|
+
@for (star of stars; track star) {
|
|
9536
|
+
<sol-icon name="star" variant="fill" [size]="size()" />
|
|
9537
|
+
}
|
|
9538
|
+
</span>
|
|
9539
|
+
</span>
|
|
9540
|
+
|
|
9541
|
+
@if (showValue() && value() !== null) {
|
|
9542
|
+
<span class="sol-star-rating__value">{{ formattedValue() }}</span>
|
|
9543
|
+
}
|
|
9544
|
+
</span>
|
|
9545
|
+
`, 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"] }]
|
|
9546
|
+
}], 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 }] }] } });
|
|
9547
|
+
|
|
9251
9548
|
/** Color CSS (`var(--sol-color-*)` con fallback) por tono — fuente única para toda la lib. */
|
|
9252
9549
|
const TONE_COLOR = {
|
|
9253
9550
|
success: 'var(--sol-color-success, #10b981)',
|
|
@@ -10184,7 +10481,7 @@ function countIds(items) {
|
|
|
10184
10481
|
return frequency;
|
|
10185
10482
|
}
|
|
10186
10483
|
/** Clave de `track` segura: el índice si `id` está ausente o duplicado; si no, el propio `id`. */
|
|
10187
|
-
function safeTrackKey(id, index, frequency) {
|
|
10484
|
+
function safeTrackKey$1(id, index, frequency) {
|
|
10188
10485
|
if (id == null)
|
|
10189
10486
|
return index;
|
|
10190
10487
|
return (frequency.get(id) ?? 0) > 1 ? index : id;
|
|
@@ -10288,7 +10585,7 @@ class SolKanbanColumnComponent {
|
|
|
10288
10585
|
...(ngDevMode ? [{ debugName: "itemIdFrequency" }] : /* istanbul ignore next */ []));
|
|
10289
10586
|
/** `track` seguro: cae al índice si el `id` del item está ausente o duplicado, en vez de dejar que Angular lance `NG0955`. */
|
|
10290
10587
|
trackItem(item, index) {
|
|
10291
|
-
return safeTrackKey(item?.id, index, this.itemIdFrequency());
|
|
10588
|
+
return safeTrackKey$1(item?.id, index, this.itemIdFrequency());
|
|
10292
10589
|
}
|
|
10293
10590
|
title = computed(() => resolveColumnTitle(this.column(), (key) => this.i18n.translate(key)), /* @ts-ignore */
|
|
10294
10591
|
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
@@ -10380,6 +10677,11 @@ class SolKanbanColumnComponent {
|
|
|
10380
10677
|
toColumnId: event.container.id,
|
|
10381
10678
|
previousIndex: event.previousIndex,
|
|
10382
10679
|
currentIndex: event.currentIndex,
|
|
10680
|
+
// Reenvío CRUDO del dato arrastrado (11-g PR2) — usado SOLO por el
|
|
10681
|
+
// board cuando el drop viene de una `cdkDropList` externa al tablero
|
|
10682
|
+
// (`externalItemDropped`); un drag interno normal lo ignora por
|
|
10683
|
+
// completo (`KanbanReorderService.reorder` nunca lo lee).
|
|
10684
|
+
data: event.item.data,
|
|
10383
10685
|
});
|
|
10384
10686
|
}
|
|
10385
10687
|
onCdkEntered() {
|
|
@@ -10752,6 +11054,21 @@ class SolKanbanBoardComponent {
|
|
|
10752
11054
|
* `[columns]` para el rollback (ver doc de la clase).
|
|
10753
11055
|
*/
|
|
10754
11056
|
itemMoved = output();
|
|
11057
|
+
/**
|
|
11058
|
+
* Arrastre de un item AJENO al board (11-g-crm-contactos-y-acciones, PR2
|
|
11059
|
+
* de boki-front) — un consumidor externo puede conectar su propia
|
|
11060
|
+
* `cdkDropList` (`[cdkDropListConnectedTo]` = ids de columna del board,
|
|
11061
|
+
* obtenibles de `columns()`) para permitir soltar SUS propios items sobre
|
|
11062
|
+
* una columna. `KanbanReorderService.reorder` descarta ese drop (el
|
|
11063
|
+
* `fromColumnId` no es ninguna columna propia — no hay nada que
|
|
11064
|
+
* reordenar), pero el board SÍ reconoce el caso: el `toColumnId` ES una
|
|
11065
|
+
* columna propia y el `fromColumnId` NO lo es. En ese caso emite este
|
|
11066
|
+
* output ADITIVO con el `data` crudo del item arrastrado (`CdkDrag.data`
|
|
11067
|
+
* del origen) en vez de `itemMoved` — el board NUNCA muta sus propias
|
|
11068
|
+
* columnas por un drop externo; el consumidor decide qué hacer (p. ej.
|
|
11069
|
+
* crear una tarjeta nueva) y refresca `[columns]` cuando corresponda.
|
|
11070
|
+
*/
|
|
11071
|
+
externalItemDropped = output();
|
|
10755
11072
|
reorderService = inject(KanbanReorderService);
|
|
10756
11073
|
i18n = inject(SOL_I18N);
|
|
10757
11074
|
/** `protected` (no `private`): el template de este mismo componente necesita leerlo, y Angular exige acceso no-privado para bindings de plantilla. */
|
|
@@ -10795,7 +11112,7 @@ class SolKanbanBoardComponent {
|
|
|
10795
11112
|
...(ngDevMode ? [{ debugName: "columnIdFrequency" }] : /* istanbul ignore next */ []));
|
|
10796
11113
|
/** `track` seguro: cae al índice si el `id` de la columna está ausente o duplicado. */
|
|
10797
11114
|
trackColumn(column, index) {
|
|
10798
|
-
return safeTrackKey(column?.id, index, this.columnIdFrequency());
|
|
11115
|
+
return safeTrackKey$1(column?.id, index, this.columnIdFrequency());
|
|
10799
11116
|
}
|
|
10800
11117
|
onColumnAction(action) {
|
|
10801
11118
|
this.columnAction.emit(action);
|
|
@@ -10815,14 +11132,30 @@ class SolKanbanBoardComponent {
|
|
|
10815
11132
|
*/
|
|
10816
11133
|
onItemDropped(event) {
|
|
10817
11134
|
const result = this.reorderService.reorder(this.mirroredColumns(), event);
|
|
10818
|
-
if (!result)
|
|
11135
|
+
if (!result) {
|
|
11136
|
+
this.emitExternalDropIfApplicable(event);
|
|
10819
11137
|
return;
|
|
11138
|
+
}
|
|
10820
11139
|
this.mirroredColumns.set(result.columns);
|
|
10821
11140
|
this.itemMoved.emit(result.moved);
|
|
10822
11141
|
this.announceMove(result.moved);
|
|
10823
11142
|
// Marca el gesto como "con drop" — ver doc de `droppedThisGesture`.
|
|
10824
11143
|
this.droppedThisGesture = true;
|
|
10825
11144
|
}
|
|
11145
|
+
/**
|
|
11146
|
+
* Distingue "evento inconsistente" (columna origen/destino inexistente,
|
|
11147
|
+
* índice fuera de rango — se ignora, comportamiento histórico) de "drop
|
|
11148
|
+
* externo válido" (`toColumnId` ES una columna propia, `fromColumnId` NO
|
|
11149
|
+
* lo es — ver doc de `externalItemDropped`).
|
|
11150
|
+
*/
|
|
11151
|
+
emitExternalDropIfApplicable(event) {
|
|
11152
|
+
const columns = this.mirroredColumns();
|
|
11153
|
+
const toColumnExists = columns.some(c => c.id === event.toColumnId);
|
|
11154
|
+
const fromColumnExists = columns.some(c => c.id === event.fromColumnId);
|
|
11155
|
+
if (toColumnExists && !fromColumnExists) {
|
|
11156
|
+
this.externalItemDropped.emit({ toColumnId: event.toColumnId, data: event.data });
|
|
11157
|
+
}
|
|
11158
|
+
}
|
|
10826
11159
|
/**
|
|
10827
11160
|
* Fuerza el re-seed del espejo desde el `columns()` ACTUAL (corrección 4R
|
|
10828
11161
|
* WARNING) — NO depende de que la referencia cambie (a diferencia del
|
|
@@ -10869,7 +11202,7 @@ class SolKanbanBoardComponent {
|
|
|
10869
11202
|
: this.i18n.translate('shared.kanban.movedToColumn', { column: columnLabel }));
|
|
10870
11203
|
}
|
|
10871
11204
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolKanbanBoardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10872
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolKanbanBoardComponent, isStandalone: true, selector: "sol-kanban-board", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, cardTemplate: { classPropertyName: "cardTemplate", publicName: "cardTemplate", isSignal: true, isRequired: true, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, anchorTemplate: { classPropertyName: "anchorTemplate", publicName: "anchorTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnAction: "columnAction", addRequested: "addRequested", itemMoved: "itemMoved" }, ngImport: i0, template: `
|
|
11205
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolKanbanBoardComponent, isStandalone: true, selector: "sol-kanban-board", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, cardTemplate: { classPropertyName: "cardTemplate", publicName: "cardTemplate", isSignal: true, isRequired: true, transformFunction: null }, headerTemplate: { classPropertyName: "headerTemplate", publicName: "headerTemplate", isSignal: true, isRequired: false, transformFunction: null }, anchorTemplate: { classPropertyName: "anchorTemplate", publicName: "anchorTemplate", isSignal: true, isRequired: false, transformFunction: null }, emptyTemplate: { classPropertyName: "emptyTemplate", publicName: "emptyTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { columnAction: "columnAction", addRequested: "addRequested", itemMoved: "itemMoved", externalItemDropped: "externalItemDropped" }, ngImport: i0, template: `
|
|
10873
11206
|
<div class="sol-kanban-board" cdkDropListGroup>
|
|
10874
11207
|
@for (column of mirroredColumns(); track trackColumn(column, $index)) {
|
|
10875
11208
|
<sol-kanban-column
|
|
@@ -10908,7 +11241,108 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
10908
11241
|
</div>
|
|
10909
11242
|
<div class="sol-kanban-board__announce" aria-live="polite" role="status">{{ announcement() }}</div>
|
|
10910
11243
|
`, styles: [":host{display:block}.sol-kanban-board{display:flex;align-items:flex-start;gap:var(--sol-space-md, 12px);overflow-x:auto;padding-bottom:var(--sol-space-sm, 8px)}.sol-kanban-board__announce{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}\n"] }]
|
|
10911
|
-
}], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], cardTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardTemplate", required: true }] }], headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: false }] }], anchorTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorTemplate", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], columnAction: [{ type: i0.Output, args: ["columnAction"] }], addRequested: [{ type: i0.Output, args: ["addRequested"] }], itemMoved: [{ type: i0.Output, args: ["itemMoved"] }] } });
|
|
11244
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], cardTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "cardTemplate", required: true }] }], headerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerTemplate", required: false }] }], anchorTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorTemplate", required: false }] }], emptyTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTemplate", required: false }] }], columnAction: [{ type: i0.Output, args: ["columnAction"] }], addRequested: [{ type: i0.Output, args: ["addRequested"] }], itemMoved: [{ type: i0.Output, args: ["itemMoved"] }], externalItemDropped: [{ type: i0.Output, args: ["externalItemDropped"] }] } });
|
|
11245
|
+
|
|
11246
|
+
/**
|
|
11247
|
+
* `sol-kanban-drag-source` — origen de arrastre EXTERNO al tablero (11-g-crm-
|
|
11248
|
+
* contactos-y-acciones, PR2 de boki-front, T06): un consumidor AJENO a
|
|
11249
|
+
* `sol-kanban-board` (p. ej. una lista de contactos) puede declarar sus
|
|
11250
|
+
* propios items como arrastrables y soltarlos sobre las columnas de un
|
|
11251
|
+
* tablero YA renderizado en otra parte de la página — conectando
|
|
11252
|
+
* `[connectedTo]` a los MISMOS ids de columna que `sol-kanban-board` expone
|
|
11253
|
+
* (`KanbanColumn.id`, el `cdkDropList` id interno de `sol-kanban-column`).
|
|
11254
|
+
*
|
|
11255
|
+
* Sin conocimiento de dominio (mismo criterio que el resto de `ui/kanban/`):
|
|
11256
|
+
* NUNCA referencia `Client`/`Lead`/etc. — el consumidor proyecta su propio
|
|
11257
|
+
* contenido vía `itemTemplate` y decide qué es un `KanbanItem` para él.
|
|
11258
|
+
*
|
|
11259
|
+
* `@angular/cdk/drag-drop` vive EXCLUSIVAMENTE aquí dentro de `ui/kanban/`
|
|
11260
|
+
* (gate ESLint T40, `no-restricted-imports`) — ninguna vista de una app
|
|
11261
|
+
* consumidora puede importar CDK directo; este componente es la ÚNICA
|
|
11262
|
+
* puerta para un origen de arrastre EXTERNO al board, igual que
|
|
11263
|
+
* `sol-kanban-board`/`sol-kanban-column` lo son para el arrastre INTERNO.
|
|
11264
|
+
*
|
|
11265
|
+
* `cdkDropListSortingDisabled`: esta lista NUNCA reordena sus propios
|
|
11266
|
+
* items por drag (no tiene sentido para un origen — solo transfiere HACIA
|
|
11267
|
+
* afuera). La recepción del drop la resuelve la columna DESTINO
|
|
11268
|
+
* (`sol-kanban-column`/`sol-kanban-board`, que ya distingue un origen
|
|
11269
|
+
* ajeno vía `externalItemDropped` — ver `kanban-board.component.ts`); este
|
|
11270
|
+
* componente no necesita saber nada sobre qué pasó con el item soltado.
|
|
11271
|
+
*/
|
|
11272
|
+
class SolKanbanDragSourceComponent {
|
|
11273
|
+
/** Items arrastrables — tolera `null`/`undefined` (mismo criterio de robustez que `sol-kanban-board`). */
|
|
11274
|
+
items = input.required(/* @ts-ignore */
|
|
11275
|
+
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
11276
|
+
/** Ids de las `cdkDropList` destino (las columnas del tablero AJENO al que soltar). */
|
|
11277
|
+
connectedTo = input([], /* @ts-ignore */
|
|
11278
|
+
...(ngDevMode ? [{ debugName: "connectedTo" }] : /* istanbul ignore next */ []));
|
|
11279
|
+
/** Template del contenido de cada item — el consumidor decide qué renderiza (sin conocimiento de dominio acá). */
|
|
11280
|
+
itemTemplate = input.required(/* @ts-ignore */
|
|
11281
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
11282
|
+
/** Ids de items NO arrastrables (p. ej. "ya en pipeline") — comparados por `KanbanItem.id`. */
|
|
11283
|
+
disabledIds = input(new Set(), /* @ts-ignore */
|
|
11284
|
+
...(ngDevMode ? [{ debugName: "disabledIds" }] : /* istanbul ignore next */ []));
|
|
11285
|
+
/** `id` de la `cdkDropList` propia — normalmente irrelevante (nadie se conecta HACIA ella), pero CDK lo exige. */
|
|
11286
|
+
listId = input('sol-kanban-drag-source', /* @ts-ignore */
|
|
11287
|
+
...(ngDevMode ? [{ debugName: "listId" }] : /* istanbul ignore next */ []));
|
|
11288
|
+
/** `protected` (no `private`): el template propio necesita leerlo — Angular exige acceso no-privado para bindings de plantilla. */
|
|
11289
|
+
normalizedItems = computed(() => (this.items() ?? []).filter((i) => !!i), /* @ts-ignore */
|
|
11290
|
+
...(ngDevMode ? [{ debugName: "normalizedItems" }] : /* istanbul ignore next */ []));
|
|
11291
|
+
itemIdFrequency = computed(() => countIds(this.normalizedItems()), /* @ts-ignore */
|
|
11292
|
+
...(ngDevMode ? [{ debugName: "itemIdFrequency" }] : /* istanbul ignore next */ []));
|
|
11293
|
+
trackItem(item, index) {
|
|
11294
|
+
return safeTrackKey$1(item?.id, index, this.itemIdFrequency());
|
|
11295
|
+
}
|
|
11296
|
+
isItemDisabled(item) {
|
|
11297
|
+
return this.disabledIds().has(item.id);
|
|
11298
|
+
}
|
|
11299
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolKanbanDragSourceComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
11300
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolKanbanDragSourceComponent, isStandalone: true, selector: "sol-kanban-drag-source", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, connectedTo: { classPropertyName: "connectedTo", publicName: "connectedTo", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: true, transformFunction: null }, disabledIds: { classPropertyName: "disabledIds", publicName: "disabledIds", isSignal: true, isRequired: false, transformFunction: null }, listId: { classPropertyName: "listId", publicName: "listId", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
11301
|
+
<div
|
|
11302
|
+
class="sol-kanban-drag-source"
|
|
11303
|
+
cdkDropList
|
|
11304
|
+
[id]="listId()"
|
|
11305
|
+
[cdkDropListData]="normalizedItems()"
|
|
11306
|
+
[cdkDropListConnectedTo]="connectedTo()"
|
|
11307
|
+
cdkDropListSortingDisabled
|
|
11308
|
+
>
|
|
11309
|
+
@for (item of normalizedItems(); track trackItem(item, $index)) {
|
|
11310
|
+
<div
|
|
11311
|
+
class="sol-kanban-drag-source__item"
|
|
11312
|
+
cdkDrag
|
|
11313
|
+
[cdkDragData]="item"
|
|
11314
|
+
[cdkDragDisabled]="isItemDisabled(item)"
|
|
11315
|
+
>
|
|
11316
|
+
<ng-container *ngTemplateOutlet="itemTemplate(); context: { $implicit: item }" />
|
|
11317
|
+
</div>
|
|
11318
|
+
}
|
|
11319
|
+
</div>
|
|
11320
|
+
`, isInline: true, styles: [".sol-kanban-drag-source{display:flex;flex-direction:column;gap:var(--sol-space-sm, 8px)}.sol-kanban-drag-source__item{cursor:grab}.sol-kanban-drag-source__item.cdk-drag-disabled{cursor:default}\n"], dependencies: [{ kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11321
|
+
}
|
|
11322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolKanbanDragSourceComponent, decorators: [{
|
|
11323
|
+
type: Component,
|
|
11324
|
+
args: [{ selector: 'sol-kanban-drag-source', standalone: true, imports: [CdkDropList, CdkDrag, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
11325
|
+
<div
|
|
11326
|
+
class="sol-kanban-drag-source"
|
|
11327
|
+
cdkDropList
|
|
11328
|
+
[id]="listId()"
|
|
11329
|
+
[cdkDropListData]="normalizedItems()"
|
|
11330
|
+
[cdkDropListConnectedTo]="connectedTo()"
|
|
11331
|
+
cdkDropListSortingDisabled
|
|
11332
|
+
>
|
|
11333
|
+
@for (item of normalizedItems(); track trackItem(item, $index)) {
|
|
11334
|
+
<div
|
|
11335
|
+
class="sol-kanban-drag-source__item"
|
|
11336
|
+
cdkDrag
|
|
11337
|
+
[cdkDragData]="item"
|
|
11338
|
+
[cdkDragDisabled]="isItemDisabled(item)"
|
|
11339
|
+
>
|
|
11340
|
+
<ng-container *ngTemplateOutlet="itemTemplate(); context: { $implicit: item }" />
|
|
11341
|
+
</div>
|
|
11342
|
+
}
|
|
11343
|
+
</div>
|
|
11344
|
+
`, styles: [".sol-kanban-drag-source{display:flex;flex-direction:column;gap:var(--sol-space-sm, 8px)}.sol-kanban-drag-source__item{cursor:grab}.sol-kanban-drag-source__item.cdk-drag-disabled{cursor:default}\n"] }]
|
|
11345
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], connectedTo: [{ type: i0.Input, args: [{ isSignal: true, alias: "connectedTo", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: true }] }], disabledIds: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledIds", required: false }] }], listId: [{ type: i0.Input, args: [{ isSignal: true, alias: "listId", required: false }] }] } });
|
|
10912
11346
|
|
|
10913
11347
|
/**
|
|
10914
11348
|
* `sol-chip` — átomo presentacional de selección (11-f PR2, ciclo 3 UX).
|
|
@@ -11589,7 +12023,7 @@ class SolNumberInputComponent {
|
|
|
11589
12023
|
<sol-icon name="plus" size="sm" />
|
|
11590
12024
|
</button>
|
|
11591
12025
|
</div>
|
|
11592
|
-
`, isInline: true, styles: [":host{display:inline-block;--sol-number-input-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-number-input-text: var(--sol-color-text-primary, #1e293b);--sol-number-input-border: var(--sol-border-color-default, #cbd5e1);--sol-number-input-
|
|
12026
|
+
`, isInline: true, styles: [":host{display:inline-block;--sol-number-input-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-number-input-text: var(--sol-color-text-primary, #1e293b);--sol-number-input-border: var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sol-border-color-default, #cbd5e1));--sol-number-input-focus-border: var(--sol-input-focus-border, var(--sol-border-width-default, 1px) solid var(--sol-color-primary, #6366f1));--sol-number-input-focus-ring: var(--sol-input-focus-ring, 0 0 0 2px color-mix(in srgb, var(--sol-color-primary, #6366f1) 20%, transparent));--sol-number-input-btn-text: var(--sol-color-text-secondary, #475569);--sol-number-input-hover-bg: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-number-input-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-number-input-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-number-input-height: var(--sol-size-input-height, 2.25rem);--sol-number-input-font-size: var(--sol-font-size-base, .875rem);--sol-number-input-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-number-input{display:inline-flex;align-items:stretch;height:var(--sol-number-input-height);border:var(--sol-number-input-border);border-radius:var(--sol-number-input-radius);overflow:hidden;background:var(--sol-number-input-bg);box-sizing:border-box;transition:border-color var(--sol-number-input-transition),box-shadow var(--sol-number-input-transition)}.sol-number-input:focus-within{border:var(--sol-number-input-focus-border);box-shadow:var(--sol-number-input-focus-ring)}.sol-number-input--disabled{opacity:var(--sol-number-input-disabled-opacity)}.sol-number-input__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;border:none;background:transparent;color:var(--sol-number-input-btn-text);cursor:pointer;transition:background-color var(--sol-number-input-transition)}.sol-number-input__btn--decrement{border-right:var(--sol-number-input-border)}.sol-number-input__btn--increment{border-left:var(--sol-number-input-border)}.sol-number-input__btn:hover:not(:disabled){background:var(--sol-number-input-hover-bg)}.sol-number-input__btn:focus-visible{outline:2px solid var(--sol-color-primary, #6366f1);outline-offset:-2px}.sol-number-input__btn:disabled{cursor:not-allowed;opacity:var(--sol-number-input-disabled-opacity)}.sol-number-input__field{width:3.5rem;border:none;background:transparent;text-align:center;font-family:inherit;font-size:var(--sol-number-input-font-size);color:var(--sol-number-input-text);-moz-appearance:textfield}.sol-number-input__field:focus{outline:none}.sol-number-input__field:disabled{cursor:not-allowed}@media(max-width:640px){.sol-number-input__field{font-size:16px}}\n"], dependencies: [{ kind: "component", type: SolIconComponent, selector: "sol-icon", inputs: ["name", "size", "variant"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
11593
12027
|
}
|
|
11594
12028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolNumberInputComponent, decorators: [{
|
|
11595
12029
|
type: Component,
|
|
@@ -11638,7 +12072,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
11638
12072
|
<sol-icon name="plus" size="sm" />
|
|
11639
12073
|
</button>
|
|
11640
12074
|
</div>
|
|
11641
|
-
`, styles: [":host{display:inline-block;--sol-number-input-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-number-input-text: var(--sol-color-text-primary, #1e293b);--sol-number-input-border: var(--sol-border-color-default, #cbd5e1);--sol-number-input-
|
|
12075
|
+
`, styles: [":host{display:inline-block;--sol-number-input-bg: var(--sol-input-bg, var(--sol-bg-surface, #ffffff));--sol-number-input-text: var(--sol-color-text-primary, #1e293b);--sol-number-input-border: var(--sol-input-border, var(--sol-border-width-default, 1px) solid var(--sol-border-color-default, #cbd5e1));--sol-number-input-focus-border: var(--sol-input-focus-border, var(--sol-border-width-default, 1px) solid var(--sol-color-primary, #6366f1));--sol-number-input-focus-ring: var(--sol-input-focus-ring, 0 0 0 2px color-mix(in srgb, var(--sol-color-primary, #6366f1) 20%, transparent));--sol-number-input-btn-text: var(--sol-color-text-secondary, #475569);--sol-number-input-hover-bg: var(--sol-color-bg-hover, rgba(0, 0, 0, .04));--sol-number-input-disabled-opacity: var(--sol-disabled-opacity, .55);--sol-number-input-radius: var(--sol-input-radius, var(--sol-border-radius-md, .5rem));--sol-number-input-height: var(--sol-size-input-height, 2.25rem);--sol-number-input-font-size: var(--sol-font-size-base, .875rem);--sol-number-input-transition: var(--sol-dur-fast, .15s) var(--sol-ease, ease)}.sol-number-input{display:inline-flex;align-items:stretch;height:var(--sol-number-input-height);border:var(--sol-number-input-border);border-radius:var(--sol-number-input-radius);overflow:hidden;background:var(--sol-number-input-bg);box-sizing:border-box;transition:border-color var(--sol-number-input-transition),box-shadow var(--sol-number-input-transition)}.sol-number-input:focus-within{border:var(--sol-number-input-focus-border);box-shadow:var(--sol-number-input-focus-ring)}.sol-number-input--disabled{opacity:var(--sol-number-input-disabled-opacity)}.sol-number-input__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;border:none;background:transparent;color:var(--sol-number-input-btn-text);cursor:pointer;transition:background-color var(--sol-number-input-transition)}.sol-number-input__btn--decrement{border-right:var(--sol-number-input-border)}.sol-number-input__btn--increment{border-left:var(--sol-number-input-border)}.sol-number-input__btn:hover:not(:disabled){background:var(--sol-number-input-hover-bg)}.sol-number-input__btn:focus-visible{outline:2px solid var(--sol-color-primary, #6366f1);outline-offset:-2px}.sol-number-input__btn:disabled{cursor:not-allowed;opacity:var(--sol-number-input-disabled-opacity)}.sol-number-input__field{width:3.5rem;border:none;background:transparent;text-align:center;font-family:inherit;font-size:var(--sol-number-input-font-size);color:var(--sol-number-input-text);-moz-appearance:textfield}.sol-number-input__field:focus{outline:none}.sol-number-input__field:disabled{cursor:not-allowed}@media(max-width:640px){.sol-number-input__field{font-size:16px}}\n"] }]
|
|
11642
12076
|
}], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: true }] }], decrementLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementLabelKey", required: false }] }], incrementLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementLabelKey", required: false }] }] } });
|
|
11643
12077
|
|
|
11644
12078
|
/** Superficie neutra por tokens — fallback compartido por el default null-object (sin `color`/`color` no seguro) y por `sol-calendar-grid` cuando una Strategy inyectada lanza (corrección 4R WARNING — resilience). */
|
|
@@ -12474,6 +12908,1463 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
12474
12908
|
`, styles: [":host{display:block}.sol-calendar{display:flex;flex-direction:column;gap:var(--sol-space-sm, 8px)}.sol-calendar__legend{display:flex;align-items:center;gap:var(--sol-space-md, 12px);flex-wrap:wrap}.sol-calendar__legend-item{display:inline-flex;align-items:center;gap:5px}.sol-calendar__legend-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.sol-calendar__legend-label{font-size:var(--sol-font-size-xs, 12px);color:var(--sol-color-text-muted)}\n"] }]
|
|
12475
12909
|
}], ctorParameters: () => [], propDecorators: { events: [{ type: i0.Input, args: [{ isSignal: true, alias: "events", required: true }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: true }] }], currentDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentDate", required: true }] }], eventTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "eventTemplate", required: false }] }], legend: [{ type: i0.Input, args: [{ isSignal: true, alias: "legend", required: false }] }], eventClicked: [{ type: i0.Output, args: ["eventClicked"] }], slotClicked: [{ type: i0.Output, args: ["slotClicked"] }] } });
|
|
12476
12910
|
|
|
12911
|
+
/**
|
|
12912
|
+
* Validez de destino al "tap-para-conectar" de `sol-flow-canvas` (Ola 5
|
|
12913
|
+
* PR-C2B) — PURA, sin Angular/DOM (mismo criterio que `flow-canvas-layout.ts`).
|
|
12914
|
+
*
|
|
12915
|
+
* Decisión de diseño: `sol-flow-canvas` es una librería AGNÓSTICA de dominio
|
|
12916
|
+
* (ver docstring de `flow-canvas.model.ts` — "cero conocimiento de dominio",
|
|
12917
|
+
* NUNCA referencia `FlowNodeSpec`/`handler_kind`) y por FSD (`app → ... →
|
|
12918
|
+
* shared`) NUNCA puede importar `entities/flow/model/flow.validators.ts` de
|
|
12919
|
+
* la app — sería una dependencia hacia ARRIBA, prohibida. Este módulo
|
|
12920
|
+
* reimplementa el MISMO criterio estructural que motiva 2 reglas de
|
|
12921
|
+
* `flow.validators.ts` (`checkNoDuplicateTransitions` y el espíritu de
|
|
12922
|
+
* "ciclo ilegal" de `FlowValidator._validate_cycles` en boki-ai) como grafo
|
|
12923
|
+
* PURO — sin `yields_turn` (atributo de dominio que ni siquiera viaja a la
|
|
12924
|
+
* API, ver docstring de `flow.validators.ts`), así que la regla de ciclos de
|
|
12925
|
+
* acá es DELIBERADAMENTE más estricta que la del backend: excluye CUALQUIER
|
|
12926
|
+
* destino que hoy ya pueda alcanzar el origen (cerraría un ciclo visible en
|
|
12927
|
+
* el lienzo), aunque el validador real permita ciclos legítimos con
|
|
12928
|
+
* `interrupt()`. Es un HINT visual del canvas (resalta destinos sugeridos),
|
|
12929
|
+
* NO bloquea la conexión ni reemplaza al validador real — `entities/flow`
|
|
12930
|
+
* sigue siendo la fuente de verdad final sobre legalidad de dominio.
|
|
12931
|
+
*/
|
|
12932
|
+
function safeNodes(nodes) {
|
|
12933
|
+
return (nodes ?? []).filter((n) => !!n);
|
|
12934
|
+
}
|
|
12935
|
+
function safeEdges(edges) {
|
|
12936
|
+
return (edges ?? []).filter((e) => !!e);
|
|
12937
|
+
}
|
|
12938
|
+
/**
|
|
12939
|
+
* Destinos válidos para conectar DESDE `sourceId`, dado el grafo actual:
|
|
12940
|
+
* 1. Nunca el propio `sourceId` (sin auto-loop).
|
|
12941
|
+
* 2. Nunca un destino con el que YA existe una arista `sourceId→destino`
|
|
12942
|
+
* (evita una conexión duplicada).
|
|
12943
|
+
* 3. Nunca un destino desde el que HOY se puede alcanzar `sourceId` (directa
|
|
12944
|
+
* o transitivamente) vía aristas existentes — conectarlo cerraría un
|
|
12945
|
+
* ciclo.
|
|
12946
|
+
*
|
|
12947
|
+
* `sourceId` ausente entre los nodos actuales devuelve un set vacío
|
|
12948
|
+
* (defensivo — mismo criterio de robustez del resto del módulo).
|
|
12949
|
+
*/
|
|
12950
|
+
function computeValidConnectionTargets(nodes, edges, sourceId) {
|
|
12951
|
+
const idSet = new Set(safeNodes(nodes).map((n) => n.id));
|
|
12952
|
+
if (!idSet.has(sourceId))
|
|
12953
|
+
return new Set();
|
|
12954
|
+
const incoming = new Map(); // target -> [sources] — para el BFS reverso de la regla 3
|
|
12955
|
+
const existingOutgoingPairs = new Set(); // "source::target" ya conectados — para la regla 2
|
|
12956
|
+
for (const edge of safeEdges(edges)) {
|
|
12957
|
+
if (!idSet.has(edge.sourceId) || !idSet.has(edge.targetId))
|
|
12958
|
+
continue; // arista "fantasma" — mismo criterio que visibleEdges()
|
|
12959
|
+
const predecessors = incoming.get(edge.targetId) ?? [];
|
|
12960
|
+
predecessors.push(edge.sourceId);
|
|
12961
|
+
incoming.set(edge.targetId, predecessors);
|
|
12962
|
+
existingOutgoingPairs.add(`${edge.sourceId}::${edge.targetId}`);
|
|
12963
|
+
}
|
|
12964
|
+
// BFS reverso desde sourceId siguiendo aristas ENTRANTES: todo nodo alcanzado YA puede llegar a
|
|
12965
|
+
// sourceId por el camino existente — conectarlo como destino cerraría un ciclo. sourceId mismo
|
|
12966
|
+
// arranca incluido (cubre la regla 1, el auto-loop, sin un caso especial aparte).
|
|
12967
|
+
const reachesSource = new Set([sourceId]);
|
|
12968
|
+
const queue = [sourceId];
|
|
12969
|
+
while (queue.length > 0) {
|
|
12970
|
+
const current = queue.shift();
|
|
12971
|
+
for (const predecessor of incoming.get(current) ?? []) {
|
|
12972
|
+
if (reachesSource.has(predecessor))
|
|
12973
|
+
continue; // primer toque gana — mismo criterio anti-ciclo-infinito que computeAutoLayoutPositions
|
|
12974
|
+
reachesSource.add(predecessor);
|
|
12975
|
+
queue.push(predecessor);
|
|
12976
|
+
}
|
|
12977
|
+
}
|
|
12978
|
+
const valid = new Set();
|
|
12979
|
+
for (const id of idSet) {
|
|
12980
|
+
if (reachesSource.has(id))
|
|
12981
|
+
continue; // regla 1 (sourceId) + regla 3 (cerraría un ciclo)
|
|
12982
|
+
if (existingOutgoingPairs.has(`${sourceId}::${id}`))
|
|
12983
|
+
continue; // regla 2 (ya conectados — duplicado)
|
|
12984
|
+
valid.add(id);
|
|
12985
|
+
}
|
|
12986
|
+
return valid;
|
|
12987
|
+
}
|
|
12988
|
+
|
|
12989
|
+
/**
|
|
12990
|
+
* Geometría bezier de las aristas de `sol-flow-canvas` (Ola 5 PR-C2B) — PURA,
|
|
12991
|
+
* sin Angular/DOM (mismo criterio que `flow-canvas-layout.ts`). Sustituye las
|
|
12992
|
+
* líneas rectas del shell de PR-C1 (`edgeLine()`, `x1/y1/x2/y2`) por curvas
|
|
12993
|
+
* cúbicas con "dirección del flujo": control points HORIZONTALES simétricos
|
|
12994
|
+
* (`c1` a la derecha del origen, `c2` a la izquierda del destino) — mismo
|
|
12995
|
+
* criterio visual que n8n/react-flow, coherente con el layout BFS-por-columnas
|
|
12996
|
+
* de `flow-canvas-layout.ts` (`COLUMN_GAP_PX` en el eje x).
|
|
12997
|
+
*/
|
|
12998
|
+
/** Piso del offset del handle — evita una curva imperceptible en distancias horizontales cortas. */
|
|
12999
|
+
const MIN_HANDLE_PX = 40;
|
|
13000
|
+
/** Fracción de la distancia horizontal usada como offset del handle — más separación horizontal, curva más pronunciada. */
|
|
13001
|
+
const HANDLE_RATIO = 0.5;
|
|
13002
|
+
function computeEdgeControlPoints(source, target) {
|
|
13003
|
+
const dx = target.x - source.x;
|
|
13004
|
+
// Math.abs(dx): el offset SIEMPRE es positivo — incluso con dx=0 (nodos apilados en la misma columna) o
|
|
13005
|
+
// dx<0 (destino a la izquierda del origen, p. ej. una conexión "hacia atrás") la curva sigue siendo visible.
|
|
13006
|
+
const offset = Math.max(MIN_HANDLE_PX, Math.abs(dx) * HANDLE_RATIO);
|
|
13007
|
+
return {
|
|
13008
|
+
c1: { x: source.x + offset, y: source.y },
|
|
13009
|
+
c2: { x: target.x - offset, y: target.y },
|
|
13010
|
+
};
|
|
13011
|
+
}
|
|
13012
|
+
/** Atributo `d` de un elemento SVG "path" — curva cúbica `M origen C c1 c2 destino`. */
|
|
13013
|
+
function computeEdgePathD(source, target) {
|
|
13014
|
+
const { c1, c2 } = computeEdgeControlPoints(source, target);
|
|
13015
|
+
return `M ${source.x},${source.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${target.x},${target.y}`;
|
|
13016
|
+
}
|
|
13017
|
+
/** Fórmula de Bernstein general de una bezier cúbica — `t` en [0,1]. Genérica a propósito (no asume handles horizontales) para que siga siendo correcta si el criterio de control points cambia en el futuro. */
|
|
13018
|
+
function computeCubicBezierPoint(p0, p1, p2, p3, t) {
|
|
13019
|
+
const mt = 1 - t;
|
|
13020
|
+
const w0 = mt * mt * mt;
|
|
13021
|
+
const w1 = 3 * mt * mt * t;
|
|
13022
|
+
const w2 = 3 * mt * t * t;
|
|
13023
|
+
const w3 = t * t * t;
|
|
13024
|
+
return {
|
|
13025
|
+
x: w0 * p0.x + w1 * p1.x + w2 * p2.x + w3 * p3.x,
|
|
13026
|
+
y: w0 * p0.y + w1 * p1.y + w2 * p2.y + w3 * p3.y,
|
|
13027
|
+
};
|
|
13028
|
+
}
|
|
13029
|
+
/**
|
|
13030
|
+
* Punto SOBRE la curva bezier (t=0.5) para posicionar el label de la arista —
|
|
13031
|
+
* reemplaza el punto medio de la RECTA que usaba el shell de PR-C1.
|
|
13032
|
+
*
|
|
13033
|
+
* Nota de diseño: con los handles horizontales simétricos de
|
|
13034
|
+
* {@link computeEdgeControlPoints} (`c1.y=source.y`, `c2.y=target.y`, y
|
|
13035
|
+
* `c1.x + c2.x = source.x + target.x` porque el offset se suma de un lado y
|
|
13036
|
+
* se resta del otro), el punto en t=0.5 de CUALQUIER bezier cúbica —
|
|
13037
|
+
* `B(0.5) = (P0 + 3·P1 + 3·P2 + P3) / 8` — colapsa algebraicamente al
|
|
13038
|
+
* promedio exacto `(source + target) / 2` sin importar el offset (los
|
|
13039
|
+
* términos del offset se cancelan). Es decir: para ESTA construcción de
|
|
13040
|
+
* control points, el punto medio de la curva y el punto medio de la recta
|
|
13041
|
+
* coinciden en valor — la diferencia real está en que este helper calcula el
|
|
13042
|
+
* punto GENUINO de la curva (válido si el criterio de control points cambia
|
|
13043
|
+
* a uno no simétrico más adelante), no en que el número resultante hoy sea
|
|
13044
|
+
* distinto.
|
|
13045
|
+
*/
|
|
13046
|
+
function computeEdgeMidpoint(source, target) {
|
|
13047
|
+
const { c1, c2 } = computeEdgeControlPoints(source, target);
|
|
13048
|
+
return computeCubicBezierPoint(source, c1, c2, target, 0.5);
|
|
13049
|
+
}
|
|
13050
|
+
|
|
13051
|
+
/**
|
|
13052
|
+
* Motor de auto-layout de `sol-flow-canvas` (Ola 5 PR-C3 — GOAL §4:
|
|
13053
|
+
* "Persistencia de posiciones + auto-layout (dagre/ELK)", reemplaza el
|
|
13054
|
+
* placeholder BFS-por-capas de PR-C1) — PURO, sin Angular, sin DOM.
|
|
13055
|
+
*
|
|
13056
|
+
* `@dagrejs/dagre` (MIT, fork mantenido del `dagre` original — verificado
|
|
13057
|
+
* `npm view @dagrejs/dagre license` antes de instalar; su única dependencia,
|
|
13058
|
+
* `@dagrejs/graphlib`, también MIT) implementa el algoritmo de Sugiyama
|
|
13059
|
+
* (ranking + minimización de cruces + posicionamiento) — a diferencia del
|
|
13060
|
+
* BFS de "primer toque gana" que reemplaza, resuelve el ranking GLOBAL
|
|
13061
|
+
* respetando TODAS las aristas simultáneamente (una rama más larga hacia el
|
|
13062
|
+
* mismo destino empuja el rango real, no solo el del primer camino
|
|
13063
|
+
* visitado) y reordena filas dentro de cada rango para minimizar cruces
|
|
13064
|
+
* visuales — ver los casos "DIAMANTE"/"MINIMIZA cruces" en
|
|
13065
|
+
* `flow-canvas-layout.spec.ts`, que el BFS anterior NO podía satisfacer.
|
|
13066
|
+
*
|
|
13067
|
+
* Encapsulado DETRÁS de esta función — ningún componente de la app
|
|
13068
|
+
* (`boki-front`) importa `@dagrejs/dagre` directo; solo consume
|
|
13069
|
+
* `SolFlowCanvasComponent.autoLayout()`, que delega en `computeAutoLayoutPositions`
|
|
13070
|
+
* (sin cambios en su firma pública salvo volverse `Promise` — ver W3 abajo).
|
|
13071
|
+
*
|
|
13072
|
+
* **W3 (4R Ola 5 post PR-C3, fuga de bundle)** — `@dagrejs/dagre` (~100kB)
|
|
13073
|
+
* pasaba por el chunk EAGER (`main-*.js`) porque `flow-canvas-layout.ts` lo
|
|
13074
|
+
* importaba de forma ESTÁTICA — el peso viajaba a TODA la app, incluso a
|
|
13075
|
+
* quien nunca visita `/dashboard/flujos`. `computeAutoLayoutPositions` ahora
|
|
13076
|
+
* es `async` y carga el módulo vía `import()` DINÁMICO (mismo espíritu de
|
|
13077
|
+
* encapsulación que `sol-chart`/`SOL_CHART_ENGINE` con `chart.js`, llevado un
|
|
13078
|
+
* paso más allá: acá el propio MÓDULO se carga perezoso, no solo la
|
|
13079
|
+
* instancia que lo consume) — el bundler lo saca a un chunk propio, lazy,
|
|
13080
|
+
* que solo se pide la PRIMERA vez que `autoLayout()` corre de verdad.
|
|
13081
|
+
* `dagreModulePromise` cachea la promesa a nivel de MÓDULO: la primera
|
|
13082
|
+
* llamada dispara el `import()`; las siguientes reusan la misma promesa
|
|
13083
|
+
* resuelta, nunca reimportan. CAMBIO DE CONTRATO DELIBERADO: `autoLayout()`
|
|
13084
|
+
* (`flow-canvas.component.ts`) también pasa a `Promise<void>` — ver su
|
|
13085
|
+
* docstring y el de `flow-canvas-acceptance.spec.ts`.
|
|
13086
|
+
*
|
|
13087
|
+
* **W2 (4R Ola 5 post PR-C3, "dagre sin red")** — un `import()` dinámico
|
|
13088
|
+
* puede FALLAR a mitad de sesión (chunk 404 tras un deploy nuevo, conexión
|
|
13089
|
+
* caída, etc.) — mismo riesgo que cualquier `loadComponent()` de ruta de
|
|
13090
|
+
* Angular. `computeAutoLayoutPositions` envuelve TANTO la carga del módulo
|
|
13091
|
+
* COMO el cálculo del layout en un único `try/catch`: si cualquiera de los
|
|
13092
|
+
* dos falla, cae a {@link computeLayeredFallbackPositions} — el placeholder
|
|
13093
|
+
* BFS-por-capas ORIGINAL de PR-C1, conservado TAL CUAL (nunca se borró, solo
|
|
13094
|
+
* se renombró) como red de seguridad síncrona que NUNCA depende de red. Un
|
|
13095
|
+
* `console.warn` (mismo criterio que `i18n.provider.ts`/`theme.service.ts`
|
|
13096
|
+
* de este mismo repo) deja rastro del degradado sin romper la UX — el
|
|
13097
|
+
* usuario sigue viendo un layout usable, solo con un algoritmo más simple.
|
|
13098
|
+
*
|
|
13099
|
+
* `rankdir: 'LR'` (izquierda→derecha) — mismo eje horizontal que las curvas
|
|
13100
|
+
* bezier de `flow-canvas-edge-geometry.ts`. `NODE_WIDTH_PX`/`NODE_HEIGHT_PX`
|
|
13101
|
+
* duplican a propósito las mismas constantes de `flow-canvas.component.ts`
|
|
13102
|
+
* (mismo criterio de duplicación deliberada ya documentado en este archivo
|
|
13103
|
+
* para `countNodeIds`/`countEdgeIds`: cada módulo de `@solercia/ui` que las
|
|
13104
|
+
* necesita mantiene su propia copia mínima en vez de un acoplamiento
|
|
13105
|
+
* cruzado). dagre devuelve el CENTRO de cada nodo; `sol-flow-canvas`
|
|
13106
|
+
* posiciona por esquina superior izquierda (`resolvedPosition`/`nodeCenter`
|
|
13107
|
+
* en el componente) — la conversión ocurre acá, una sola vez.
|
|
13108
|
+
*/
|
|
13109
|
+
const NODE_WIDTH_PX$1 = 180;
|
|
13110
|
+
const NODE_HEIGHT_PX$1 = 56;
|
|
13111
|
+
/** Separación horizontal ENTRE columnas (gap, no distancia centro-a-centro) — mismo pitch visual aproximado que el placeholder anterior (220px de columna con nodos de 180px de ancho). */
|
|
13112
|
+
const RANK_SEP_PX = 60;
|
|
13113
|
+
/** Separación vertical entre nodos de la MISMA columna. */
|
|
13114
|
+
const NODE_SEP_PX = 70;
|
|
13115
|
+
/** Placeholder BFS-por-capas ORIGINAL de PR-C1 — mismo pitch visual que usaba antes de dagre. */
|
|
13116
|
+
const FALLBACK_COLUMN_GAP_PX = 220;
|
|
13117
|
+
const FALLBACK_ROW_GAP_PX = 120;
|
|
13118
|
+
/** Cache a nivel de MÓDULO (W3) — la primera llamada dispara el `import()`; las siguientes reusan la misma promesa. */
|
|
13119
|
+
let dagreModulePromise = null;
|
|
13120
|
+
function loadDagre() {
|
|
13121
|
+
if (!dagreModulePromise) {
|
|
13122
|
+
dagreModulePromise = import('@dagrejs/dagre');
|
|
13123
|
+
}
|
|
13124
|
+
return dagreModulePromise;
|
|
13125
|
+
}
|
|
13126
|
+
/**
|
|
13127
|
+
* Calcula una posición `{x,y}` (esquina superior izquierda, espacio canvas)
|
|
13128
|
+
* para CADA nodo de `nodes` — dagre cuando el chunk lazy carga y el layout
|
|
13129
|
+
* corre sin errores; el fallback BFS síncrono si cualquiera de los dos falla
|
|
13130
|
+
* (W2, "dagre sin red" — ver docstring del módulo). Aristas que referencian
|
|
13131
|
+
* un nodo ausente en `nodes` se ignoran (mismo criterio de robustez que
|
|
13132
|
+
* `visibleEdges()` del componente). Grafos con ciclos (incluidos self-loops,
|
|
13133
|
+
* ver `flow-canvas-layout.spec.ts`) NUNCA lanzan por sí solos — dagre los
|
|
13134
|
+
* rompe internamente (`acyclicer`) solo para calcular el ranking, sin mutar
|
|
13135
|
+
* el grafo de entrada de este módulo; el `try/catch` cubre fallas AJENAS al
|
|
13136
|
+
* grafo (carga del chunk, errores internos inesperados de la librería).
|
|
13137
|
+
*
|
|
13138
|
+
* Determinístico bajo AMBOS caminos: nodos/aristas se insertan/procesan en
|
|
13139
|
+
* un orden ESTABLE (ids ordenados alfabéticamente), nunca el orden de
|
|
13140
|
+
* inserción de `nodes`/`edges` — la MISMA entrada produce SIEMPRE la misma
|
|
13141
|
+
* salida. Normaliza el resultado al origen (nunca devuelve coordenadas
|
|
13142
|
+
* negativas), mismo criterio que `clampPosition` en `flow-canvas.component.ts`
|
|
13143
|
+
* (ese clamp sigue existiendo como red de seguridad en el punto de lectura).
|
|
13144
|
+
*
|
|
13145
|
+
* Robustez de entrada (mismo criterio que el resto de `@solercia/ui`):
|
|
13146
|
+
* `nodes`/`edges` toleran `null`/`undefined` sin lanzar.
|
|
13147
|
+
*/
|
|
13148
|
+
async function computeAutoLayoutPositions(nodes, edges) {
|
|
13149
|
+
const safeNodes = (nodes ?? []).filter((n) => !!n);
|
|
13150
|
+
const safeEdges = (edges ?? []).filter((e) => !!e);
|
|
13151
|
+
if (safeNodes.length === 0)
|
|
13152
|
+
return new Map();
|
|
13153
|
+
try {
|
|
13154
|
+
const { graphlib, layout: dagreLayout } = await loadDagre();
|
|
13155
|
+
return computeDagrePositions(graphlib, dagreLayout, safeNodes, safeEdges);
|
|
13156
|
+
}
|
|
13157
|
+
catch (err) {
|
|
13158
|
+
// W2 — el chunk lazy de dagre puede fallar a mitad de sesión (chunk 404
|
|
13159
|
+
// tras un deploy nuevo, offline, etc.); nunca deja al usuario sin ningún
|
|
13160
|
+
// layout, solo degrada al fallback BFS síncrono.
|
|
13161
|
+
console.warn('[sol-flow-canvas] auto-layout con dagre falló — se usa el fallback BFS por capas.', err);
|
|
13162
|
+
return computeLayeredFallbackPositions(safeNodes, safeEdges);
|
|
13163
|
+
}
|
|
13164
|
+
}
|
|
13165
|
+
function computeDagrePositions(graphlib, dagreLayout, safeNodes, safeEdges) {
|
|
13166
|
+
const idSet = new Set(safeNodes.map((n) => n.id));
|
|
13167
|
+
const sortedIds = [...idSet].sort(); // orden determinista, independiente del orden de inserción
|
|
13168
|
+
const graph = new graphlib.Graph();
|
|
13169
|
+
graph.setGraph({ rankdir: 'LR', nodesep: NODE_SEP_PX, ranksep: RANK_SEP_PX, marginx: 0, marginy: 0 });
|
|
13170
|
+
graph.setDefaultEdgeLabel(() => ({}));
|
|
13171
|
+
for (const id of sortedIds) {
|
|
13172
|
+
graph.setNode(id, { width: NODE_WIDTH_PX$1, height: NODE_HEIGHT_PX$1 });
|
|
13173
|
+
}
|
|
13174
|
+
const sortedEdges = safeEdges
|
|
13175
|
+
.filter((edge) => idSet.has(edge.sourceId) && idSet.has(edge.targetId))
|
|
13176
|
+
.sort((a, b) => (a.sourceId === b.sourceId ? a.targetId.localeCompare(b.targetId) : a.sourceId.localeCompare(b.sourceId)));
|
|
13177
|
+
for (const edge of sortedEdges) {
|
|
13178
|
+
graph.setEdge(edge.sourceId, edge.targetId);
|
|
13179
|
+
}
|
|
13180
|
+
dagreLayout(graph);
|
|
13181
|
+
const rawPositions = new Map();
|
|
13182
|
+
let minX = Number.POSITIVE_INFINITY;
|
|
13183
|
+
let minY = Number.POSITIVE_INFINITY;
|
|
13184
|
+
for (const id of sortedIds) {
|
|
13185
|
+
const box = graph.node(id);
|
|
13186
|
+
const topLeft = { x: box.x - NODE_WIDTH_PX$1 / 2, y: box.y - NODE_HEIGHT_PX$1 / 2 };
|
|
13187
|
+
rawPositions.set(id, topLeft);
|
|
13188
|
+
minX = Math.min(minX, topLeft.x);
|
|
13189
|
+
minY = Math.min(minY, topLeft.y);
|
|
13190
|
+
}
|
|
13191
|
+
const positions = new Map();
|
|
13192
|
+
for (const [id, position] of rawPositions) {
|
|
13193
|
+
positions.set(id, { x: position.x - minX, y: position.y - minY });
|
|
13194
|
+
}
|
|
13195
|
+
return positions;
|
|
13196
|
+
}
|
|
13197
|
+
/**
|
|
13198
|
+
* W2 (4R Ola 5 post PR-C3) — placeholder BFS-por-capas ORIGINAL de PR-C1,
|
|
13199
|
+
* conservado TAL CUAL (renombrado desde `computeAutoLayoutPositions` de
|
|
13200
|
+
* aquel PR): capas por BFS desde las raíces (nodos sin arista entrante), sin
|
|
13201
|
+
* minimizar cruces ni enrutar curvas. Sirve de fallback SÍNCRONO —
|
|
13202
|
+
* NUNCA depende de red — cuando el chunk lazy de dagre falla a mitad de
|
|
13203
|
+
* sesión ("dagre sin red").
|
|
13204
|
+
*
|
|
13205
|
+
* BFS de "primer toque gana" (NUNCA recalcula la profundidad de un nodo ya
|
|
13206
|
+
* visitado) a propósito: un layout por camino MÁS LARGO sería más prolijo en
|
|
13207
|
+
* grafos en diamante, pero puede DIVERGER en un ciclo LEGAL (p. ej. un nodo
|
|
13208
|
+
* de recolección que vuelve sobre sí mismo tras un `interrupt()` — ver
|
|
13209
|
+
* `FlowValidator._validate_cycles` en boki-ai) si se recalculara la
|
|
13210
|
+
* profundidad cada vez que se re-alcanza un nodo. BFS clásico visita cada
|
|
13211
|
+
* nodo UNA sola vez → termina siempre, incluso con ciclos (incluidos
|
|
13212
|
+
* self-loops).
|
|
13213
|
+
*/
|
|
13214
|
+
function computeLayeredFallbackPositions(nodes, edges) {
|
|
13215
|
+
const safeNodes = (nodes ?? []).filter((n) => !!n);
|
|
13216
|
+
const safeEdges = (edges ?? []).filter((e) => !!e);
|
|
13217
|
+
const ids = safeNodes.map((n) => n.id);
|
|
13218
|
+
const idSet = new Set(ids);
|
|
13219
|
+
const outgoing = new Map();
|
|
13220
|
+
const hasIncoming = new Set();
|
|
13221
|
+
for (const edge of safeEdges) {
|
|
13222
|
+
if (!idSet.has(edge.sourceId) || !idSet.has(edge.targetId))
|
|
13223
|
+
continue;
|
|
13224
|
+
const list = outgoing.get(edge.sourceId) ?? [];
|
|
13225
|
+
list.push(edge.targetId);
|
|
13226
|
+
outgoing.set(edge.sourceId, list);
|
|
13227
|
+
hasIncoming.add(edge.targetId);
|
|
13228
|
+
}
|
|
13229
|
+
const roots = ids.filter((id) => !hasIncoming.has(id));
|
|
13230
|
+
const seeds = [...(roots.length > 0 ? roots : ids)].sort(); // orden determinista, independiente del orden de inserción
|
|
13231
|
+
const depthOf = new Map();
|
|
13232
|
+
const queue = [];
|
|
13233
|
+
for (const seed of seeds) {
|
|
13234
|
+
if (depthOf.has(seed))
|
|
13235
|
+
continue;
|
|
13236
|
+
depthOf.set(seed, 0);
|
|
13237
|
+
queue.push(seed);
|
|
13238
|
+
}
|
|
13239
|
+
while (queue.length > 0) {
|
|
13240
|
+
const current = queue.shift();
|
|
13241
|
+
const depth = depthOf.get(current);
|
|
13242
|
+
for (const next of outgoing.get(current) ?? []) {
|
|
13243
|
+
if (depthOf.has(next))
|
|
13244
|
+
continue; // primer toque gana — ver docstring de la función (evita divergir en ciclos)
|
|
13245
|
+
depthOf.set(next, depth + 1);
|
|
13246
|
+
queue.push(next);
|
|
13247
|
+
}
|
|
13248
|
+
}
|
|
13249
|
+
for (const id of ids) {
|
|
13250
|
+
if (!depthOf.has(id))
|
|
13251
|
+
depthOf.set(id, 0); // inalcanzable desde cualquier raíz (grafo desconectado): columna propia
|
|
13252
|
+
}
|
|
13253
|
+
const byDepth = new Map();
|
|
13254
|
+
for (const id of ids) {
|
|
13255
|
+
const depth = depthOf.get(id);
|
|
13256
|
+
const bucket = byDepth.get(depth) ?? [];
|
|
13257
|
+
bucket.push(id);
|
|
13258
|
+
byDepth.set(depth, bucket);
|
|
13259
|
+
}
|
|
13260
|
+
const positions = new Map();
|
|
13261
|
+
for (const [depth, bucket] of byDepth) {
|
|
13262
|
+
const ordered = [...bucket].sort(); // filas deterministas dentro de la misma columna
|
|
13263
|
+
ordered.forEach((id, index) => {
|
|
13264
|
+
positions.set(id, { x: depth * FALLBACK_COLUMN_GAP_PX, y: index * FALLBACK_ROW_GAP_PX });
|
|
13265
|
+
});
|
|
13266
|
+
}
|
|
13267
|
+
return positions;
|
|
13268
|
+
}
|
|
13269
|
+
/**
|
|
13270
|
+
* Frecuencia de `id` entre los nodos actuales — soporte de {@link safeTrackKey}
|
|
13271
|
+
* (fix NG0955 con id duplicado/ausente). Duplicado A PROPÓSITO de
|
|
13272
|
+
* `ui/kanban/kanban-track.ts`/`ui/timeline`/`ui/calendar` (mismo criterio ya
|
|
13273
|
+
* documentado en `calendar-grid.component.ts::observeMobileViewport`): cada
|
|
13274
|
+
* componente de `@solercia/ui` que necesita esto mantiene su propia copia
|
|
13275
|
+
* mínima en vez de crear un acoplamiento cruzado entre carpetas de `ui/*`.
|
|
13276
|
+
*/
|
|
13277
|
+
function countNodeIds(nodes) {
|
|
13278
|
+
const frequency = new Map();
|
|
13279
|
+
for (const node of nodes) {
|
|
13280
|
+
if (!node)
|
|
13281
|
+
continue;
|
|
13282
|
+
frequency.set(node.id, (frequency.get(node.id) ?? 0) + 1);
|
|
13283
|
+
}
|
|
13284
|
+
return frequency;
|
|
13285
|
+
}
|
|
13286
|
+
/** `track` seguro: cae al índice si el id está ausente o duplicado. */
|
|
13287
|
+
function safeTrackKey(id, index, frequency) {
|
|
13288
|
+
if (id === undefined || id === null || (frequency.get(id) ?? 0) > 1)
|
|
13289
|
+
return index;
|
|
13290
|
+
return id;
|
|
13291
|
+
}
|
|
13292
|
+
/**
|
|
13293
|
+
* Frecuencia de `id` entre las edges actuales — soporte de {@link safeTrackKey}
|
|
13294
|
+
* aplicado a las aristas (fix NG0955 con id duplicado — antes solo los nodos
|
|
13295
|
+
* tenían este resguardo; C2, 4R Ola 5). Copia mínima A PROPÓSITO de
|
|
13296
|
+
* {@link countNodeIds} sobre una colección distinta (edges, no nodos) — mismo
|
|
13297
|
+
* criterio de duplicación deliberada documentado arriba.
|
|
13298
|
+
*/
|
|
13299
|
+
function countEdgeIds(edges) {
|
|
13300
|
+
const frequency = new Map();
|
|
13301
|
+
for (const edge of edges) {
|
|
13302
|
+
if (!edge)
|
|
13303
|
+
continue;
|
|
13304
|
+
frequency.set(edge.id, (frequency.get(edge.id) ?? 0) + 1);
|
|
13305
|
+
}
|
|
13306
|
+
return frequency;
|
|
13307
|
+
}
|
|
13308
|
+
|
|
13309
|
+
const DEFAULT_VIEWPORT = { panX: 0, panY: 0, zoom: 1 };
|
|
13310
|
+
/**
|
|
13311
|
+
* Rango de zoom — mismo orden de magnitud que herramientas comparables
|
|
13312
|
+
* (n8n/Figma rondan 0.2x–2x/4x); 0.25x–2.5x cubre "ver el flujo completo"
|
|
13313
|
+
* (decenas de nodos) hasta "leer el detalle de un nodo" sin permitir un zoom
|
|
13314
|
+
* tan extremo que el drag/las curvas bezier se vuelvan imprecisos.
|
|
13315
|
+
*/
|
|
13316
|
+
const MIN_ZOOM = 0.25;
|
|
13317
|
+
const MAX_ZOOM = 2.5;
|
|
13318
|
+
/** Sensibilidad exponencial de la rueda — un solo "tick" típico (~100 unidades de deltaY) mueve el zoom ~10%. */
|
|
13319
|
+
const WHEEL_ZOOM_SENSITIVITY = 0.001;
|
|
13320
|
+
function clampZoom(zoom) {
|
|
13321
|
+
return Math.min(MAX_ZOOM, Math.max(MIN_ZOOM, zoom));
|
|
13322
|
+
}
|
|
13323
|
+
function screenToWorld(viewport, screenPoint) {
|
|
13324
|
+
return {
|
|
13325
|
+
x: (screenPoint.x - viewport.panX) / viewport.zoom,
|
|
13326
|
+
y: (screenPoint.y - viewport.panY) / viewport.zoom,
|
|
13327
|
+
};
|
|
13328
|
+
}
|
|
13329
|
+
function worldToScreen(viewport, worldPoint) {
|
|
13330
|
+
return {
|
|
13331
|
+
x: worldPoint.x * viewport.zoom + viewport.panX,
|
|
13332
|
+
y: worldPoint.y * viewport.zoom + viewport.panY,
|
|
13333
|
+
};
|
|
13334
|
+
}
|
|
13335
|
+
/**
|
|
13336
|
+
* Cambia el zoom a `nextZoomRaw` (clampeado) recalculando el pan para que
|
|
13337
|
+
* `screenAnchor` (p. ej. la posición del cursor o el punto medio de un pinch)
|
|
13338
|
+
* quede EXACTAMENTE en el mismo punto `world` antes y después — "zoom hacia
|
|
13339
|
+
* el cursor", el mismo criterio que cualquier editor de canvas (Figma, n8n).
|
|
13340
|
+
*/
|
|
13341
|
+
function zoomAtScreenPoint(viewport, screenAnchor, nextZoomRaw) {
|
|
13342
|
+
const nextZoom = clampZoom(nextZoomRaw);
|
|
13343
|
+
if (nextZoom === viewport.zoom)
|
|
13344
|
+
return viewport; // sin cambio real: evita objetos nuevos y una división innecesaria
|
|
13345
|
+
const worldAnchor = screenToWorld(viewport, screenAnchor);
|
|
13346
|
+
return {
|
|
13347
|
+
zoom: nextZoom,
|
|
13348
|
+
panX: screenAnchor.x - worldAnchor.x * nextZoom,
|
|
13349
|
+
panY: screenAnchor.y - worldAnchor.y * nextZoom,
|
|
13350
|
+
};
|
|
13351
|
+
}
|
|
13352
|
+
/**
|
|
13353
|
+
* `deltaY` crudo de un `WheelEvent` — negativo (scroll "hacia adelante"/rueda
|
|
13354
|
+
* arriba en la mayoría de mice) ACERCA, mismo sentido que Figma/n8n/Google
|
|
13355
|
+
* Maps. Factor exponencial (no lineal): mantiene la sensación de "porcentaje
|
|
13356
|
+
* relativo" constante sea cual sea el zoom actual.
|
|
13357
|
+
*/
|
|
13358
|
+
function computeWheelZoom(viewport, deltaY, screenAnchor) {
|
|
13359
|
+
const factor = Math.exp(-deltaY * WHEEL_ZOOM_SENSITIVITY);
|
|
13360
|
+
return zoomAtScreenPoint(viewport, screenAnchor, viewport.zoom * factor);
|
|
13361
|
+
}
|
|
13362
|
+
/**
|
|
13363
|
+
* Arrastre del FONDO — delta en coordenadas "screen" (pantalla), aplicado
|
|
13364
|
+
* DIRECTO al pan sin dividir por zoom: el fondo debe seguir al dedo/cursor 1:1
|
|
13365
|
+
* en píxeles de pantalla sin importar el zoom actual (mismo criterio que
|
|
13366
|
+
* paneas cualquier mapa/editor — solo el contenido ESCALADO se mueve más o
|
|
13367
|
+
* menos "rápido" en unidades world, el pan en sí es puramente de pantalla).
|
|
13368
|
+
*/
|
|
13369
|
+
function panBy(viewport, screenDelta) {
|
|
13370
|
+
return { ...viewport, panX: viewport.panX + screenDelta.x, panY: viewport.panY + screenDelta.y };
|
|
13371
|
+
}
|
|
13372
|
+
function distanceBetween(a, b) {
|
|
13373
|
+
return Math.hypot(b.x - a.x, b.y - a.y);
|
|
13374
|
+
}
|
|
13375
|
+
function midpoint(a, b) {
|
|
13376
|
+
return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
|
|
13377
|
+
}
|
|
13378
|
+
/**
|
|
13379
|
+
* Pinch de dos punteros (touch): la RAZÓN entre la distancia actual y la
|
|
13380
|
+
* anterior entre los dos punteros define el factor de zoom incremental —
|
|
13381
|
+
* separar los dedos (distancia crece) acerca, juntarlos aleja. `screenAnchor`
|
|
13382
|
+
* es el punto medio ACTUAL de los dos punteros (se recalcula en cada
|
|
13383
|
+
* `pointermove` — el componente pasa el punto medio vigente, no el inicial,
|
|
13384
|
+
* para que el ancla del zoom siga a los dedos igual que un pinch real).
|
|
13385
|
+
*/
|
|
13386
|
+
function computePinchZoom(viewport, previousDistance, currentDistance, screenAnchor) {
|
|
13387
|
+
if (previousDistance <= 0)
|
|
13388
|
+
return viewport; // defensivo: sin distancia previa válida, no hay razón que calcular
|
|
13389
|
+
const ratio = currentDistance / previousDistance;
|
|
13390
|
+
return zoomAtScreenPoint(viewport, screenAnchor, viewport.zoom * ratio);
|
|
13391
|
+
}
|
|
13392
|
+
/** Margen (px de PANTALLA) que deja `panToRevealWorldRect` entre el borde del rect revelado y el borde del viewport. */
|
|
13393
|
+
const REVEAL_MARGIN_PX = 24;
|
|
13394
|
+
/**
|
|
13395
|
+
* Ajusta el PAN (nunca el zoom — evita saltos de escala inesperados al tabular) para que `worldRect`
|
|
13396
|
+
* quede completamente visible dentro de un viewport de pantalla de `viewportSize`, con
|
|
13397
|
+
* {@link REVEAL_MARGIN_PX} de margen. No-op si `worldRect` ya es completamente visible, o si
|
|
13398
|
+
* `viewportSize` no tiene un tamaño medible todavía (0×0 — p. ej. antes del primer layout real; nunca
|
|
13399
|
+
* lanza ni produce NaN).
|
|
13400
|
+
*
|
|
13401
|
+
* Motivación (PR-C2B, W-fix): el shell de PR-C1 usaba `overflow: auto` — el navegador hacía
|
|
13402
|
+
* "scroll into view" GRATIS cuando el foco de teclado (Tab) llegaba a un nodo fuera del viewport
|
|
13403
|
+
* visible. `sol-flow-canvas` reemplaza ese scroll nativo por `overflow: hidden` + pan/zoom propio (`transform`)
|
|
13404
|
+
* — sin este ajuste, Tab movería el foco LÓGICO sin revelarlo visualmente, una regresión real de
|
|
13405
|
+
* accesibilidad (ver Learned del reporte de fase PR-C2B).
|
|
13406
|
+
*/
|
|
13407
|
+
function panToRevealWorldRect(viewport, worldRect, viewportSize, margin = REVEAL_MARGIN_PX) {
|
|
13408
|
+
if (viewportSize.width <= 0 || viewportSize.height <= 0)
|
|
13409
|
+
return viewport; // sin tamaño medible: no hay decisión segura que tomar
|
|
13410
|
+
const topLeft = worldToScreen(viewport, { x: worldRect.x, y: worldRect.y });
|
|
13411
|
+
const bottomRight = worldToScreen(viewport, { x: worldRect.x + worldRect.width, y: worldRect.y + worldRect.height });
|
|
13412
|
+
const dx = axisRevealDelta(topLeft.x, bottomRight.x, viewportSize.width, margin);
|
|
13413
|
+
const dy = axisRevealDelta(topLeft.y, bottomRight.y, viewportSize.height, margin);
|
|
13414
|
+
if (dx === 0 && dy === 0)
|
|
13415
|
+
return viewport;
|
|
13416
|
+
return panBy(viewport, { x: dx, y: dy });
|
|
13417
|
+
}
|
|
13418
|
+
/** Delta de pan de UN eje — prioriza revelar el borde de INICIO (top/left) si el rect no cabe entero entre los dos márgenes (rect más grande que el viewport visible). */
|
|
13419
|
+
function axisRevealDelta(startScreen, endScreen, viewportLength, margin) {
|
|
13420
|
+
if (startScreen < margin)
|
|
13421
|
+
return margin - startScreen;
|
|
13422
|
+
if (endScreen > viewportLength - margin)
|
|
13423
|
+
return viewportLength - margin - endScreen;
|
|
13424
|
+
return 0;
|
|
13425
|
+
}
|
|
13426
|
+
|
|
13427
|
+
/** Tamaño supuesto de un nodo para calcular el punto medio de las aristas (el motor no mide el DOM real). */
|
|
13428
|
+
const NODE_WIDTH_PX = 180;
|
|
13429
|
+
const NODE_HEIGHT_PX = 56;
|
|
13430
|
+
/** Un gesto de pointerdown→pointerup con menos desplazamiento de PANTALLA que esto se trata como click, no como arrastre (mouse/pen: precisión motora alta). */
|
|
13431
|
+
const DRAG_THRESHOLD_PX = 4;
|
|
13432
|
+
/**
|
|
13433
|
+
* PR-C4 (GOAL §4, móvil) — hallazgo real del e2e móvil (`e2e/flows/
|
|
13434
|
+
* flows-mobile.spec.ts`): un TAP real de dedo (`pointerType: 'touch'`)
|
|
13435
|
+
* reporta varios px de "temblor" incluso inmóvil — el umbral de 4px
|
|
13436
|
+
* (afinado para mouse) clasificaba un tap normal como arrastre, y
|
|
13437
|
+
* `onNodeActivate` descartaba el click siguiente (`lastGestureWasDrag`),
|
|
13438
|
+
* dejando el nodo SIN abrir su editor. Slop más generoso, mismo orden de
|
|
13439
|
+
* magnitud que el "touch slop" estándar de las plataformas (Android
|
|
13440
|
+
* `ViewConfiguration.getScaledTouchSlop()` ~8dp, iOS ~10pt) — ver
|
|
13441
|
+
* {@link dragThresholdFor}.
|
|
13442
|
+
*/
|
|
13443
|
+
const DRAG_THRESHOLD_PX_TOUCH = 10;
|
|
13444
|
+
/**
|
|
13445
|
+
* Umbral clic-vs-arrastre según el tipo de puntero del evento — ver
|
|
13446
|
+
* {@link DRAG_THRESHOLD_PX}/{@link DRAG_THRESHOLD_PX_TOUCH}. Solo
|
|
13447
|
+
* `pointerType === 'touch'` (yema de un dedo) cae al umbral TÁCTIL más
|
|
13448
|
+
* permisivo — `'pen'` (lápiz óptico/stylus) usa el mismo umbral de
|
|
13449
|
+
* PRECISIÓN que `'mouse'` a propósito (WARNING, 4R post PR-C4): la punta de
|
|
13450
|
+
* un lápiz ofrece la misma precisión motora que un cursor de mouse
|
|
13451
|
+
* (contacto puntual, sin el "temblor" natural de una yema de dedo que
|
|
13452
|
+
* motiva el slop táctil más generoso — ver el JSDoc de
|
|
13453
|
+
* {@link DRAG_THRESHOLD_PX_TOUCH}), mismo criterio que el "touch slop"
|
|
13454
|
+
* diferenciado de las plataformas nativas (Android distingue
|
|
13455
|
+
* `MotionEvent.TOOL_TYPE_STYLUS` de `TOOL_TYPE_FINGER`, con un slop menor
|
|
13456
|
+
* para el primero).
|
|
13457
|
+
*/
|
|
13458
|
+
function dragThresholdFor(event) {
|
|
13459
|
+
return event.pointerType === 'touch' ? DRAG_THRESHOLD_PX_TOUCH : DRAG_THRESHOLD_PX;
|
|
13460
|
+
}
|
|
13461
|
+
/** Paso de cada nudge por teclado (paridad a11y del arrastre) — fijo en espacio CANVAS, independiente del zoom (ver docstring de {@link onNodeKeydown}). */
|
|
13462
|
+
const KEYBOARD_NUDGE_STEP_PX = 10;
|
|
13463
|
+
const ARROW_KEY_DELTA = {
|
|
13464
|
+
ArrowUp: { x: 0, y: -1 },
|
|
13465
|
+
ArrowDown: { x: 0, y: 1 },
|
|
13466
|
+
ArrowLeft: { x: -1, y: 0 },
|
|
13467
|
+
ArrowRight: { x: 1, y: 0 },
|
|
13468
|
+
};
|
|
13469
|
+
let uniqueMarkerCounter = 0;
|
|
13470
|
+
/** El origen (0,0) del lienzo es un límite real — un contenedor `overflow: auto` no tiene scroll negativo, así que ningún nodo debe commitear ni mostrarse en coordenadas negativas (W4, 4R Ola 5). */
|
|
13471
|
+
function clampPosition(position) {
|
|
13472
|
+
return { x: Math.max(0, position.x), y: Math.max(0, position.y) };
|
|
13473
|
+
}
|
|
13474
|
+
/**
|
|
13475
|
+
* `sol-flow-canvas` — contrato AGNÓSTICO del motor de un lienzo tipo n8n
|
|
13476
|
+
* (Ola 5, `openspec/GOAL-ola5-flow-canvas-y-cutover.md` §4).
|
|
13477
|
+
*
|
|
13478
|
+
* API PÚBLICA ESTABLE (inputs/outputs/`autoLayout()`/proyección de
|
|
13479
|
+
* template): esta clase NUNCA cambia su contrato público entre bake-offs —
|
|
13480
|
+
* solo el INTERIOR de la implementación difiere.
|
|
13481
|
+
*
|
|
13482
|
+
* **Esta es la implementación de PR-C2B** (motor nativo SVG + Pointer Events,
|
|
13483
|
+
* CDK evaluado y descartado — ver `Learned` del reporte de fase: ni
|
|
13484
|
+
* `DragDropModule` ni `ScrollingModule` aportan algo que Pointer Events +
|
|
13485
|
+
* `transform` no resuelvan mejor para un lienzo 2D con pan/zoom propio, y el
|
|
13486
|
+
* arrastre de nodos YA usaba Pointer Events nativos desde PR-C1 — "CDK
|
|
13487
|
+
* reservado a `ui/kanban/`"). Reemplaza el interior MÍNIMO del shell de
|
|
13488
|
+
* PR-C1 (render absoluto estático + líneas rectas, sin pan/zoom) por:
|
|
13489
|
+
* - **Pan/zoom del lienzo**: arrastrar el FONDO panea; rueda/pinch de dos
|
|
13490
|
+
* punteros hace zoom anclado al cursor/punto medio. Un único `transform:
|
|
13491
|
+
* translate(pan) scale(zoom)` sobre `.sol-flow-canvas__world` (grupo
|
|
13492
|
+
* interno que envuelve edges+nodos) — ver {@link worldTransform} y
|
|
13493
|
+
* `flow-canvas-viewport.ts` (puro, sin Angular). El pan/zoom es una
|
|
13494
|
+
* cuestión de VISTA, no de dominio — sigue activo en `readonly` (a
|
|
13495
|
+
* diferencia de arrastrar/conectar/quitar, que sí quedan bloqueados).
|
|
13496
|
+
* `overflow: hidden` (necesario para que rueda/pinch no peleen con el
|
|
13497
|
+
* scroll nativo) reemplaza el "scroll into view" gratis que traía
|
|
13498
|
+
* `overflow: auto` del shell de PR-C1 — {@link onNodeFocus} lo restituye
|
|
13499
|
+
* paneando (nunca zoom) hacia cualquier nodo que reciba foco (Tab) fuera
|
|
13500
|
+
* del área visible. La rueda/el pinch corren de forma INDEPENDIENTE de un
|
|
13501
|
+
* arrastre de nodo en curso — a propósito (C1, 4R Ola 5): ver el JSDoc de
|
|
13502
|
+
* {@link onNodePointerMove} para el porqué y el fix del bug asociado.
|
|
13503
|
+
* - **Aristas bezier**: curvas cúbicas con dirección horizontal (favorecen
|
|
13504
|
+
* el layout BFS-por-columnas de `flow-canvas-layout.ts`) en vez de líneas
|
|
13505
|
+
* rectas — ver `flow-canvas-edge-geometry.ts` (puro). El label de cada
|
|
13506
|
+
* arista se posiciona sobre el punto real de la curva (t=0.5), no sobre
|
|
13507
|
+
* el punto medio de una recta.
|
|
13508
|
+
* - **Tap-para-conectar refinado**: la MECÁNICA sigue siendo la de PR-C1
|
|
13509
|
+
* (arma origen → activa destino, API de eventos sin cambios) — el
|
|
13510
|
+
* refinamiento es puramente VISUAL: mientras está armado, los destinos
|
|
13511
|
+
* VÁLIDOS (sin auto-loop, sin duplicar una conexión existente, sin cerrar
|
|
13512
|
+
* un ciclo — ver `flow-canvas-connect.ts`, puro) se resaltan y una curva
|
|
13513
|
+
* FANTASMA sigue al cursor desde el nodo origen. Es un HINT visual, NUNCA
|
|
13514
|
+
* bloquea la conexión — el validador real de dominio (`entities/flow`,
|
|
13515
|
+
* fuera de esta librería agnóstica) sigue siendo la fuente de verdad.
|
|
13516
|
+
*
|
|
13517
|
+
* **PR-C4 (GOAL §4, móvil) — 3 hallazgos de auditoría + 2 adiciones**:
|
|
13518
|
+
* 1. **Pointer Events unificados**: auditado — CERO `mouse*`/`touch*` en
|
|
13519
|
+
* este componente (ni en `flow-canvas-viewport.ts`/`-connect.ts`/
|
|
13520
|
+
* `-edge-geometry.ts`/`-layout.ts`, ni en los widgets/página consumidores
|
|
13521
|
+
* de PR-C3) — el motor YA es 100% Pointer Events desde el bake-off
|
|
13522
|
+
* (C2B). Nada que unificar.
|
|
13523
|
+
* 2. **Targets ≥44px con hit-area invisible, zoom-invariante (CRITICAL +
|
|
13524
|
+
* WARNING corregidos en la re-auditoría 4R post PR-C4)**:
|
|
13525
|
+
* `.sol-flow-canvas__node-connect-handle` (28px→`--sol-flow-canvas-hit-
|
|
13526
|
+
* min` real, `align-self:center` para no estirarse con node-surface),
|
|
13527
|
+
* `.sol-flow-canvas__node-surface` (min-height:`--sol-flow-canvas-hit-
|
|
13528
|
+
* min`) y `.sol-flow-canvas__edge-remove` (`width`/`height` fijos a
|
|
13529
|
+
* `--sol-flow-canvas-hit-min`, margin negativo EXACTAMENTE igual y
|
|
13530
|
+
* opuesto por lado — el hijo sigue "pesando" 13×13px dentro del flex de
|
|
13531
|
+
* la píldora, el tamaño "de siempre", así que ésta no se agranda
|
|
13532
|
+
* visualmente) — los 3 alcanzan ≥44px FÍSICOS reales a CUALQUIER zoom
|
|
13533
|
+
* del rango (0.25x-2.5x, `flow-canvas-viewport.ts`), no solo a zoom=1:
|
|
13534
|
+
* `--sol-flow-canvas-zoom` (seteado en el binding del host) compensa el
|
|
13535
|
+
* `scale(zoom)` de `.sol-flow-canvas__world` — CRITICAL de la
|
|
13536
|
+
* re-auditoría: sin esta compensación, un piso de 44px CSS encogía a
|
|
13537
|
+
* ~22-29px FÍSICOS a ~0.5x (medido real con Playwright `boundingBox()`,
|
|
13538
|
+
* ver `e2e/flows/flows-mobile.spec.ts`, FLOW-E2E-M04/M05, y los tests de
|
|
13539
|
+
* `flow-canvas.component.spec.ts` que cubren el binding `--sol-flow-
|
|
13540
|
+
* canvas-zoom`).
|
|
13541
|
+
* 3. **Resaltado "solo válidos"**: auditado — el hint YA distingue
|
|
13542
|
+
* `--connect-valid-target` (resalta, borde+glow verde) de
|
|
13543
|
+
* `--connect-invalid-target` (SOLO atenúa, `opacity:0.45`, sin color
|
|
13544
|
+
* propio) desde PR-C2B/C3 — ya cumple el texto literal del GOAL
|
|
13545
|
+
* ("resaltan SOLO destinos válidos"). Sin cambio de CSS/lógica; el
|
|
13546
|
+
* aria-live del conteo (PR-C3) se conserva sin tocar.
|
|
13547
|
+
* 4. **Auto-layout siempre visible en móvil**: botón flotante nuevo
|
|
13548
|
+
* (`.sol-flow-canvas__auto-layout`, oculto en desktop vía
|
|
13549
|
+
* `@media (max-width:767px)`) que invoca `autoLayout()` — ver
|
|
13550
|
+
* {@link onAutoLayoutClick}.
|
|
13551
|
+
* 5. **Bottom sheet móvil**: vive en `sol-drawer` (variant `sheet`, nueva),
|
|
13552
|
+
* NO en este componente — `flow-node-editor-drawer` (boki-front) es
|
|
13553
|
+
* quien la activa.
|
|
13554
|
+
*
|
|
13555
|
+
* Interacciones (documentadas porque el GESTO concreto es decisión de cada
|
|
13556
|
+
* motor del bake-off — la suite de aceptación compartida prueba la API, no
|
|
13557
|
+
* el gesto):
|
|
13558
|
+
* - **Selección**: cada nodo es un `<button>` real — click nativo, y
|
|
13559
|
+
* Enter/Espacio manejados de forma EXPLÍCITA en `onNodeKeydown` (W6, 4R
|
|
13560
|
+
* Ola 5: NO se delega en la activación nativa del navegador sobre el
|
|
13561
|
+
* botón). Ambos caminos emiten `nodeSelected` de la MISMA forma.
|
|
13562
|
+
* - **Mover un nodo (mouse)**: `pointerdown`→`pointermove`→`pointerup`
|
|
13563
|
+
* sobre el nodo. El umbral clic-vs-arrastre ({@link DRAG_THRESHOLD_PX}) se
|
|
13564
|
+
* mide en PANTALLA (PR-C2B: precisión motora humana, zoom-invariante — NO
|
|
13565
|
+
* en espacio canvas, que sería más permisivo alejado y más estricto
|
|
13566
|
+
* acercado). Un `pointerdown` sobre un nodo NUNCA burbujea a convertirse
|
|
13567
|
+
* además en un pan de fondo (`stopPropagation` explícito). El delta de
|
|
13568
|
+
* pantalla→canvas se acumula por SEGMENTO con el zoom vigente de cada
|
|
13569
|
+
* `pointermove` (C1, 4R Ola 5) — un cambio de zoom a mitad de gesto (rueda
|
|
13570
|
+
* del mouse sostenido, o pinch de fondo concurrente) nunca corrompe el
|
|
13571
|
+
* tramo ya recorrido, ver {@link onNodePointerMove}.
|
|
13572
|
+
* - **Mover un nodo (teclado)**: flechas sobre el nodo enfocado — nudge de
|
|
13573
|
+
* {@link KEYBOARD_NUDGE_STEP_PX}px FIJOS en espacio canvas (el zoom NUNCA
|
|
13574
|
+
* afecta el paso — a11y: la navegación por teclado es predecible sin
|
|
13575
|
+
* importar cuánto esté acercado el lienzo).
|
|
13576
|
+
* - **Crear conexión**: cada nodo tiene un botón "conectar desde" — al
|
|
13577
|
+
* activarlo arma el origen; activar OTRO nodo completa la conexión
|
|
13578
|
+
* (`connectionCreated`). Activar el MISMO nodo, o `Escape`, cancela el
|
|
13579
|
+
* modo.
|
|
13580
|
+
* - **Quitar conexión**: botón "×" sobre la etiqueta de cada arista.
|
|
13581
|
+
* - **`readonly`**: oculta/deshabilita TODA mutación del GRAFO (arrastre,
|
|
13582
|
+
* nudge, conectar, quitar) — la selección y el pan/zoom siguen activos
|
|
13583
|
+
* (no son mutaciones del grafo).
|
|
13584
|
+
*
|
|
13585
|
+
* Espejo interno (`mirroredNodes`, mismo patrón que `sol-kanban-board`):
|
|
13586
|
+
* mantiene una copia propia de `nodes()`, re-sembrada en cada cambio del
|
|
13587
|
+
* input, mutada LOCALMENTE en cada interacción (feedback visual inmediato)
|
|
13588
|
+
* y SIEMPRE acompañada del output correspondiente para que el consumidor
|
|
13589
|
+
* persista.
|
|
13590
|
+
*/
|
|
13591
|
+
class SolFlowCanvasComponent {
|
|
13592
|
+
i18n = inject(SOL_I18N);
|
|
13593
|
+
/** Tolera `null`/`undefined` (lección PR3/PR4 del resto de la lib): un input no garantiza un valor no-nulo en runtime. */
|
|
13594
|
+
nodes = input([], /* @ts-ignore */
|
|
13595
|
+
...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
|
|
13596
|
+
edges = input([], /* @ts-ignore */
|
|
13597
|
+
...(ngDevMode ? [{ debugName: "edges" }] : /* istanbul ignore next */ []));
|
|
13598
|
+
/**
|
|
13599
|
+
* Alias `readonly` (nombre público exacto que pide el contrato) — la
|
|
13600
|
+
* propiedad TS se llama `isReadonly` a propósito: `readonly` es palabra
|
|
13601
|
+
* reservada como MODIFICADOR de miembro de clase.
|
|
13602
|
+
*/
|
|
13603
|
+
isReadonly = input(false, { ...(ngDevMode ? { debugName: "isReadonly" } : /* istanbul ignore next */ {}), alias: 'readonly' });
|
|
13604
|
+
selectedId = input(null, /* @ts-ignore */
|
|
13605
|
+
...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
|
|
13606
|
+
highlightedNodeId = input(null, /* @ts-ignore */
|
|
13607
|
+
...(ngDevMode ? [{ debugName: "highlightedNodeId" }] : /* istanbul ignore next */ []));
|
|
13608
|
+
/** Sin este, cada nodo cae a mostrar solo `label` (mismo patrón que `eventTemplate` de `sol-calendar-grid`). */
|
|
13609
|
+
nodeTemplate = input(null, /* @ts-ignore */
|
|
13610
|
+
...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
|
|
13611
|
+
nodeMoved = output();
|
|
13612
|
+
nodeSelected = output();
|
|
13613
|
+
connectionCreated = output();
|
|
13614
|
+
connectionRemoved = output();
|
|
13615
|
+
mirroredNodes = signal([], /* @ts-ignore */
|
|
13616
|
+
...(ngDevMode ? [{ debugName: "mirroredNodes" }] : /* istanbul ignore next */ []));
|
|
13617
|
+
connectSourceId = signal(null, /* @ts-ignore */
|
|
13618
|
+
...(ngDevMode ? [{ debugName: "connectSourceId" }] : /* istanbul ignore next */ []));
|
|
13619
|
+
announcement = signal('', /* @ts-ignore */
|
|
13620
|
+
...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
13621
|
+
markerId = `sol-flow-canvas-arrow-${uniqueMarkerCounter++}`;
|
|
13622
|
+
/** Estado del viewport (pan/zoom) — PR-C2B. Es una cuestión de VISTA: nunca se bloquea en `readonly` ni se resetea cuando cambian `nodes()`/`edges()`. */
|
|
13623
|
+
viewport = signal(DEFAULT_VIEWPORT, /* @ts-ignore */
|
|
13624
|
+
...(ngDevMode ? [{ debugName: "viewport" }] : /* istanbul ignore next */ []));
|
|
13625
|
+
/** Posición (espacio world) del puntero mientras hay una conexión armada — alimenta la curva fantasma. `null` = sin curva que dibujar. */
|
|
13626
|
+
ghostPointerWorld = signal(null, /* @ts-ignore */
|
|
13627
|
+
...(ngDevMode ? [{ debugName: "ghostPointerWorld" }] : /* istanbul ignore next */ []));
|
|
13628
|
+
/** Referencia al host `.sol-flow-canvas` — solo para medir su tamaño real (`getBoundingClientRect()`) en {@link onNodeFocus}/{@link canvasRelativePoint}, nunca para mutar el DOM a mano. */
|
|
13629
|
+
canvasHostRef = viewChild.required('canvasHost', /* @ts-ignore */
|
|
13630
|
+
...(ngDevMode ? [{ debugName: "canvasHostRef" }] : /* istanbul ignore next */ []));
|
|
13631
|
+
dragState = null;
|
|
13632
|
+
lastGestureWasDrag = false;
|
|
13633
|
+
/** Punteros activos que arrancaron sobre el FONDO (nunca sobre un nodo — ver `stopPropagation` en {@link onNodePointerDown}) — 1 puntero = pan, 2 = pinch. */
|
|
13634
|
+
backgroundPointers = new Map();
|
|
13635
|
+
nodesById = computed(() => new Map(this.mirroredNodes().map((node) => [node.id, node])), /* @ts-ignore */
|
|
13636
|
+
...(ngDevMode ? [{ debugName: "nodesById" }] : /* istanbul ignore next */ []));
|
|
13637
|
+
visibleEdges = computed(() => {
|
|
13638
|
+
const byId = this.nodesById();
|
|
13639
|
+
return (this.edges() ?? []).filter((edge) => !!edge && byId.has(edge.sourceId) && byId.has(edge.targetId));
|
|
13640
|
+
}, /* @ts-ignore */
|
|
13641
|
+
...(ngDevMode ? [{ debugName: "visibleEdges" }] : /* istanbul ignore next */ []));
|
|
13642
|
+
/** Destinos válidos del origen armado (sin auto-loop, sin duplicar, sin cerrar un ciclo — ver `flow-canvas-connect.ts`). Set vacío sin conexión armada. */
|
|
13643
|
+
validConnectTargetIds = computed(() => {
|
|
13644
|
+
const sourceId = this.connectSourceId();
|
|
13645
|
+
if (sourceId === null)
|
|
13646
|
+
return new Set();
|
|
13647
|
+
return computeValidConnectionTargets(this.mirroredNodes(), this.visibleEdges(), sourceId);
|
|
13648
|
+
}, /* @ts-ignore */
|
|
13649
|
+
...(ngDevMode ? [{ debugName: "validConnectTargetIds" }] : /* istanbul ignore next */ []));
|
|
13650
|
+
/** `translate(pan) scale(zoom)` — mismo criterio que `flow-canvas-viewport.ts::worldToScreen` (world se escala primero, se traslada después). */
|
|
13651
|
+
worldTransform = computed(() => {
|
|
13652
|
+
const vp = this.viewport();
|
|
13653
|
+
return `translate(${vp.panX}px, ${vp.panY}px) scale(${vp.zoom})`;
|
|
13654
|
+
}, /* @ts-ignore */
|
|
13655
|
+
...(ngDevMode ? [{ debugName: "worldTransform" }] : /* istanbul ignore next */ []));
|
|
13656
|
+
nodeIdFrequency = computed(() => countNodeIds(this.mirroredNodes()), /* @ts-ignore */
|
|
13657
|
+
...(ngDevMode ? [{ debugName: "nodeIdFrequency" }] : /* istanbul ignore next */ []));
|
|
13658
|
+
edgeIdFrequency = computed(() => countEdgeIds(this.visibleEdges()), /* @ts-ignore */
|
|
13659
|
+
...(ngDevMode ? [{ debugName: "edgeIdFrequency" }] : /* istanbul ignore next */ []));
|
|
13660
|
+
constructor() {
|
|
13661
|
+
effect(() => {
|
|
13662
|
+
const incoming = (this.nodes() ?? []).filter((node) => !!node);
|
|
13663
|
+
this.mirroredNodes.set(incoming);
|
|
13664
|
+
});
|
|
13665
|
+
// W1+W2 (4R Ola 5, heredado de PR-C1): un flip de `readonly` a mitad de gesto cancela CUALQUIER
|
|
13666
|
+
// mutación en curso — revierte el drag SIN emitir y desarma "conectar" (curva fantasma incluida,
|
|
13667
|
+
// PR-C2B). El pan/zoom NUNCA se toca acá — no es una mutación del grafo (ver docstring de la clase).
|
|
13668
|
+
effect(() => {
|
|
13669
|
+
if (!this.isReadonly())
|
|
13670
|
+
return;
|
|
13671
|
+
const hadActiveGesture = this.dragState !== null || untracked(() => this.connectSourceId()) !== null;
|
|
13672
|
+
this.dragState = null;
|
|
13673
|
+
this.disarmConnect();
|
|
13674
|
+
if (hadActiveGesture)
|
|
13675
|
+
this.announce('shared.flowCanvas.moveCancelledAnnouncement');
|
|
13676
|
+
});
|
|
13677
|
+
}
|
|
13678
|
+
trackNode(node, index) {
|
|
13679
|
+
return safeTrackKey(node?.id, index, this.nodeIdFrequency());
|
|
13680
|
+
}
|
|
13681
|
+
/** Fallback anti-NG0955 para edges — mismo patrón que {@link trackNode}. */
|
|
13682
|
+
trackEdge(edge, index) {
|
|
13683
|
+
return safeTrackKey(edge?.id, index, this.edgeIdFrequency());
|
|
13684
|
+
}
|
|
13685
|
+
isSelected(node) {
|
|
13686
|
+
return this.selectedId() === node.id;
|
|
13687
|
+
}
|
|
13688
|
+
isHighlighted(node) {
|
|
13689
|
+
return this.highlightedNodeId() === node.id;
|
|
13690
|
+
}
|
|
13691
|
+
isValidConnectTarget(node) {
|
|
13692
|
+
return this.connectSourceId() !== null && this.validConnectTargetIds().has(node.id);
|
|
13693
|
+
}
|
|
13694
|
+
/** El origen armado NUNCA es "inválido" (ya tiene su propio estilo vía `--connect-source`) — solo los DEMÁS nodos no-válidos se atenúan. */
|
|
13695
|
+
isInvalidConnectTarget(node) {
|
|
13696
|
+
const sourceId = this.connectSourceId();
|
|
13697
|
+
if (sourceId === null || sourceId === node.id)
|
|
13698
|
+
return false;
|
|
13699
|
+
return !this.validConnectTargetIds().has(node.id);
|
|
13700
|
+
}
|
|
13701
|
+
hasValidPosition(node) {
|
|
13702
|
+
const position = node?.position;
|
|
13703
|
+
return !!position && Number.isFinite(position.x) && Number.isFinite(position.y);
|
|
13704
|
+
}
|
|
13705
|
+
resolvedPosition(node) {
|
|
13706
|
+
// W4 (4R Ola 5): clamp en el PUNTO DE LECTURA — mantiene `dragState.currentPosition` sin transformar.
|
|
13707
|
+
if (this.dragState && this.dragState.nodeId === node.id)
|
|
13708
|
+
return clampPosition(this.dragState.currentPosition);
|
|
13709
|
+
if (this.hasValidPosition(node))
|
|
13710
|
+
return clampPosition(node.position);
|
|
13711
|
+
return { x: 0, y: 0 };
|
|
13712
|
+
}
|
|
13713
|
+
nodeCenter(node) {
|
|
13714
|
+
const position = this.resolvedPosition(node);
|
|
13715
|
+
return { x: position.x + NODE_WIDTH_PX / 2, y: position.y + NODE_HEIGHT_PX / 2 };
|
|
13716
|
+
}
|
|
13717
|
+
/** Atributo `d` de la curva bezier de una arista — ver `flow-canvas-edge-geometry.ts` (puro). Extremos ausentes → sin curva (mismo criterio de robustez que `visibleEdges()`, defensivo aunque `visibleEdges()` ya filtra). */
|
|
13718
|
+
edgePathD(edge) {
|
|
13719
|
+
const byId = this.nodesById();
|
|
13720
|
+
const source = byId.get(edge.sourceId);
|
|
13721
|
+
const target = byId.get(edge.targetId);
|
|
13722
|
+
if (!source || !target)
|
|
13723
|
+
return '';
|
|
13724
|
+
return computeEdgePathD(this.nodeCenter(source), this.nodeCenter(target));
|
|
13725
|
+
}
|
|
13726
|
+
/** Punto SOBRE la curva bezier (t=0.5) para el label de la arista — reemplaza el punto medio de la recta del shell de PR-C1. */
|
|
13727
|
+
edgeMidpoint(edge) {
|
|
13728
|
+
const byId = this.nodesById();
|
|
13729
|
+
const source = byId.get(edge.sourceId);
|
|
13730
|
+
const target = byId.get(edge.targetId);
|
|
13731
|
+
if (!source || !target)
|
|
13732
|
+
return { x: 0, y: 0 };
|
|
13733
|
+
return computeEdgeMidpoint(this.nodeCenter(source), this.nodeCenter(target));
|
|
13734
|
+
}
|
|
13735
|
+
/** Curva fantasma (origen armado → cursor) mientras hay una conexión en curso — `null` esconde el `@if` del template. */
|
|
13736
|
+
ghostEdgePathD() {
|
|
13737
|
+
const sourceId = this.connectSourceId();
|
|
13738
|
+
const pointerWorld = this.ghostPointerWorld();
|
|
13739
|
+
if (sourceId === null || pointerWorld === null)
|
|
13740
|
+
return null;
|
|
13741
|
+
const source = this.nodesById().get(sourceId);
|
|
13742
|
+
if (!source)
|
|
13743
|
+
return null;
|
|
13744
|
+
return computeEdgePathD(this.nodeCenter(source), pointerWorld);
|
|
13745
|
+
}
|
|
13746
|
+
nodeTemplateContext(node) {
|
|
13747
|
+
return { $implicit: node, node, selected: this.isSelected(node), highlighted: this.isHighlighted(node) };
|
|
13748
|
+
}
|
|
13749
|
+
// --- i18n (claves reales en boki-front/src/assets/i18n/es-CO.json bajo shared.flowCanvas.*) ---
|
|
13750
|
+
regionLabel() {
|
|
13751
|
+
this.i18n.activeLang();
|
|
13752
|
+
return this.i18n.translate('shared.flowCanvas.regionLabel');
|
|
13753
|
+
}
|
|
13754
|
+
nodeAriaLabel(node) {
|
|
13755
|
+
this.i18n.activeLang();
|
|
13756
|
+
return this.i18n.translate('shared.flowCanvas.nodeAriaLabel', { label: node.label });
|
|
13757
|
+
}
|
|
13758
|
+
connectFromLabel(node) {
|
|
13759
|
+
this.i18n.activeLang();
|
|
13760
|
+
return this.i18n.translate('shared.flowCanvas.connectFromLabel', { label: node.label });
|
|
13761
|
+
}
|
|
13762
|
+
removeConnectionLabel() {
|
|
13763
|
+
this.i18n.activeLang();
|
|
13764
|
+
return this.i18n.translate('shared.flowCanvas.removeConnectionLabel');
|
|
13765
|
+
}
|
|
13766
|
+
autoLayoutButtonLabel() {
|
|
13767
|
+
this.i18n.activeLang();
|
|
13768
|
+
return this.i18n.translate('shared.flowCanvas.autoLayoutButton');
|
|
13769
|
+
}
|
|
13770
|
+
autoLayoutButtonAriaLabel() {
|
|
13771
|
+
this.i18n.activeLang();
|
|
13772
|
+
return this.i18n.translate('shared.flowCanvas.autoLayoutButtonAriaLabel');
|
|
13773
|
+
}
|
|
13774
|
+
// --- selección / conectar ---
|
|
13775
|
+
onNodeActivate(node) {
|
|
13776
|
+
if (this.lastGestureWasDrag) {
|
|
13777
|
+
this.lastGestureWasDrag = false;
|
|
13778
|
+
return;
|
|
13779
|
+
}
|
|
13780
|
+
const source = this.connectSourceId();
|
|
13781
|
+
if (source !== null) {
|
|
13782
|
+
this.disarmConnect();
|
|
13783
|
+
// W1+W2 (4R Ola 5): guard extra de isReadonly() — el effect del constructor ya desarma
|
|
13784
|
+
// connectSourceId al flipear a readonly, este guard cubre la ventana síncrona previa a que corra.
|
|
13785
|
+
if (source !== node.id && !this.isReadonly()) {
|
|
13786
|
+
this.connectionCreated.emit({ sourceId: source, targetId: node.id });
|
|
13787
|
+
this.announce('shared.flowCanvas.connectionCreatedAnnouncement', { source, target: node.id });
|
|
13788
|
+
return;
|
|
13789
|
+
}
|
|
13790
|
+
// Activar el MISMO nodo que armó "conectar" (o un flip a readonly a mitad de gesto) cancela el modo y cae a selección normal.
|
|
13791
|
+
}
|
|
13792
|
+
this.nodeSelected.emit({ id: node.id });
|
|
13793
|
+
}
|
|
13794
|
+
/**
|
|
13795
|
+
* PR-C3 (GOAL §4, "señal accesible del hint de destinos válidos"): el
|
|
13796
|
+
* anuncio `aria-live` incluye la CANTIDAD de destinos válidos junto con el
|
|
13797
|
+
* origen — sin esto, el resaltado visual (`--connect-valid-target`/
|
|
13798
|
+
* `--connect-invalid-target`) es invisible para un lector de pantalla
|
|
13799
|
+
* (deuda documentada en `EVALUACION-MOTORES.md`: "gap de a11y del hint,
|
|
13800
|
+
* documentado, no silencioso"). `validConnectTargetIds()` se lee DESPUÉS
|
|
13801
|
+
* de fijar `connectSourceId` — los signals de Angular se recalculan de
|
|
13802
|
+
* forma síncrona a la lectura, no hace falta esperar un tick.
|
|
13803
|
+
*/
|
|
13804
|
+
onStartConnect(node, event) {
|
|
13805
|
+
event.stopPropagation();
|
|
13806
|
+
if (this.isReadonly())
|
|
13807
|
+
return;
|
|
13808
|
+
this.connectSourceId.set(node.id);
|
|
13809
|
+
const validTargetCount = this.validConnectTargetIds().size;
|
|
13810
|
+
this.announce('shared.flowCanvas.connectArmedAnnouncement', { label: node.label, count: validTargetCount });
|
|
13811
|
+
}
|
|
13812
|
+
cancelConnect() {
|
|
13813
|
+
this.disarmConnect();
|
|
13814
|
+
}
|
|
13815
|
+
/** Desarma "conectar" (cancelar/completar/flip a readonly) — SIEMPRE limpia también la curva fantasma, mismo criterio en los 3 casos (PR-C2B). */
|
|
13816
|
+
disarmConnect() {
|
|
13817
|
+
this.connectSourceId.set(null);
|
|
13818
|
+
this.ghostPointerWorld.set(null);
|
|
13819
|
+
}
|
|
13820
|
+
onRemoveConnection(edge) {
|
|
13821
|
+
if (this.isReadonly())
|
|
13822
|
+
return;
|
|
13823
|
+
this.connectionRemoved.emit({ id: edge.id });
|
|
13824
|
+
this.announce('shared.flowCanvas.connectionRemovedAnnouncement');
|
|
13825
|
+
}
|
|
13826
|
+
// --- arrastre por mouse (pointer events nativos — CDK evaluado y descartado, ver docstring de la clase) ---
|
|
13827
|
+
onNodePointerDown(node, event) {
|
|
13828
|
+
// PR-C2B: un pointerdown sobre un nodo NUNCA debe además arrancar un pan de fondo — incondicional,
|
|
13829
|
+
// incluso si el resto del método corta abajo por readonly/drag-ya-activo (mismo comportamiento sea
|
|
13830
|
+
// cual sea el modo, en vez de que readonly "degrade" sorpresivamente el gesto a un pan).
|
|
13831
|
+
event.stopPropagation();
|
|
13832
|
+
if (this.isReadonly())
|
|
13833
|
+
return;
|
|
13834
|
+
// C1 (4R Ola 5): un drag YA activo (de OTRO puntero, sobre el mismo nodo o uno distinto) ignora por
|
|
13835
|
+
// completo un segundo pointerdown — el primer puntero en arrancar gana, nunca se corrompe/reasigna.
|
|
13836
|
+
if (this.dragState)
|
|
13837
|
+
return;
|
|
13838
|
+
const target = event.currentTarget;
|
|
13839
|
+
target.focus();
|
|
13840
|
+
target.setPointerCapture?.(event.pointerId);
|
|
13841
|
+
const start = this.resolvedPosition(node);
|
|
13842
|
+
this.dragState = {
|
|
13843
|
+
nodeId: node.id,
|
|
13844
|
+
pointerId: event.pointerId,
|
|
13845
|
+
startPointer: { x: event.clientX, y: event.clientY },
|
|
13846
|
+
lastPointer: { x: event.clientX, y: event.clientY },
|
|
13847
|
+
startPosition: start,
|
|
13848
|
+
currentPosition: start,
|
|
13849
|
+
};
|
|
13850
|
+
}
|
|
13851
|
+
/**
|
|
13852
|
+
* C1 (4R Ola 5) — fix del bug "zoom a mitad de drag corrompe la posición": acumula el delta de
|
|
13853
|
+
* PANTALLA por SEGMENTO (desde {@link DragState.lastPointer}, nunca desde `startPointer`) y lo
|
|
13854
|
+
* convierte con el zoom VIGENTE en CADA `pointermove` — nunca con el zoom final. Es matemáticamente
|
|
13855
|
+
* correcto bajo CUALQUIER secuencia de zooms durante el drag: si el zoom cambia a mitad de gesto
|
|
13856
|
+
* (rueda del mouse con el puntero sostenido, o pinch de fondo concurrente — {@link onCanvasWheel} y
|
|
13857
|
+
* `applyPinchMove` NUNCA consultan `dragState`, a propósito), el segmento YA acumulado con el zoom
|
|
13858
|
+
* viejo queda intacto; solo el segmento SIGUIENTE usa el zoom nuevo.
|
|
13859
|
+
*
|
|
13860
|
+
* Alternativa descartada — "zoom exclusivo del gesto" (bloquear wheel/pinch mientras `dragState !=
|
|
13861
|
+
* null`): más simple de implementar, pero degrada la UX — un usuario que sostiene un nodo y gira la
|
|
13862
|
+
* rueda (trackpad, gesto accidental o intencional) esperaría que el zoom siga respondiendo, igual que
|
|
13863
|
+
* en Figma/n8n. La solución incremental preserva esa expectativa sin sacrificar corrección, al costo
|
|
13864
|
+
* de un campo extra (`lastPointer`) en `DragState`.
|
|
13865
|
+
*
|
|
13866
|
+
* (Bug pre-fix: `dx = (event.clientX - state.startPointer.x) / zoomVigente` dividía el delta TOTAL de
|
|
13867
|
+
* pantalla desde el INICIO del drag por el zoom ACTUAL — si el zoom cambiaba a mitad de gesto, el
|
|
13868
|
+
* tramo ya recorrido bajo el zoom viejo se re-escalaba retroactivamente y el nodo "saltaba" visualmente
|
|
13869
|
+
* al soltar/commitear. Ver el test "zoom a mitad de drag" en flow-canvas.component.spec.ts, que
|
|
13870
|
+
* documenta el valor corrupto exacto que producía el código anterior.)
|
|
13871
|
+
*/
|
|
13872
|
+
onNodePointerMove(node, event) {
|
|
13873
|
+
const state = this.dragState;
|
|
13874
|
+
// C1: solo el puntero DUEÑO del drag, sobre SU nodo, puede mutar dragState — un puntero/nodo ajeno no hace nada.
|
|
13875
|
+
if (!state || state.pointerId !== event.pointerId || state.nodeId !== node.id)
|
|
13876
|
+
return;
|
|
13877
|
+
if (this.isReadonly())
|
|
13878
|
+
return; // W1+W2: ventana síncrona previa a que el effect del constructor revierta
|
|
13879
|
+
// PR-C2B: conversión de coordenadas pantalla→canvas — un delta de PANTALLA (`clientX/Y`) representa
|
|
13880
|
+
// menos distancia real en el canvas cuanto más acercado está el zoom (a 2x, 40px de pantalla = 20px
|
|
13881
|
+
// de canvas). Dividir por `zoom` es la operación inversa exacta del `scale(zoom)` del transform del
|
|
13882
|
+
// mundo — ver `screenToWorld`/`worldToScreen` en flow-canvas-viewport.ts.
|
|
13883
|
+
const zoom = this.viewport().zoom;
|
|
13884
|
+
const currentPointer = { x: event.clientX, y: event.clientY };
|
|
13885
|
+
const dx = (currentPointer.x - state.lastPointer.x) / zoom;
|
|
13886
|
+
const dy = (currentPointer.y - state.lastPointer.y) / zoom;
|
|
13887
|
+
this.dragState = {
|
|
13888
|
+
...state,
|
|
13889
|
+
lastPointer: currentPointer,
|
|
13890
|
+
currentPosition: { x: state.currentPosition.x + dx, y: state.currentPosition.y + dy },
|
|
13891
|
+
};
|
|
13892
|
+
}
|
|
13893
|
+
onNodePointerUp(node, event) {
|
|
13894
|
+
const state = this.dragState;
|
|
13895
|
+
// C1: el up de un puntero/nodo AJENO nunca toca el drag activo (ni lo limpia ni lo commitea).
|
|
13896
|
+
if (!state || state.pointerId !== event.pointerId || state.nodeId !== node.id)
|
|
13897
|
+
return;
|
|
13898
|
+
this.dragState = null;
|
|
13899
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
13900
|
+
if (this.isReadonly())
|
|
13901
|
+
return; // W1+W2: ventana síncrona previa a que el effect del constructor revierta — no commitea
|
|
13902
|
+
// PR-C2B: el umbral clic-vs-arrastre se mide en PANTALLA (`event.clientX/Y` crudos contra
|
|
13903
|
+
// `state.startPointer`, ambos en espacio pantalla), NUNCA en espacio canvas — es una cuestión de
|
|
13904
|
+
// precisión motora HUMANA (cuánto tiembla un dedo/mouse en píxeles de pantalla), zoom-invariante por
|
|
13905
|
+
// definición. Medirlo en canvas haría el umbral más permisivo alejado (jitter mínimo ya cruzaría 4px
|
|
13906
|
+
// de canvas) y más estricto acercado — ambos efectos indeseados que esta medición evita por completo.
|
|
13907
|
+
const screenDistance = Math.hypot(event.clientX - state.startPointer.x, event.clientY - state.startPointer.y);
|
|
13908
|
+
if (screenDistance < dragThresholdFor(event))
|
|
13909
|
+
return; // sin desplazamiento real: el click nativo que sigue resuelve selección/conexión (PR-C4: umbral touch-aware, ver dragThresholdFor)
|
|
13910
|
+
this.lastGestureWasDrag = true;
|
|
13911
|
+
this.commitNodePosition(node, state.currentPosition); // commitNodePosition clampea a coordenadas no negativas (W4)
|
|
13912
|
+
}
|
|
13913
|
+
/**
|
|
13914
|
+
* `pointercancel`/`lostpointercapture` (W3+W5, 4R Ola 5) — SIEMPRE revierte, NUNCA commitea.
|
|
13915
|
+
*/
|
|
13916
|
+
onNodePointerCancel(node, event) {
|
|
13917
|
+
const state = this.dragState;
|
|
13918
|
+
if (!state || state.pointerId !== event.pointerId || state.nodeId !== node.id)
|
|
13919
|
+
return; // C1: puntero/nodo ajeno, no toca el drag activo
|
|
13920
|
+
this.dragState = null;
|
|
13921
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
13922
|
+
this.announce('shared.flowCanvas.moveCancelledAnnouncement');
|
|
13923
|
+
}
|
|
13924
|
+
// --- nudge por teclado (paridad a11y) ---
|
|
13925
|
+
/**
|
|
13926
|
+
* El paso ({@link KEYBOARD_NUDGE_STEP_PX}) es SIEMPRE canvas-space, nunca se escala por zoom (PR-C2B,
|
|
13927
|
+
* a11y): la navegación por teclado representa "cuánto se movió el DATO", igual que el nudge del mouse
|
|
13928
|
+
* commitea en canvas-space — el zoom es puramente una cuestión de VISTA y no debe alterar cuánto se
|
|
13929
|
+
* mueve un nodo por cada pulsación de flecha (impredecible para un usuario de teclado si dependiera del
|
|
13930
|
+
* zoom vigente).
|
|
13931
|
+
*/
|
|
13932
|
+
onNodeKeydown(node, event) {
|
|
13933
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
13934
|
+
event.preventDefault();
|
|
13935
|
+
this.onNodeActivate(node);
|
|
13936
|
+
return;
|
|
13937
|
+
}
|
|
13938
|
+
if (this.isReadonly())
|
|
13939
|
+
return;
|
|
13940
|
+
const delta = ARROW_KEY_DELTA[event.key];
|
|
13941
|
+
if (!delta)
|
|
13942
|
+
return;
|
|
13943
|
+
event.preventDefault();
|
|
13944
|
+
const current = this.resolvedPosition(node);
|
|
13945
|
+
this.commitNodePosition(node, {
|
|
13946
|
+
x: current.x + delta.x * KEYBOARD_NUDGE_STEP_PX,
|
|
13947
|
+
y: current.y + delta.y * KEYBOARD_NUDGE_STEP_PX,
|
|
13948
|
+
});
|
|
13949
|
+
}
|
|
13950
|
+
/**
|
|
13951
|
+
* `(focus)` de un nodo (Tab, o `target.focus()` explícito en
|
|
13952
|
+
* {@link onNodePointerDown}) — panea el lienzo lo justo para que el nodo
|
|
13953
|
+
* recién enfocado quede visible, NUNCA cambia el zoom (ver
|
|
13954
|
+
* {@link panToRevealWorldRect}, puro).
|
|
13955
|
+
*
|
|
13956
|
+
* Motivación (PR-C2B, W-fix de a11y): el shell de PR-C1 usaba
|
|
13957
|
+
* `overflow: auto` — el navegador hacía "scroll into view" GRATIS cuando el
|
|
13958
|
+
* foco (Tab) llegaba a un nodo fuera del área visible. Este motor reemplaza
|
|
13959
|
+
* ese scroll nativo por `overflow: hidden` + `transform` (pan/zoom propio,
|
|
13960
|
+
* necesario para que la rueda/pinch funcionen sin pelear con el scroll del
|
|
13961
|
+
* navegador) — sin este método, Tab movería el foco LÓGICO sin revelarlo
|
|
13962
|
+
* VISUALMENTE, una regresión real de accesibilidad que este PR introduciría
|
|
13963
|
+
* en silencio si no se corrigiera acá.
|
|
13964
|
+
*/
|
|
13965
|
+
onNodeFocus(node) {
|
|
13966
|
+
const hostEl = this.canvasHostRef().nativeElement;
|
|
13967
|
+
const rect = hostEl.getBoundingClientRect();
|
|
13968
|
+
const position = this.resolvedPosition(node);
|
|
13969
|
+
const worldRect = { x: position.x, y: position.y, width: NODE_WIDTH_PX, height: NODE_HEIGHT_PX };
|
|
13970
|
+
this.viewport.update((vp) => panToRevealWorldRect(vp, worldRect, { width: rect.width, height: rect.height }));
|
|
13971
|
+
}
|
|
13972
|
+
commitNodePosition(node, position) {
|
|
13973
|
+
const clamped = clampPosition(position); // W4: ningún commit (arrastre o nudge) puede dejar coordenadas negativas
|
|
13974
|
+
this.mirroredNodes.update((nodes) => nodes.map((n) => (n.id === node.id ? { ...n, position: clamped } : n)));
|
|
13975
|
+
this.nodeMoved.emit({ id: node.id, position: clamped });
|
|
13976
|
+
this.announce('shared.flowCanvas.movedAnnouncement', { label: node.label });
|
|
13977
|
+
}
|
|
13978
|
+
announce(key, params) {
|
|
13979
|
+
this.i18n.activeLang();
|
|
13980
|
+
this.announcement.set(this.i18n.translate(key, params));
|
|
13981
|
+
}
|
|
13982
|
+
// --- pan/zoom del lienzo (PR-C2B — ver flow-canvas-viewport.ts, puro) ---
|
|
13983
|
+
/*
|
|
13984
|
+
* W1 (4R Ola 5, deuda DOCUMENTADA — NO implementada en este ciclo; el refactor de gestos ya está
|
|
13985
|
+
* agendado para PR-C3, cuando este componente (904L, 5 responsabilidades) se divida): los handlers de
|
|
13986
|
+
* ESTA sección ({@link onCanvasPointerMove}, {@link onCanvasWheel}, {@link applyPinchMove}) son de alta
|
|
13987
|
+
* frecuencia — un `pointermove`/`wheel` de usuario puede disparar decenas por segundo — y cada uno
|
|
13988
|
+
* escribe el signal `viewport`/`ghostPointerWorld` SIN agrupar (batch) los eventos del mismo frame.
|
|
13989
|
+
* Candidato a coalescing con `requestAnimationFrame` en ese refactor. Línea base medida hoy (smoke
|
|
13990
|
+
* sobre jsdom, NO paint/compositing real de navegador): ~5.3ms/100 eventos de pan sostenido sobre 60
|
|
13991
|
+
* nodos — ver el test "línea base — 100 pointermove..." en flow-canvas.component.spec.ts.
|
|
13992
|
+
*/
|
|
13993
|
+
/**
|
|
13994
|
+
* Arranca el seguimiento de un puntero de FONDO — nunca se dispara para un puntero que arrancó sobre un
|
|
13995
|
+
* nodo (`stopPropagation` en {@link onNodePointerDown}) ni sobre el botón "conectar desde"/"×" (sin
|
|
13996
|
+
* listener de pointerdown propio, así que si el `pointerup` llega casi de inmediato el pan resultante es
|
|
13997
|
+
* ~(0,0), inofensivo — el `click` que resuelve esos botones es un evento aparte, no lo interfiere esto).
|
|
13998
|
+
*/
|
|
13999
|
+
onCanvasPointerDown(event) {
|
|
14000
|
+
const target = event.currentTarget;
|
|
14001
|
+
target.setPointerCapture?.(event.pointerId);
|
|
14002
|
+
this.backgroundPointers.set(event.pointerId, { x: event.clientX, y: event.clientY });
|
|
14003
|
+
}
|
|
14004
|
+
onCanvasPointerMove(event) {
|
|
14005
|
+
const current = { x: event.clientX, y: event.clientY };
|
|
14006
|
+
if (this.backgroundPointers.has(event.pointerId)) {
|
|
14007
|
+
if (this.backgroundPointers.size >= 2) {
|
|
14008
|
+
this.applyPinchMove(event.pointerId, current, event);
|
|
14009
|
+
}
|
|
14010
|
+
else {
|
|
14011
|
+
const previous = this.backgroundPointers.get(event.pointerId);
|
|
14012
|
+
this.backgroundPointers.set(event.pointerId, current);
|
|
14013
|
+
const delta = { x: current.x - previous.x, y: current.y - previous.y };
|
|
14014
|
+
this.viewport.update((vp) => panBy(vp, delta));
|
|
14015
|
+
}
|
|
14016
|
+
}
|
|
14017
|
+
// Curva fantasma: sigue al puntero mientras haya una conexión armada, sin importar si ESTE puntero
|
|
14018
|
+
// también está paneando/pinchando (solapamiento raro en uso real — inofensivo dejarlo actualizar igual).
|
|
14019
|
+
if (this.connectSourceId() !== null) {
|
|
14020
|
+
this.ghostPointerWorld.set(screenToWorld(this.viewport(), this.canvasRelativePoint(current, event)));
|
|
14021
|
+
}
|
|
14022
|
+
}
|
|
14023
|
+
onCanvasPointerUp(event) {
|
|
14024
|
+
this.backgroundPointers.delete(event.pointerId);
|
|
14025
|
+
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
14026
|
+
}
|
|
14027
|
+
onCanvasPointerCancel(event) {
|
|
14028
|
+
this.backgroundPointers.delete(event.pointerId);
|
|
14029
|
+
}
|
|
14030
|
+
/**
|
|
14031
|
+
* Corre de forma INDEPENDIENTE de {@link dragState} — a propósito (C1, 4R Ola 5): el zoom sigue
|
|
14032
|
+
* respondiendo aunque haya un nodo siendo arrastrado. {@link onNodePointerMove} acumula su delta POR
|
|
14033
|
+
* SEGMENTO con el zoom vigente en cada momento, así que un cambio de zoom a mitad de gesto nunca
|
|
14034
|
+
* corrompe la posición ya recorrida — ver su JSDoc para el fix completo.
|
|
14035
|
+
*/
|
|
14036
|
+
onCanvasWheel(event) {
|
|
14037
|
+
event.preventDefault(); // repropone la rueda como zoom del lienzo — nunca debe además hacer scroll de la página
|
|
14038
|
+
const anchor = this.canvasRelativePoint({ x: event.clientX, y: event.clientY }, event);
|
|
14039
|
+
this.viewport.update((vp) => computeWheelZoom(vp, event.deltaY, anchor));
|
|
14040
|
+
}
|
|
14041
|
+
/**
|
|
14042
|
+
* Segundo puntero de fondo activo → pinch. La distancia PREVIA se lee ANTES de sobrescribir la posición
|
|
14043
|
+
* de `pointerId` en el mapa (si no, "previa" y "actual" serían el mismo valor) — la razón entre ambas
|
|
14044
|
+
* distancias es el factor de zoom INCREMENTAL de este solo `pointermove` (se compone con el siguiente
|
|
14045
|
+
* `pointermove` del otro puntero, no hace falta recordar la distancia "inicial" del pinch completo).
|
|
14046
|
+
*
|
|
14047
|
+
* Corre de forma INDEPENDIENTE de {@link dragState} — a propósito (C1, 4R Ola 5, mismo criterio que
|
|
14048
|
+
* {@link onCanvasWheel}): un pinch de fondo (dos punteros AJENOS al que arrastra un nodo) sigue
|
|
14049
|
+
* zoomeando sin corromper el drag activo — ver el JSDoc de {@link onNodePointerMove}.
|
|
14050
|
+
*/
|
|
14051
|
+
applyPinchMove(pointerId, current, event) {
|
|
14052
|
+
const otherEntry = [...this.backgroundPointers.entries()].find(([id]) => id !== pointerId);
|
|
14053
|
+
if (!otherEntry)
|
|
14054
|
+
return; // defensivo — no debería ocurrir con size>=2, pero nunca lanzar por esto
|
|
14055
|
+
const [, otherPosition] = otherEntry;
|
|
14056
|
+
const previousPosition = this.backgroundPointers.get(pointerId);
|
|
14057
|
+
const previousDistance = distanceBetween(previousPosition, otherPosition);
|
|
14058
|
+
const currentDistance = distanceBetween(current, otherPosition);
|
|
14059
|
+
const anchor = this.canvasRelativePoint(midpoint(current, otherPosition), event);
|
|
14060
|
+
this.backgroundPointers.set(pointerId, current);
|
|
14061
|
+
this.viewport.update((vp) => computePinchZoom(vp, previousDistance, currentDistance, anchor));
|
|
14062
|
+
}
|
|
14063
|
+
/** `clientX/Y` (pantalla del navegador) → "screen" relativo al host `.sol-flow-canvas` (resta `getBoundingClientRect()`), la convención que espera `flow-canvas-viewport.ts`. */
|
|
14064
|
+
canvasRelativePoint(clientPoint, event) {
|
|
14065
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
14066
|
+
return { x: clientPoint.x - rect.left, y: clientPoint.y - rect.top };
|
|
14067
|
+
}
|
|
14068
|
+
/**
|
|
14069
|
+
* Calcula y aplica una posición a TODO nodo actual sin `position` válido
|
|
14070
|
+
* usando {@link computeAutoLayoutPositions} (dagre real, PR-C3 — con
|
|
14071
|
+
* fallback BFS síncrono si el chunk lazy falla, ver W2 en
|
|
14072
|
+
* `flow-canvas-layout.ts`). Los nodos YA posicionados NO se tocan. Emite
|
|
14073
|
+
* `nodeMoved` por cada nodo repositionado. Opera 100% en espacio CANVAS
|
|
14074
|
+
* (igual que `node.position` siempre) — el pan/zoom vigente NUNCA entra en
|
|
14075
|
+
* este cálculo, no hay conversión de coordenadas que hacer acá (a
|
|
14076
|
+
* diferencia del arrastre, que sí consume `clientX/Y` de pantalla).
|
|
14077
|
+
*
|
|
14078
|
+
* No-op si `isReadonly()` es `true` (S1, 4R Ola 5).
|
|
14079
|
+
*
|
|
14080
|
+
* **W3 (4R Ola 5 post PR-C3, fuga de bundle) — CAMBIO DE CONTRATO
|
|
14081
|
+
* DELIBERADO**: pasa de síncrono a `Promise<void>` porque
|
|
14082
|
+
* `computeAutoLayoutPositions` ahora carga `@dagrejs/dagre` vía `import()`
|
|
14083
|
+
* dinámico (el módulo entero se saca del chunk eager, no solo la
|
|
14084
|
+
* instancia — ver docstring de `flow-canvas-layout.ts`). Consumidores
|
|
14085
|
+
* existentes que llamaban `autoLayout()` de forma "fire-and-forget" (el
|
|
14086
|
+
* effect de `pages/flows`) siguen funcionando sin `await` — el nodo queda
|
|
14087
|
+
* sin posición hasta que la promesa resuelve, que es exactamente el mismo
|
|
14088
|
+
* intervalo que antes tomaba el cálculo síncrono, solo que ahora incluye
|
|
14089
|
+
* la carga del chunk la PRIMERA vez.
|
|
14090
|
+
*/
|
|
14091
|
+
/**
|
|
14092
|
+
* PR-C4 (GOAL §4 punto 5) — dispara `autoLayout()` desde el botón flotante
|
|
14093
|
+
* SIEMPRE visible en móvil (`@if (!isReadonly())` en el template ya cubre
|
|
14094
|
+
* el guard de solo-lectura; este método solo existe para darle un nombre
|
|
14095
|
+
* de evento propio al `(click)`, fire-and-forget igual que el efecto de
|
|
14096
|
+
* `pages/flows` que ya invoca `autoLayout()` sin `await`).
|
|
14097
|
+
*/
|
|
14098
|
+
onAutoLayoutClick() {
|
|
14099
|
+
void this.autoLayout();
|
|
14100
|
+
}
|
|
14101
|
+
async autoLayout() {
|
|
14102
|
+
if (this.isReadonly())
|
|
14103
|
+
return;
|
|
14104
|
+
const current = this.mirroredNodes();
|
|
14105
|
+
const pending = current.filter((node) => !this.hasValidPosition(node));
|
|
14106
|
+
if (pending.length === 0)
|
|
14107
|
+
return;
|
|
14108
|
+
const computed = await computeAutoLayoutPositions(current, this.edges() ?? []);
|
|
14109
|
+
const updates = [];
|
|
14110
|
+
this.mirroredNodes.update((nodes) => nodes.map((node) => {
|
|
14111
|
+
if (this.hasValidPosition(node))
|
|
14112
|
+
return node;
|
|
14113
|
+
const position = computed.get(node.id);
|
|
14114
|
+
if (!position)
|
|
14115
|
+
return node;
|
|
14116
|
+
updates.push({ id: node.id, position });
|
|
14117
|
+
return { ...node, position };
|
|
14118
|
+
}));
|
|
14119
|
+
for (const update of updates)
|
|
14120
|
+
this.nodeMoved.emit(update);
|
|
14121
|
+
}
|
|
14122
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolFlowCanvasComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14123
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: SolFlowCanvasComponent, isStandalone: true, selector: "sol-flow-canvas", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, edges: { classPropertyName: "edges", publicName: "edges", isSignal: true, isRequired: false, transformFunction: null }, isReadonly: { classPropertyName: "isReadonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, highlightedNodeId: { classPropertyName: "highlightedNodeId", publicName: "highlightedNodeId", isSignal: true, isRequired: false, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeMoved: "nodeMoved", nodeSelected: "nodeSelected", connectionCreated: "connectionCreated", connectionRemoved: "connectionRemoved" }, viewQueries: [{ propertyName: "canvasHostRef", first: true, predicate: ["canvasHost"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
14124
|
+
<div
|
|
14125
|
+
#canvasHost
|
|
14126
|
+
class="sol-flow-canvas"
|
|
14127
|
+
role="application"
|
|
14128
|
+
[attr.aria-label]="regionLabel()"
|
|
14129
|
+
[style.--sol-flow-canvas-zoom]="viewport().zoom"
|
|
14130
|
+
(keydown.escape)="cancelConnect()"
|
|
14131
|
+
(pointerdown)="onCanvasPointerDown($event)"
|
|
14132
|
+
(pointermove)="onCanvasPointerMove($event)"
|
|
14133
|
+
(pointerup)="onCanvasPointerUp($event)"
|
|
14134
|
+
(pointercancel)="onCanvasPointerCancel($event)"
|
|
14135
|
+
(lostpointercapture)="onCanvasPointerCancel($event)"
|
|
14136
|
+
(wheel)="onCanvasWheel($event)"
|
|
14137
|
+
>
|
|
14138
|
+
<div class="sol-flow-canvas__world" [style.transform]="worldTransform()">
|
|
14139
|
+
<svg class="sol-flow-canvas__edges" aria-hidden="true">
|
|
14140
|
+
<defs>
|
|
14141
|
+
<marker
|
|
14142
|
+
[attr.id]="markerId"
|
|
14143
|
+
markerWidth="8"
|
|
14144
|
+
markerHeight="8"
|
|
14145
|
+
refX="7"
|
|
14146
|
+
refY="4"
|
|
14147
|
+
orient="auto-start-reverse"
|
|
14148
|
+
>
|
|
14149
|
+
<path d="M0,0 L8,4 L0,8 Z" class="sol-flow-canvas__edge-arrow" />
|
|
14150
|
+
</marker>
|
|
14151
|
+
</defs>
|
|
14152
|
+
@for (edge of visibleEdges(); track trackEdge(edge, $index)) {
|
|
14153
|
+
<path
|
|
14154
|
+
class="sol-flow-canvas__edge-line"
|
|
14155
|
+
[attr.d]="edgePathD(edge)"
|
|
14156
|
+
[attr.marker-end]="'url(#' + markerId + ')'"
|
|
14157
|
+
/>
|
|
14158
|
+
}
|
|
14159
|
+
@if (ghostEdgePathD(); as ghostD) {
|
|
14160
|
+
<path class="sol-flow-canvas__edge-ghost" [attr.d]="ghostD" [attr.marker-end]="'url(#' + markerId + ')'" />
|
|
14161
|
+
}
|
|
14162
|
+
</svg>
|
|
14163
|
+
|
|
14164
|
+
@for (edge of visibleEdges(); track trackEdge(edge, $index)) {
|
|
14165
|
+
<div class="sol-flow-canvas__edge-label" [style.left.px]="edgeMidpoint(edge).x" [style.top.px]="edgeMidpoint(edge).y">
|
|
14166
|
+
<span class="sol-flow-canvas__edge-label-text">{{ edge.label ?? edge.kind }}</span>
|
|
14167
|
+
@if (!isReadonly()) {
|
|
14168
|
+
<button
|
|
14169
|
+
type="button"
|
|
14170
|
+
class="sol-flow-canvas__edge-remove"
|
|
14171
|
+
[attr.aria-label]="removeConnectionLabel()"
|
|
14172
|
+
(click)="onRemoveConnection(edge)"
|
|
14173
|
+
>
|
|
14174
|
+
×
|
|
14175
|
+
</button>
|
|
14176
|
+
}
|
|
14177
|
+
</div>
|
|
14178
|
+
}
|
|
14179
|
+
|
|
14180
|
+
@for (node of mirroredNodes(); track trackNode(node, $index)) {
|
|
14181
|
+
<div
|
|
14182
|
+
class="sol-flow-canvas__node"
|
|
14183
|
+
[class.sol-flow-canvas__node--selected]="isSelected(node)"
|
|
14184
|
+
[class.sol-flow-canvas__node--highlighted]="isHighlighted(node)"
|
|
14185
|
+
[class.sol-flow-canvas__node--connect-source]="connectSourceId() === node.id"
|
|
14186
|
+
[class.sol-flow-canvas__node--connect-valid-target]="isValidConnectTarget(node)"
|
|
14187
|
+
[class.sol-flow-canvas__node--connect-invalid-target]="isInvalidConnectTarget(node)"
|
|
14188
|
+
[attr.data-visual-state]="node.visualState ?? 'idle'"
|
|
14189
|
+
[attr.data-testid]="'flow-canvas-node-' + node.id"
|
|
14190
|
+
[style.left.px]="resolvedPosition(node).x"
|
|
14191
|
+
[style.top.px]="resolvedPosition(node).y"
|
|
14192
|
+
>
|
|
14193
|
+
<button
|
|
14194
|
+
type="button"
|
|
14195
|
+
class="sol-flow-canvas__node-surface"
|
|
14196
|
+
[attr.aria-pressed]="isSelected(node)"
|
|
14197
|
+
[attr.aria-label]="nodeAriaLabel(node)"
|
|
14198
|
+
(pointerdown)="onNodePointerDown(node, $event)"
|
|
14199
|
+
(pointermove)="onNodePointerMove(node, $event)"
|
|
14200
|
+
(pointerup)="onNodePointerUp(node, $event)"
|
|
14201
|
+
(pointercancel)="onNodePointerCancel(node, $event)"
|
|
14202
|
+
(lostpointercapture)="onNodePointerCancel(node, $event)"
|
|
14203
|
+
(click)="onNodeActivate(node)"
|
|
14204
|
+
(keydown)="onNodeKeydown(node, $event)"
|
|
14205
|
+
(focus)="onNodeFocus(node)"
|
|
14206
|
+
>
|
|
14207
|
+
@if (nodeTemplate(); as tpl) {
|
|
14208
|
+
<ng-container *ngTemplateOutlet="tpl; context: nodeTemplateContext(node)" />
|
|
14209
|
+
} @else {
|
|
14210
|
+
<span class="sol-flow-canvas__node-label">{{ node.label }}</span>
|
|
14211
|
+
}
|
|
14212
|
+
</button>
|
|
14213
|
+
|
|
14214
|
+
@if (!isReadonly()) {
|
|
14215
|
+
<button
|
|
14216
|
+
type="button"
|
|
14217
|
+
class="sol-flow-canvas__node-connect-handle"
|
|
14218
|
+
[attr.aria-label]="connectFromLabel(node)"
|
|
14219
|
+
(click)="onStartConnect(node, $event)"
|
|
14220
|
+
>
|
|
14221
|
+
⇢
|
|
14222
|
+
</button>
|
|
14223
|
+
}
|
|
14224
|
+
</div>
|
|
14225
|
+
}
|
|
14226
|
+
</div>
|
|
14227
|
+
|
|
14228
|
+
@if (!isReadonly()) {
|
|
14229
|
+
<button
|
|
14230
|
+
type="button"
|
|
14231
|
+
class="sol-flow-canvas__auto-layout"
|
|
14232
|
+
data-testid="flow-canvas-auto-layout"
|
|
14233
|
+
[attr.aria-label]="autoLayoutButtonAriaLabel()"
|
|
14234
|
+
(click)="onAutoLayoutClick()"
|
|
14235
|
+
>
|
|
14236
|
+
{{ autoLayoutButtonLabel() }}
|
|
14237
|
+
</button>
|
|
14238
|
+
}
|
|
14239
|
+
|
|
14240
|
+
<div class="sol-flow-canvas__announce" aria-live="polite" role="status">{{ announcement() }}</div>
|
|
14241
|
+
</div>
|
|
14242
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.sol-flow-canvas{position:relative;width:100%;min-height:320px;overflow:hidden;background:var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));border-radius:var(--sol-border-radius-lg, 12px);touch-action:none;--sol-flow-canvas-hit-min: min(calc(44px / var(--sol-flow-canvas-zoom, 1)), 176px)}.sol-flow-canvas__world{position:absolute;inset:0;transform-origin:0 0;will-change:transform}.sol-flow-canvas__edges{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.sol-flow-canvas__edge-line{stroke:var(--sol-border-color-default, #94a3b8);stroke-width:2;fill:none}.sol-flow-canvas__edge-ghost{stroke:var(--sol-color-info, #3b82f6);stroke-width:2;stroke-dasharray:6 4;fill:none}.sol-flow-canvas__edge-arrow{fill:var(--sol-border-color-default, #94a3b8)}.sol-flow-canvas__edge-label{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;gap:4px;background:var(--sol-bg-surface, #fff);border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-full, 999px);padding:2px 8px;font-size:var(--sol-font-size-xs, 11px);color:var(--sol-color-text-secondary, #475569);z-index:2}.sol-flow-canvas__edge-remove{border:none;background:transparent;color:var(--sol-color-danger, #ef4444);cursor:pointer;font-size:var(--sol-font-size-sm, 13px);line-height:1;display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--sol-flow-canvas-hit-min, 44px);height:var(--sol-flow-canvas-hit-min, 44px);margin:calc((13px - var(--sol-flow-canvas-hit-min, 44px)) / 2)}.sol-flow-canvas__node{position:absolute;width:180px;display:flex;align-items:stretch;gap:4px;z-index:3;touch-action:none}.sol-flow-canvas__node-surface{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:var(--sol-flow-canvas-hit-min, 44px);text-align:left;padding:10px 12px;background:var(--sol-bg-surface, #fff);border:2px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-lg, 10px);box-shadow:var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .06));cursor:grab;font-family:var(--sol-font-family);color:var(--sol-color-text-primary);transition:opacity .15s ease}.sol-flow-canvas__node-surface:focus-visible{outline:2px solid var(--sol-color-primary, #2563eb);outline-offset:2px}.sol-flow-canvas__node--selected .sol-flow-canvas__node-surface{border-color:var(--sol-color-primary, #2563eb)}.sol-flow-canvas__node--highlighted .sol-flow-canvas__node-surface{box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-primary, #2563eb) 30%,transparent)}.sol-flow-canvas__node--connect-source .sol-flow-canvas__node-surface{border-style:dashed;border-color:var(--sol-color-info, #3b82f6)}.sol-flow-canvas__node--connect-valid-target .sol-flow-canvas__node-surface{border-style:dashed;border-color:var(--sol-color-success, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-success, #10b981) 25%,transparent)}.sol-flow-canvas__node--connect-invalid-target .sol-flow-canvas__node-surface{opacity:.45}.sol-flow-canvas__node[data-visual-state=running] .sol-flow-canvas__node-surface{border-color:var(--sol-color-info, #3b82f6)}.sol-flow-canvas__node[data-visual-state=ok] .sol-flow-canvas__node-surface{border-color:var(--sol-color-success, #10b981)}.sol-flow-canvas__node[data-visual-state=error] .sol-flow-canvas__node-surface{border-color:var(--sol-color-danger, #ef4444)}.sol-flow-canvas__node-label{font-size:var(--sol-font-size-sm, 13px);font-weight:600}.sol-flow-canvas__node-connect-handle{align-self:center;flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-flow-canvas-hit-min, 44px);min-height:var(--sol-flow-canvas-hit-min, 44px);border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-md, 8px);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-secondary, #475569);cursor:pointer}.sol-flow-canvas__announce{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sol-flow-canvas__auto-layout{display:none;position:absolute;right:12px;bottom:12px;z-index:4;min-width:44px;min-height:44px;padding:0 16px;align-items:center;justify-content:center;border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-full, 999px);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-primary);font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 13px);font-weight:600;box-shadow:var(--sol-shadow-md, 0 4px 12px rgba(0, 0, 0, .12));cursor:pointer}.sol-flow-canvas__auto-layout:focus-visible{outline:2px solid var(--sol-color-primary, #2563eb);outline-offset:2px}@media(max-width:767px){.sol-flow-canvas__auto-layout{display:inline-flex}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
14243
|
+
}
|
|
14244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: SolFlowCanvasComponent, decorators: [{
|
|
14245
|
+
type: Component,
|
|
14246
|
+
args: [{ selector: 'sol-flow-canvas', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
14247
|
+
<div
|
|
14248
|
+
#canvasHost
|
|
14249
|
+
class="sol-flow-canvas"
|
|
14250
|
+
role="application"
|
|
14251
|
+
[attr.aria-label]="regionLabel()"
|
|
14252
|
+
[style.--sol-flow-canvas-zoom]="viewport().zoom"
|
|
14253
|
+
(keydown.escape)="cancelConnect()"
|
|
14254
|
+
(pointerdown)="onCanvasPointerDown($event)"
|
|
14255
|
+
(pointermove)="onCanvasPointerMove($event)"
|
|
14256
|
+
(pointerup)="onCanvasPointerUp($event)"
|
|
14257
|
+
(pointercancel)="onCanvasPointerCancel($event)"
|
|
14258
|
+
(lostpointercapture)="onCanvasPointerCancel($event)"
|
|
14259
|
+
(wheel)="onCanvasWheel($event)"
|
|
14260
|
+
>
|
|
14261
|
+
<div class="sol-flow-canvas__world" [style.transform]="worldTransform()">
|
|
14262
|
+
<svg class="sol-flow-canvas__edges" aria-hidden="true">
|
|
14263
|
+
<defs>
|
|
14264
|
+
<marker
|
|
14265
|
+
[attr.id]="markerId"
|
|
14266
|
+
markerWidth="8"
|
|
14267
|
+
markerHeight="8"
|
|
14268
|
+
refX="7"
|
|
14269
|
+
refY="4"
|
|
14270
|
+
orient="auto-start-reverse"
|
|
14271
|
+
>
|
|
14272
|
+
<path d="M0,0 L8,4 L0,8 Z" class="sol-flow-canvas__edge-arrow" />
|
|
14273
|
+
</marker>
|
|
14274
|
+
</defs>
|
|
14275
|
+
@for (edge of visibleEdges(); track trackEdge(edge, $index)) {
|
|
14276
|
+
<path
|
|
14277
|
+
class="sol-flow-canvas__edge-line"
|
|
14278
|
+
[attr.d]="edgePathD(edge)"
|
|
14279
|
+
[attr.marker-end]="'url(#' + markerId + ')'"
|
|
14280
|
+
/>
|
|
14281
|
+
}
|
|
14282
|
+
@if (ghostEdgePathD(); as ghostD) {
|
|
14283
|
+
<path class="sol-flow-canvas__edge-ghost" [attr.d]="ghostD" [attr.marker-end]="'url(#' + markerId + ')'" />
|
|
14284
|
+
}
|
|
14285
|
+
</svg>
|
|
14286
|
+
|
|
14287
|
+
@for (edge of visibleEdges(); track trackEdge(edge, $index)) {
|
|
14288
|
+
<div class="sol-flow-canvas__edge-label" [style.left.px]="edgeMidpoint(edge).x" [style.top.px]="edgeMidpoint(edge).y">
|
|
14289
|
+
<span class="sol-flow-canvas__edge-label-text">{{ edge.label ?? edge.kind }}</span>
|
|
14290
|
+
@if (!isReadonly()) {
|
|
14291
|
+
<button
|
|
14292
|
+
type="button"
|
|
14293
|
+
class="sol-flow-canvas__edge-remove"
|
|
14294
|
+
[attr.aria-label]="removeConnectionLabel()"
|
|
14295
|
+
(click)="onRemoveConnection(edge)"
|
|
14296
|
+
>
|
|
14297
|
+
×
|
|
14298
|
+
</button>
|
|
14299
|
+
}
|
|
14300
|
+
</div>
|
|
14301
|
+
}
|
|
14302
|
+
|
|
14303
|
+
@for (node of mirroredNodes(); track trackNode(node, $index)) {
|
|
14304
|
+
<div
|
|
14305
|
+
class="sol-flow-canvas__node"
|
|
14306
|
+
[class.sol-flow-canvas__node--selected]="isSelected(node)"
|
|
14307
|
+
[class.sol-flow-canvas__node--highlighted]="isHighlighted(node)"
|
|
14308
|
+
[class.sol-flow-canvas__node--connect-source]="connectSourceId() === node.id"
|
|
14309
|
+
[class.sol-flow-canvas__node--connect-valid-target]="isValidConnectTarget(node)"
|
|
14310
|
+
[class.sol-flow-canvas__node--connect-invalid-target]="isInvalidConnectTarget(node)"
|
|
14311
|
+
[attr.data-visual-state]="node.visualState ?? 'idle'"
|
|
14312
|
+
[attr.data-testid]="'flow-canvas-node-' + node.id"
|
|
14313
|
+
[style.left.px]="resolvedPosition(node).x"
|
|
14314
|
+
[style.top.px]="resolvedPosition(node).y"
|
|
14315
|
+
>
|
|
14316
|
+
<button
|
|
14317
|
+
type="button"
|
|
14318
|
+
class="sol-flow-canvas__node-surface"
|
|
14319
|
+
[attr.aria-pressed]="isSelected(node)"
|
|
14320
|
+
[attr.aria-label]="nodeAriaLabel(node)"
|
|
14321
|
+
(pointerdown)="onNodePointerDown(node, $event)"
|
|
14322
|
+
(pointermove)="onNodePointerMove(node, $event)"
|
|
14323
|
+
(pointerup)="onNodePointerUp(node, $event)"
|
|
14324
|
+
(pointercancel)="onNodePointerCancel(node, $event)"
|
|
14325
|
+
(lostpointercapture)="onNodePointerCancel(node, $event)"
|
|
14326
|
+
(click)="onNodeActivate(node)"
|
|
14327
|
+
(keydown)="onNodeKeydown(node, $event)"
|
|
14328
|
+
(focus)="onNodeFocus(node)"
|
|
14329
|
+
>
|
|
14330
|
+
@if (nodeTemplate(); as tpl) {
|
|
14331
|
+
<ng-container *ngTemplateOutlet="tpl; context: nodeTemplateContext(node)" />
|
|
14332
|
+
} @else {
|
|
14333
|
+
<span class="sol-flow-canvas__node-label">{{ node.label }}</span>
|
|
14334
|
+
}
|
|
14335
|
+
</button>
|
|
14336
|
+
|
|
14337
|
+
@if (!isReadonly()) {
|
|
14338
|
+
<button
|
|
14339
|
+
type="button"
|
|
14340
|
+
class="sol-flow-canvas__node-connect-handle"
|
|
14341
|
+
[attr.aria-label]="connectFromLabel(node)"
|
|
14342
|
+
(click)="onStartConnect(node, $event)"
|
|
14343
|
+
>
|
|
14344
|
+
⇢
|
|
14345
|
+
</button>
|
|
14346
|
+
}
|
|
14347
|
+
</div>
|
|
14348
|
+
}
|
|
14349
|
+
</div>
|
|
14350
|
+
|
|
14351
|
+
@if (!isReadonly()) {
|
|
14352
|
+
<button
|
|
14353
|
+
type="button"
|
|
14354
|
+
class="sol-flow-canvas__auto-layout"
|
|
14355
|
+
data-testid="flow-canvas-auto-layout"
|
|
14356
|
+
[attr.aria-label]="autoLayoutButtonAriaLabel()"
|
|
14357
|
+
(click)="onAutoLayoutClick()"
|
|
14358
|
+
>
|
|
14359
|
+
{{ autoLayoutButtonLabel() }}
|
|
14360
|
+
</button>
|
|
14361
|
+
}
|
|
14362
|
+
|
|
14363
|
+
<div class="sol-flow-canvas__announce" aria-live="polite" role="status">{{ announcement() }}</div>
|
|
14364
|
+
</div>
|
|
14365
|
+
`, styles: [":host{display:block;position:relative}.sol-flow-canvas{position:relative;width:100%;min-height:320px;overflow:hidden;background:var(--sol-bg-sunken, var(--sol-bg-page, #f8fafc));border-radius:var(--sol-border-radius-lg, 12px);touch-action:none;--sol-flow-canvas-hit-min: min(calc(44px / var(--sol-flow-canvas-zoom, 1)), 176px)}.sol-flow-canvas__world{position:absolute;inset:0;transform-origin:0 0;will-change:transform}.sol-flow-canvas__edges{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.sol-flow-canvas__edge-line{stroke:var(--sol-border-color-default, #94a3b8);stroke-width:2;fill:none}.sol-flow-canvas__edge-ghost{stroke:var(--sol-color-info, #3b82f6);stroke-width:2;stroke-dasharray:6 4;fill:none}.sol-flow-canvas__edge-arrow{fill:var(--sol-border-color-default, #94a3b8)}.sol-flow-canvas__edge-label{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;gap:4px;background:var(--sol-bg-surface, #fff);border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-full, 999px);padding:2px 8px;font-size:var(--sol-font-size-xs, 11px);color:var(--sol-color-text-secondary, #475569);z-index:2}.sol-flow-canvas__edge-remove{border:none;background:transparent;color:var(--sol-color-danger, #ef4444);cursor:pointer;font-size:var(--sol-font-size-sm, 13px);line-height:1;display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--sol-flow-canvas-hit-min, 44px);height:var(--sol-flow-canvas-hit-min, 44px);margin:calc((13px - var(--sol-flow-canvas-hit-min, 44px)) / 2)}.sol-flow-canvas__node{position:absolute;width:180px;display:flex;align-items:stretch;gap:4px;z-index:3;touch-action:none}.sol-flow-canvas__node-surface{flex:1;display:flex;flex-direction:column;justify-content:center;min-height:var(--sol-flow-canvas-hit-min, 44px);text-align:left;padding:10px 12px;background:var(--sol-bg-surface, #fff);border:2px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-lg, 10px);box-shadow:var(--sol-shadow-sm, 0 1px 2px rgba(0, 0, 0, .06));cursor:grab;font-family:var(--sol-font-family);color:var(--sol-color-text-primary);transition:opacity .15s ease}.sol-flow-canvas__node-surface:focus-visible{outline:2px solid var(--sol-color-primary, #2563eb);outline-offset:2px}.sol-flow-canvas__node--selected .sol-flow-canvas__node-surface{border-color:var(--sol-color-primary, #2563eb)}.sol-flow-canvas__node--highlighted .sol-flow-canvas__node-surface{box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-primary, #2563eb) 30%,transparent)}.sol-flow-canvas__node--connect-source .sol-flow-canvas__node-surface{border-style:dashed;border-color:var(--sol-color-info, #3b82f6)}.sol-flow-canvas__node--connect-valid-target .sol-flow-canvas__node-surface{border-style:dashed;border-color:var(--sol-color-success, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--sol-color-success, #10b981) 25%,transparent)}.sol-flow-canvas__node--connect-invalid-target .sol-flow-canvas__node-surface{opacity:.45}.sol-flow-canvas__node[data-visual-state=running] .sol-flow-canvas__node-surface{border-color:var(--sol-color-info, #3b82f6)}.sol-flow-canvas__node[data-visual-state=ok] .sol-flow-canvas__node-surface{border-color:var(--sol-color-success, #10b981)}.sol-flow-canvas__node[data-visual-state=error] .sol-flow-canvas__node-surface{border-color:var(--sol-color-danger, #ef4444)}.sol-flow-canvas__node-label{font-size:var(--sol-font-size-sm, 13px);font-weight:600}.sol-flow-canvas__node-connect-handle{align-self:center;flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:var(--sol-flow-canvas-hit-min, 44px);min-height:var(--sol-flow-canvas-hit-min, 44px);border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-md, 8px);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-secondary, #475569);cursor:pointer}.sol-flow-canvas__announce{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sol-flow-canvas__auto-layout{display:none;position:absolute;right:12px;bottom:12px;z-index:4;min-width:44px;min-height:44px;padding:0 16px;align-items:center;justify-content:center;border:1px solid var(--sol-border-color-default, #e2e8f0);border-radius:var(--sol-border-radius-full, 999px);background:var(--sol-bg-surface, #fff);color:var(--sol-color-text-primary);font-family:var(--sol-font-family);font-size:var(--sol-font-size-sm, 13px);font-weight:600;box-shadow:var(--sol-shadow-md, 0 4px 12px rgba(0, 0, 0, .12));cursor:pointer}.sol-flow-canvas__auto-layout:focus-visible{outline:2px solid var(--sol-color-primary, #2563eb);outline-offset:2px}@media(max-width:767px){.sol-flow-canvas__auto-layout{display:inline-flex}}\n"] }]
|
|
14366
|
+
}], ctorParameters: () => [], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], edges: [{ type: i0.Input, args: [{ isSignal: true, alias: "edges", required: false }] }], isReadonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }], highlightedNodeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "highlightedNodeId", required: false }] }], nodeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodeTemplate", required: false }] }], nodeMoved: [{ type: i0.Output, args: ["nodeMoved"] }], nodeSelected: [{ type: i0.Output, args: ["nodeSelected"] }], connectionCreated: [{ type: i0.Output, args: ["connectionCreated"] }], connectionRemoved: [{ type: i0.Output, args: ["connectionRemoved"] }], canvasHostRef: [{ type: i0.ViewChild, args: ['canvasHost', { isSignal: true }] }] } });
|
|
14367
|
+
|
|
12477
14368
|
// Shared UI — atomic design system components
|
|
12478
14369
|
|
|
12479
14370
|
/*
|
|
@@ -12484,5 +14375,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
12484
14375
|
* Generated bundle index. Do not edit.
|
|
12485
14376
|
*/
|
|
12486
14377
|
|
|
12487
|
-
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, SolAvatarComponent, SolBadgeComponent, SolButtonComponent, SolCalendarComponent, SolCalendarGridComponent, SolCalendarHeaderComponent, SolCardComponent, SolChartComponent, SolCheckboxComponent, SolChipComponent, SolChipGroupComponent, SolDataTableComponent, SolDatePickerComponent, SolDayPickerComponent, SolDrawerComponent, SolEmptyStateComponent, SolFileUploadComponent, SolFormFieldComponent, SolIconButtonComponent, SolIconComponent, SolInputComponent, SolKanbanBoardComponent, SolKanbanCardComponent, SolKanbanColumnComponent, SolMessageStatusComponent, SolModalComponent, SolNumberInputComponent, SolPageHeaderComponent, SolPaginationComponent, SolProgressBarComponent, SolRichEditorComponent, SolScoreBadgeComponent, SolSearchInputComponent, SolSelectComponent, SolSkeletonComponent, SolSpinnerComponent, SolStepperComponent, SolTabsComponent, SolTextareaComponent, SolTimelineComponent, SolToggleComponent, SolTooltipComponent, SolTrendComponent, SolViewToggleComponent, SolVirtualScrollComponent, SolWizardComponent, SolWizardStepDirective, TCPDF_ALLOWED_STYLE_PROPERTIES, TCPDF_ALLOWED_TAGS, THEME_SOURCE, ThemeService, buildDayColumns, buildGoogleFontsUrl, collectUndatedNodes, computeEventHeight, computeEventTop, computeGlobalRange, computeInitials, computeMonthAxisTicks, computeNowTop, createIdentitySolI18n, dayKey, defaultStatusToken, defaultTrendFormat, getWeekStart, hashToPaletteIndex, isRenderableTheme, isSafeBackgroundImage, isSafeCssColor, parseEventDate, positionRows, provideTheme, resolveCssVars, resolveScoreTone, resolveTrendDirection, sanitizeAssetUrl, sanitizeHtmlToTcpdf, serializeElementToTcpdfHtml };
|
|
14378
|
+
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, 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, SolNumberInputComponent, SolPageHeaderComponent, SolPaginationComponent, SolProgressBarComponent, SolRichEditorComponent, SolScoreBadgeComponent, SolSearchInputComponent, SolSelectComponent, SolSkeletonComponent, SolSpinnerComponent, SolStarRatingComponent, SolStepperComponent, SolTabsComponent, SolTextareaComponent, SolTimelineComponent, SolToggleComponent, SolTooltipComponent, 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 };
|
|
12488
14379
|
//# sourceMappingURL=solercia-ui.mjs.map
|