@lesterarte/sefin-ui 0.0.4 → 0.0.6-dev.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/fesm2022/lesterarte-sefin-ui.mjs +1428 -278
- package/fesm2022/lesterarte-sefin-ui.mjs.map +1 -1
- package/package.json +12 -10
- package/types/lesterarte-sefin-ui.d.ts +380 -45
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, EventEmitter, Output, forwardRef, ViewChild, HostListener } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
6
|
+
import * as LucideIcons from 'lucide';
|
|
5
7
|
import * as i2 from '@angular/forms';
|
|
6
|
-
import {
|
|
8
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Color design tokens as TypeScript constants
|
|
@@ -551,6 +553,118 @@ class ThemeLoader {
|
|
|
551
553
|
* Shared index
|
|
552
554
|
*/
|
|
553
555
|
|
|
556
|
+
class AvatarComponent {
|
|
557
|
+
/** Avatar size. Options: 'xs' | 'sm' | 'md' | 'lg' | 'xl' */
|
|
558
|
+
size = 'md';
|
|
559
|
+
/** Image source URL */
|
|
560
|
+
src;
|
|
561
|
+
/** Alt text for the image */
|
|
562
|
+
alt = '';
|
|
563
|
+
/** Initials to display when no image is provided */
|
|
564
|
+
initials;
|
|
565
|
+
/** Whether to show a border/ring around the avatar */
|
|
566
|
+
bordered = false;
|
|
567
|
+
/** Additional CSS classes */
|
|
568
|
+
class = '';
|
|
569
|
+
get avatarClasses() {
|
|
570
|
+
return [
|
|
571
|
+
'sefin-avatar',
|
|
572
|
+
`sefin-avatar--${this.size}`,
|
|
573
|
+
this.bordered ? 'sefin-avatar--bordered' : '',
|
|
574
|
+
this.class,
|
|
575
|
+
]
|
|
576
|
+
.filter(Boolean)
|
|
577
|
+
.join(' ');
|
|
578
|
+
}
|
|
579
|
+
get displayInitials() {
|
|
580
|
+
if (this.initials) {
|
|
581
|
+
return this.initials.toUpperCase().slice(0, 2);
|
|
582
|
+
}
|
|
583
|
+
return '';
|
|
584
|
+
}
|
|
585
|
+
onImageError(event) {
|
|
586
|
+
const img = event.target;
|
|
587
|
+
img.style.display = 'none';
|
|
588
|
+
}
|
|
589
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
590
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AvatarComponent, isStandalone: true, selector: "sefin-avatar", inputs: { size: "size", src: "src", alt: "alt", initials: "initials", bordered: "bordered", class: "class" }, ngImport: i0, template: "<div [class]=\"avatarClasses\">\n <img\n *ngIf=\"src\"\n [src]=\"src\"\n [alt]=\"alt || 'Avatar'\"\n (error)=\"onImageError($event)\"\n class=\"sefin-avatar__image\"\n />\n <span *ngIf=\"!src && displayInitials\" class=\"sefin-avatar__initials\">\n {{ displayInitials }}\n </span>\n <svg\n *ngIf=\"!src && !displayInitials\"\n class=\"sefin-avatar__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n\n", styles: [".sefin-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;overflow:hidden;background-color:var(--sefin-color-surface);color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);-webkit-user-select:none;user-select:none}.sefin-avatar--xs{width:24px;height:24px;font-size:var(--sefin-font-size-xs, 10px)}.sefin-avatar--sm{width:32px;height:32px;font-size:var(--sefin-font-size-xs, 11px)}.sefin-avatar--md{width:40px;height:40px;font-size:var(--sefin-font-size-sm, 13px)}.sefin-avatar--lg{width:56px;height:56px;font-size:var(--sefin-font-size-base, 16px)}.sefin-avatar--xl{width:80px;height:80px;font-size:var(--sefin-font-size-lg, 20px)}.sefin-avatar--bordered{border:2px solid var(--sefin-color-border);box-shadow:0 0 0 2px var(--sefin-color-surface)}.sefin-avatar__image{width:100%;height:100%;object-fit:cover;display:block}.sefin-avatar__initials{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--sefin-color-text);background-color:var(--sefin-color-primary);background:linear-gradient(135deg,var(--sefin-color-primary) 0%,var(--sefin-color-primary-dark, var(--sefin-color-primary)) 100%);color:#fff;font-weight:var(--sefin-font-weight-semibold);line-height:1}.sefin-avatar__icon{width:60%;height:60%;color:var(--sefin-color-text-secondary)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
591
|
+
}
|
|
592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
593
|
+
type: Component,
|
|
594
|
+
args: [{ selector: 'sefin-avatar', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"avatarClasses\">\n <img\n *ngIf=\"src\"\n [src]=\"src\"\n [alt]=\"alt || 'Avatar'\"\n (error)=\"onImageError($event)\"\n class=\"sefin-avatar__image\"\n />\n <span *ngIf=\"!src && displayInitials\" class=\"sefin-avatar__initials\">\n {{ displayInitials }}\n </span>\n <svg\n *ngIf=\"!src && !displayInitials\"\n class=\"sefin-avatar__icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20 21V19C20 17.9391 19.5786 16.9217 18.8284 16.1716C18.0783 15.4214 17.0609 15 16 15H8C6.93913 15 5.92172 15.4214 5.17157 16.1716C4.42143 16.9217 4 17.9391 4 19V21M16 7C16 9.20914 14.2091 11 12 11C9.79086 11 8 9.20914 8 7C8 4.79086 9.79086 3 12 3C14.2091 3 16 4.79086 16 7Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n\n", styles: [".sefin-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;overflow:hidden;background-color:var(--sefin-color-surface);color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);-webkit-user-select:none;user-select:none}.sefin-avatar--xs{width:24px;height:24px;font-size:var(--sefin-font-size-xs, 10px)}.sefin-avatar--sm{width:32px;height:32px;font-size:var(--sefin-font-size-xs, 11px)}.sefin-avatar--md{width:40px;height:40px;font-size:var(--sefin-font-size-sm, 13px)}.sefin-avatar--lg{width:56px;height:56px;font-size:var(--sefin-font-size-base, 16px)}.sefin-avatar--xl{width:80px;height:80px;font-size:var(--sefin-font-size-lg, 20px)}.sefin-avatar--bordered{border:2px solid var(--sefin-color-border);box-shadow:0 0 0 2px var(--sefin-color-surface)}.sefin-avatar__image{width:100%;height:100%;object-fit:cover;display:block}.sefin-avatar__initials{display:flex;align-items:center;justify-content:center;width:100%;height:100%;color:var(--sefin-color-text);background-color:var(--sefin-color-primary);background:linear-gradient(135deg,var(--sefin-color-primary) 0%,var(--sefin-color-primary-dark, var(--sefin-color-primary)) 100%);color:#fff;font-weight:var(--sefin-font-weight-semibold);line-height:1}.sefin-avatar__icon{width:60%;height:60%;color:var(--sefin-color-text-secondary)}\n"] }]
|
|
595
|
+
}], propDecorators: { size: [{
|
|
596
|
+
type: Input
|
|
597
|
+
}], src: [{
|
|
598
|
+
type: Input
|
|
599
|
+
}], alt: [{
|
|
600
|
+
type: Input
|
|
601
|
+
}], initials: [{
|
|
602
|
+
type: Input
|
|
603
|
+
}], bordered: [{
|
|
604
|
+
type: Input
|
|
605
|
+
}], class: [{
|
|
606
|
+
type: Input
|
|
607
|
+
}] } });
|
|
608
|
+
|
|
609
|
+
class BadgeComponent {
|
|
610
|
+
/** Badge variant style. Options: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' */
|
|
611
|
+
variant = 'default';
|
|
612
|
+
/** Badge size. Options: 'sm' | 'md' | 'lg' */
|
|
613
|
+
size = 'md';
|
|
614
|
+
/** Whether the badge should be displayed as a dot (no text) */
|
|
615
|
+
dot = false;
|
|
616
|
+
/** Maximum number to show before displaying as "+N" */
|
|
617
|
+
max;
|
|
618
|
+
/** Badge value (number or text) */
|
|
619
|
+
value;
|
|
620
|
+
/** Additional CSS classes */
|
|
621
|
+
class = '';
|
|
622
|
+
get badgeClasses() {
|
|
623
|
+
return [
|
|
624
|
+
'sefin-badge',
|
|
625
|
+
`sefin-badge--${this.variant}`,
|
|
626
|
+
`sefin-badge--${this.size}`,
|
|
627
|
+
this.dot ? 'sefin-badge--dot' : '',
|
|
628
|
+
this.class,
|
|
629
|
+
]
|
|
630
|
+
.filter(Boolean)
|
|
631
|
+
.join(' ');
|
|
632
|
+
}
|
|
633
|
+
get displayValue() {
|
|
634
|
+
if (this.dot) {
|
|
635
|
+
return '';
|
|
636
|
+
}
|
|
637
|
+
if (this.value === undefined || this.value === null) {
|
|
638
|
+
return '';
|
|
639
|
+
}
|
|
640
|
+
if (typeof this.value === 'number') {
|
|
641
|
+
if (this.max !== undefined && this.value > this.max) {
|
|
642
|
+
return `+${this.max}`;
|
|
643
|
+
}
|
|
644
|
+
return String(this.value);
|
|
645
|
+
}
|
|
646
|
+
return String(this.value);
|
|
647
|
+
}
|
|
648
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
649
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: BadgeComponent, isStandalone: true, selector: "sefin-badge", inputs: { variant: "variant", size: "size", dot: "dot", max: "max", value: "value", class: "class" }, ngImport: i0, template: "<span [class]=\"badgeClasses\" [attr.aria-label]=\"displayValue || 'Badge'\">\n <span *ngIf=\"!dot\" class=\"sefin-badge__content\">{{ displayValue }}</span>\n</span>", styles: [".sefin-badge{display:inline-flex;align-items:center;justify-content:center;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:1;border-radius:var(--sefin-border-radius-full, 9999px);white-space:nowrap;vertical-align:middle;box-sizing:border-box}.sefin-badge--sm{min-width:16px;height:16px;padding:0 var(--sefin-spacing-xs, 4px);font-size:var(--sefin-font-size-xs, 10px)}.sefin-badge--sm:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-xs, 4px)}.sefin-badge--md{min-width:20px;height:20px;padding:0 var(--sefin-spacing-xs, 4px);font-size:var(--sefin-font-size-xs, 11px)}.sefin-badge--md:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-sm, 6px)}.sefin-badge--lg{min-width:24px;height:24px;padding:0 var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 12px)}.sefin-badge--lg:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-md, 8px)}.sefin-badge--dot{width:8px;height:8px;min-width:8px;padding:0;border-radius:50%!important}.sefin-badge--dot.sefin-badge--sm{width:6px;height:6px;min-width:6px;border-radius:50%!important}.sefin-badge--dot.sefin-badge--md{width:8px;height:8px;min-width:8px;border-radius:50%!important}.sefin-badge--dot.sefin-badge--lg{width:10px;height:10px;min-width:10px;border-radius:50%!important}.sefin-badge--default{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-badge--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-badge--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-badge--success{background-color:var(--sefin-color-success);color:#fff}.sefin-badge--warning{background-color:var(--sefin-color-warning);color:#fff}.sefin-badge--error{background-color:var(--sefin-color-error);color:#fff}.sefin-badge__content{display:inline-block;line-height:1}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
650
|
+
}
|
|
651
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
652
|
+
type: Component,
|
|
653
|
+
args: [{ selector: 'sefin-badge', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [class]=\"badgeClasses\" [attr.aria-label]=\"displayValue || 'Badge'\">\n <span *ngIf=\"!dot\" class=\"sefin-badge__content\">{{ displayValue }}</span>\n</span>", styles: [".sefin-badge{display:inline-flex;align-items:center;justify-content:center;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:1;border-radius:var(--sefin-border-radius-full, 9999px);white-space:nowrap;vertical-align:middle;box-sizing:border-box}.sefin-badge--sm{min-width:16px;height:16px;padding:0 var(--sefin-spacing-xs, 4px);font-size:var(--sefin-font-size-xs, 10px)}.sefin-badge--sm:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-xs, 4px)}.sefin-badge--md{min-width:20px;height:20px;padding:0 var(--sefin-spacing-xs, 4px);font-size:var(--sefin-font-size-xs, 11px)}.sefin-badge--md:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-sm, 6px)}.sefin-badge--lg{min-width:24px;height:24px;padding:0 var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 12px)}.sefin-badge--lg:not(.sefin-badge--dot){padding:0 var(--sefin-spacing-md, 8px)}.sefin-badge--dot{width:8px;height:8px;min-width:8px;padding:0;border-radius:50%!important}.sefin-badge--dot.sefin-badge--sm{width:6px;height:6px;min-width:6px;border-radius:50%!important}.sefin-badge--dot.sefin-badge--md{width:8px;height:8px;min-width:8px;border-radius:50%!important}.sefin-badge--dot.sefin-badge--lg{width:10px;height:10px;min-width:10px;border-radius:50%!important}.sefin-badge--default{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-badge--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-badge--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-badge--success{background-color:var(--sefin-color-success);color:#fff}.sefin-badge--warning{background-color:var(--sefin-color-warning);color:#fff}.sefin-badge--error{background-color:var(--sefin-color-error);color:#fff}.sefin-badge__content{display:inline-block;line-height:1}\n"] }]
|
|
654
|
+
}], propDecorators: { variant: [{
|
|
655
|
+
type: Input
|
|
656
|
+
}], size: [{
|
|
657
|
+
type: Input
|
|
658
|
+
}], dot: [{
|
|
659
|
+
type: Input
|
|
660
|
+
}], max: [{
|
|
661
|
+
type: Input
|
|
662
|
+
}], value: [{
|
|
663
|
+
type: Input
|
|
664
|
+
}], class: [{
|
|
665
|
+
type: Input
|
|
666
|
+
}] } });
|
|
667
|
+
|
|
554
668
|
class ButtonComponent {
|
|
555
669
|
/** Button variant style. Options: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' */
|
|
556
670
|
variant = 'primary';
|
|
@@ -599,6 +713,338 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
599
713
|
type: Output
|
|
600
714
|
}] } });
|
|
601
715
|
|
|
716
|
+
const SIZE_MAP = {
|
|
717
|
+
xs: 12,
|
|
718
|
+
sm: 16,
|
|
719
|
+
md: 24,
|
|
720
|
+
lg: 32,
|
|
721
|
+
xl: 48,
|
|
722
|
+
};
|
|
723
|
+
const ICON_COMPONENT_MAP = {
|
|
724
|
+
home: LucideIcons.Home,
|
|
725
|
+
menu: LucideIcons.Menu,
|
|
726
|
+
'x': LucideIcons.X,
|
|
727
|
+
'arrow-left': LucideIcons.ArrowLeft,
|
|
728
|
+
'arrow-right': LucideIcons.ArrowRight,
|
|
729
|
+
'arrow-up': LucideIcons.ArrowUp,
|
|
730
|
+
'arrow-down': LucideIcons.ArrowDown,
|
|
731
|
+
'chevron-left': LucideIcons.ChevronLeft,
|
|
732
|
+
'chevron-right': LucideIcons.ChevronRight,
|
|
733
|
+
'chevron-up': LucideIcons.ChevronUp,
|
|
734
|
+
'chevron-down': LucideIcons.ChevronDown,
|
|
735
|
+
'plus': LucideIcons.Plus,
|
|
736
|
+
'minus': LucideIcons.Minus,
|
|
737
|
+
'edit': LucideIcons.Edit,
|
|
738
|
+
'trash-2': LucideIcons.Trash2,
|
|
739
|
+
'save': LucideIcons.Save,
|
|
740
|
+
'search': LucideIcons.Search,
|
|
741
|
+
'filter': LucideIcons.Filter,
|
|
742
|
+
'more-vertical': LucideIcons.MoreVertical,
|
|
743
|
+
'more-horizontal': LucideIcons.MoreHorizontal,
|
|
744
|
+
'check': LucideIcons.Check,
|
|
745
|
+
'check-circle': LucideIcons.CheckCircle,
|
|
746
|
+
'x-circle': LucideIcons.XCircle,
|
|
747
|
+
'info': LucideIcons.Info,
|
|
748
|
+
'alert-triangle': LucideIcons.AlertTriangle,
|
|
749
|
+
'alert-circle': LucideIcons.AlertCircle,
|
|
750
|
+
'star': LucideIcons.Star,
|
|
751
|
+
'mail': LucideIcons.Mail,
|
|
752
|
+
'bell': LucideIcons.Bell,
|
|
753
|
+
'share-2': LucideIcons.Share2,
|
|
754
|
+
'file': LucideIcons.File,
|
|
755
|
+
'folder': LucideIcons.Folder,
|
|
756
|
+
'download': LucideIcons.Download,
|
|
757
|
+
'upload': LucideIcons.Upload,
|
|
758
|
+
'settings': LucideIcons.Settings,
|
|
759
|
+
'refresh-cw': LucideIcons.RefreshCw,
|
|
760
|
+
'lock': LucideIcons.Lock,
|
|
761
|
+
'unlock': LucideIcons.Unlock,
|
|
762
|
+
'eye': LucideIcons.Eye,
|
|
763
|
+
'eye-off': LucideIcons.EyeOff,
|
|
764
|
+
'user': LucideIcons.User,
|
|
765
|
+
'user-circle': LucideIcons.UserCircle,
|
|
766
|
+
'log-out': LucideIcons.LogOut,
|
|
767
|
+
'log-in': LucideIcons.LogIn,
|
|
768
|
+
};
|
|
769
|
+
const ICON_NAME_MAP = {
|
|
770
|
+
home: 'home',
|
|
771
|
+
menu: 'menu',
|
|
772
|
+
close: 'x',
|
|
773
|
+
arrow_back: 'arrow-left',
|
|
774
|
+
arrow_forward: 'arrow-right',
|
|
775
|
+
arrow_up: 'arrow-up',
|
|
776
|
+
arrow_down: 'arrow-down',
|
|
777
|
+
chevron_left: 'chevron-left',
|
|
778
|
+
chevron_right: 'chevron-right',
|
|
779
|
+
chevron_up: 'chevron-up',
|
|
780
|
+
chevron_down: 'chevron-down',
|
|
781
|
+
add: 'plus',
|
|
782
|
+
remove: 'minus',
|
|
783
|
+
edit: 'edit',
|
|
784
|
+
delete: 'trash-2',
|
|
785
|
+
save: 'save',
|
|
786
|
+
search: 'search',
|
|
787
|
+
filter: 'filter',
|
|
788
|
+
more_vert: 'more-vertical',
|
|
789
|
+
more_horiz: 'more-horizontal',
|
|
790
|
+
check: 'check',
|
|
791
|
+
check_circle: 'check-circle',
|
|
792
|
+
cancel: 'x-circle',
|
|
793
|
+
info: 'info',
|
|
794
|
+
warning: 'alert-triangle',
|
|
795
|
+
error: 'alert-circle',
|
|
796
|
+
star: 'star',
|
|
797
|
+
star_filled: 'star',
|
|
798
|
+
mail: 'mail',
|
|
799
|
+
notification: 'bell',
|
|
800
|
+
share: 'share-2',
|
|
801
|
+
file: 'file',
|
|
802
|
+
folder: 'folder',
|
|
803
|
+
download: 'download',
|
|
804
|
+
upload: 'upload',
|
|
805
|
+
settings: 'settings',
|
|
806
|
+
refresh: 'refresh-cw',
|
|
807
|
+
lock: 'lock',
|
|
808
|
+
unlock: 'unlock',
|
|
809
|
+
visibility: 'eye',
|
|
810
|
+
visibility_off: 'eye-off',
|
|
811
|
+
person: 'user',
|
|
812
|
+
account_circle: 'user-circle',
|
|
813
|
+
logout: 'log-out',
|
|
814
|
+
login: 'log-in',
|
|
815
|
+
};
|
|
816
|
+
class IconComponent {
|
|
817
|
+
injector;
|
|
818
|
+
sanitizer = null;
|
|
819
|
+
constructor(injector) {
|
|
820
|
+
this.injector = injector;
|
|
821
|
+
try {
|
|
822
|
+
this.sanitizer = this.injector.get(DomSanitizer, null);
|
|
823
|
+
}
|
|
824
|
+
catch (e) {
|
|
825
|
+
this.sanitizer = null;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
/** Icon name from Lucide Angular (e.g., 'home', 'search', 'user') */
|
|
829
|
+
name;
|
|
830
|
+
/** Icon size. Options: 'xs' | 'sm' | 'md' | 'lg' | 'xl' */
|
|
831
|
+
size = 'md';
|
|
832
|
+
/** Custom color for the icon */
|
|
833
|
+
color;
|
|
834
|
+
/** Whether the icon should be rotated 180 degrees */
|
|
835
|
+
rotate = false;
|
|
836
|
+
/** Whether the icon should be flipped horizontally */
|
|
837
|
+
flipH = false;
|
|
838
|
+
/** Whether the icon should be flipped vertically */
|
|
839
|
+
flipV = false;
|
|
840
|
+
/** Additional CSS classes */
|
|
841
|
+
class = '';
|
|
842
|
+
get iconClasses() {
|
|
843
|
+
return [
|
|
844
|
+
'sefin-icon',
|
|
845
|
+
`sefin-icon--${this.size}`,
|
|
846
|
+
this.rotate ? 'sefin-icon--rotate' : '',
|
|
847
|
+
this.flipH ? 'sefin-icon--flip-h' : '',
|
|
848
|
+
this.flipV ? 'sefin-icon--flip-v' : '',
|
|
849
|
+
this.class,
|
|
850
|
+
]
|
|
851
|
+
.filter(Boolean)
|
|
852
|
+
.join(' ');
|
|
853
|
+
}
|
|
854
|
+
get sizeValue() {
|
|
855
|
+
return SIZE_MAP[this.size];
|
|
856
|
+
}
|
|
857
|
+
get lucideIconName() {
|
|
858
|
+
if (!this.name) {
|
|
859
|
+
return undefined;
|
|
860
|
+
}
|
|
861
|
+
return ICON_NAME_MAP[this.name] || this.name;
|
|
862
|
+
}
|
|
863
|
+
get iconSvgHtml() {
|
|
864
|
+
const iconName = this.lucideIconName;
|
|
865
|
+
if (!iconName) {
|
|
866
|
+
return '';
|
|
867
|
+
}
|
|
868
|
+
let iconData = ICON_COMPONENT_MAP[iconName];
|
|
869
|
+
if (!iconData) {
|
|
870
|
+
const pascalCaseName = iconName
|
|
871
|
+
.split('-')
|
|
872
|
+
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
873
|
+
.join('');
|
|
874
|
+
iconData = LucideIcons[pascalCaseName];
|
|
875
|
+
}
|
|
876
|
+
if (!iconData || !Array.isArray(iconData)) {
|
|
877
|
+
return '';
|
|
878
|
+
}
|
|
879
|
+
try {
|
|
880
|
+
const size = this.sizeValue;
|
|
881
|
+
const color = this.color || 'currentColor';
|
|
882
|
+
const transform = this.getTransform();
|
|
883
|
+
const paths = iconData
|
|
884
|
+
.map((item) => {
|
|
885
|
+
if (!Array.isArray(item) || item.length < 2) {
|
|
886
|
+
return '';
|
|
887
|
+
}
|
|
888
|
+
const tag = item[0];
|
|
889
|
+
const attrs = item[1] || {};
|
|
890
|
+
if (tag === 'path') {
|
|
891
|
+
const d = attrs.d || '';
|
|
892
|
+
return `<path d="${d}"></path>`;
|
|
893
|
+
}
|
|
894
|
+
if (tag === 'circle') {
|
|
895
|
+
return `<circle cx="${attrs.cx || 0}" cy="${attrs.cy || 0}" r="${attrs.r || 0}"></circle>`;
|
|
896
|
+
}
|
|
897
|
+
if (tag === 'line') {
|
|
898
|
+
return `<line x1="${attrs.x1 || 0}" y1="${attrs.y1 || 0}" x2="${attrs.x2 || 0}" y2="${attrs.y2 || 0}"></line>`;
|
|
899
|
+
}
|
|
900
|
+
if (tag === 'polyline') {
|
|
901
|
+
const points = attrs.points || '';
|
|
902
|
+
return `<polyline points="${points}"></polyline>`;
|
|
903
|
+
}
|
|
904
|
+
if (tag === 'rect') {
|
|
905
|
+
return `<rect x="${attrs.x || 0}" y="${attrs.y || 0}" width="${attrs.width || 0}" height="${attrs.height || 0}"></rect>`;
|
|
906
|
+
}
|
|
907
|
+
if (tag === 'polygon') {
|
|
908
|
+
const points = attrs.points || '';
|
|
909
|
+
return `<polygon points="${points}"></polygon>`;
|
|
910
|
+
}
|
|
911
|
+
return '';
|
|
912
|
+
})
|
|
913
|
+
.filter(Boolean)
|
|
914
|
+
.join('');
|
|
915
|
+
if (!paths) {
|
|
916
|
+
return '';
|
|
917
|
+
}
|
|
918
|
+
const transformAttr = transform ? ` style="transform: ${transform}"` : '';
|
|
919
|
+
const safeColor = color.includes('"') ? color.replace(/"/g, '"') : color;
|
|
920
|
+
const svgHtml = `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="${safeColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"${transformAttr}>${paths}</svg>`;
|
|
921
|
+
if (this.sanitizer) {
|
|
922
|
+
return this.sanitizer.bypassSecurityTrustHtml(svgHtml);
|
|
923
|
+
}
|
|
924
|
+
return svgHtml;
|
|
925
|
+
}
|
|
926
|
+
catch (error) {
|
|
927
|
+
return '';
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
escapeHtml(text) {
|
|
931
|
+
if (typeof document === 'undefined') {
|
|
932
|
+
return text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
933
|
+
}
|
|
934
|
+
const div = document.createElement('div');
|
|
935
|
+
div.textContent = text;
|
|
936
|
+
return div.innerHTML;
|
|
937
|
+
}
|
|
938
|
+
getTransform() {
|
|
939
|
+
const transforms = [];
|
|
940
|
+
if (this.rotate)
|
|
941
|
+
transforms.push('rotate(180)');
|
|
942
|
+
if (this.flipH)
|
|
943
|
+
transforms.push('scaleX(-1)');
|
|
944
|
+
if (this.flipV)
|
|
945
|
+
transforms.push('scaleY(-1)');
|
|
946
|
+
return transforms.length > 0 ? transforms.join(' ') : '';
|
|
947
|
+
}
|
|
948
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: IconComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
|
|
949
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: IconComponent, isStandalone: true, selector: "sefin-icon", inputs: { name: "name", size: "size", color: "color", rotate: "rotate", flipH: "flipH", flipV: "flipV", class: "class" }, ngImport: i0, template: "<span\n [class]=\"iconClasses\"\n [attr.aria-hidden]=\"true\"\n role=\"img\"\n style=\"display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%;\"\n>\n <span [innerHTML]=\"iconSvgHtml\" style=\"display: inline-block; width: 100%; height: 100%;\"></span>\n</span>\n\n", styles: [".sefin-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;box-sizing:border-box;color:currentColor;line-height:1}.sefin-icon--xs{width:12px;height:12px;font-size:12px}.sefin-icon--xs ::ng-deep svg{width:12px;height:12px}.sefin-icon--sm{width:16px;height:16px;font-size:16px}.sefin-icon--sm ::ng-deep svg{width:16px;height:16px}.sefin-icon--md{width:24px;height:24px;font-size:24px}.sefin-icon--md ::ng-deep svg{width:24px;height:24px}.sefin-icon--lg{width:32px;height:32px;font-size:32px}.sefin-icon--lg ::ng-deep svg{width:32px;height:32px}.sefin-icon--xl{width:48px;height:48px;font-size:48px}.sefin-icon--xl ::ng-deep svg{width:48px;height:48px}.sefin-icon--rotate{transform:rotate(180deg)}.sefin-icon--flip-h{transform:scaleX(-1)}.sefin-icon--flip-v{transform:scaleY(-1)}.sefin-icon--flip-h.sefin-icon--flip-v{transform:scale(-1)}.sefin-icon ::ng-deep svg{display:block!important;width:100%!important;height:100%!important;max-width:100%;max-height:100%}.sefin-icon>*{display:inline-block;width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
950
|
+
}
|
|
951
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
952
|
+
type: Component,
|
|
953
|
+
args: [{ selector: 'sefin-icon', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [class]=\"iconClasses\"\n [attr.aria-hidden]=\"true\"\n role=\"img\"\n style=\"display: inline-flex; align-items: center; justify-content: center; width: 100%; height: 100%;\"\n>\n <span [innerHTML]=\"iconSvgHtml\" style=\"display: inline-block; width: 100%; height: 100%;\"></span>\n</span>\n\n", styles: [".sefin-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;vertical-align:middle;box-sizing:border-box;color:currentColor;line-height:1}.sefin-icon--xs{width:12px;height:12px;font-size:12px}.sefin-icon--xs ::ng-deep svg{width:12px;height:12px}.sefin-icon--sm{width:16px;height:16px;font-size:16px}.sefin-icon--sm ::ng-deep svg{width:16px;height:16px}.sefin-icon--md{width:24px;height:24px;font-size:24px}.sefin-icon--md ::ng-deep svg{width:24px;height:24px}.sefin-icon--lg{width:32px;height:32px;font-size:32px}.sefin-icon--lg ::ng-deep svg{width:32px;height:32px}.sefin-icon--xl{width:48px;height:48px;font-size:48px}.sefin-icon--xl ::ng-deep svg{width:48px;height:48px}.sefin-icon--rotate{transform:rotate(180deg)}.sefin-icon--flip-h{transform:scaleX(-1)}.sefin-icon--flip-v{transform:scaleY(-1)}.sefin-icon--flip-h.sefin-icon--flip-v{transform:scale(-1)}.sefin-icon ::ng-deep svg{display:block!important;width:100%!important;height:100%!important;max-width:100%;max-height:100%}.sefin-icon>*{display:inline-block;width:100%;height:100%}\n"] }]
|
|
954
|
+
}], ctorParameters: () => [{ type: i0.Injector }], propDecorators: { name: [{
|
|
955
|
+
type: Input
|
|
956
|
+
}], size: [{
|
|
957
|
+
type: Input
|
|
958
|
+
}], color: [{
|
|
959
|
+
type: Input
|
|
960
|
+
}], rotate: [{
|
|
961
|
+
type: Input
|
|
962
|
+
}], flipH: [{
|
|
963
|
+
type: Input
|
|
964
|
+
}], flipV: [{
|
|
965
|
+
type: Input
|
|
966
|
+
}], class: [{
|
|
967
|
+
type: Input
|
|
968
|
+
}] } });
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Lucide Icon Map
|
|
972
|
+
* Maps icon names to Lucide Angular components
|
|
973
|
+
* This allows us to use Lucide icons internally while maintaining our API
|
|
974
|
+
*/
|
|
975
|
+
// Dynamic import map - will be populated at runtime
|
|
976
|
+
// Note: Some icons may be exported as data, so we use 'any' for flexibility
|
|
977
|
+
const LUCIDE_ICON_MAP = {
|
|
978
|
+
// Navigation
|
|
979
|
+
home: () => import('lucide-angular').then((m) => ({ default: m.Home })),
|
|
980
|
+
menu: () => import('lucide-angular').then((m) => ({ default: m.Menu })),
|
|
981
|
+
close: () => import('lucide-angular').then((m) => ({ default: m.X })),
|
|
982
|
+
arrow_back: () => import('lucide-angular').then((m) => ({ default: m.ArrowLeft })),
|
|
983
|
+
arrow_forward: () => import('lucide-angular').then((m) => ({ default: m.ArrowRight })),
|
|
984
|
+
arrow_up: () => import('lucide-angular').then((m) => ({ default: m.ArrowUp })),
|
|
985
|
+
arrow_down: () => import('lucide-angular').then((m) => ({ default: m.ArrowDown })),
|
|
986
|
+
chevron_left: () => import('lucide-angular').then((m) => ({ default: m.ChevronLeft })),
|
|
987
|
+
chevron_right: () => import('lucide-angular').then((m) => ({ default: m.ChevronRight })),
|
|
988
|
+
chevron_up: () => import('lucide-angular').then((m) => ({ default: m.ChevronUp })),
|
|
989
|
+
chevron_down: () => import('lucide-angular').then((m) => ({ default: m.ChevronDown })),
|
|
990
|
+
// Actions
|
|
991
|
+
add: () => import('lucide-angular').then((m) => ({ default: m.Plus })),
|
|
992
|
+
remove: () => import('lucide-angular').then((m) => ({ default: m.Minus })),
|
|
993
|
+
edit: () => import('lucide-angular').then((m) => ({ default: m.Edit })),
|
|
994
|
+
delete: () => import('lucide-angular').then((m) => ({ default: m.Trash2 })),
|
|
995
|
+
save: () => import('lucide-angular').then((m) => ({ default: m.Save })),
|
|
996
|
+
search: () => import('lucide-angular').then((m) => ({ default: m.Search })),
|
|
997
|
+
filter: () => import('lucide-angular').then((m) => ({ default: m.Filter })),
|
|
998
|
+
more_vert: () => import('lucide-angular').then((m) => ({ default: m.MoreVertical })),
|
|
999
|
+
more_horiz: () => import('lucide-angular').then((m) => ({ default: m.MoreHorizontal })),
|
|
1000
|
+
// Status
|
|
1001
|
+
check: () => import('lucide-angular').then((m) => ({ default: m.Check })),
|
|
1002
|
+
check_circle: () => import('lucide-angular').then((m) => ({ default: m.CheckCircle })),
|
|
1003
|
+
cancel: () => import('lucide-angular').then((m) => ({ default: m.XCircle })),
|
|
1004
|
+
info: () => import('lucide-angular').then((m) => ({ default: m.Info })),
|
|
1005
|
+
warning: () => import('lucide-angular').then((m) => ({ default: m.AlertTriangle })),
|
|
1006
|
+
error: () => import('lucide-angular').then((m) => ({ default: m.AlertCircle })),
|
|
1007
|
+
star: () => import('lucide-angular').then((m) => ({ default: m.Star })),
|
|
1008
|
+
star_filled: () => import('lucide-angular').then((m) => ({ default: m.Star })),
|
|
1009
|
+
// Communication
|
|
1010
|
+
mail: () => import('lucide-angular').then((m) => ({ default: m.Mail })),
|
|
1011
|
+
notification: () => import('lucide-angular').then((m) => ({ default: m.Bell })),
|
|
1012
|
+
share: () => import('lucide-angular').then((m) => ({ default: m.Share2 })),
|
|
1013
|
+
// Files
|
|
1014
|
+
file: () => import('lucide-angular').then((m) => ({ default: m.File })),
|
|
1015
|
+
folder: () => import('lucide-angular').then((m) => ({ default: m.Folder })),
|
|
1016
|
+
download: () => import('lucide-angular').then((m) => ({ default: m.Download })),
|
|
1017
|
+
upload: () => import('lucide-angular').then((m) => ({ default: m.Upload })),
|
|
1018
|
+
// Settings
|
|
1019
|
+
settings: () => import('lucide-angular').then((m) => ({ default: m.Settings })),
|
|
1020
|
+
refresh: () => import('lucide-angular').then((m) => ({ default: m.RefreshCw })),
|
|
1021
|
+
lock: () => import('lucide-angular').then((m) => ({ default: m.Lock })),
|
|
1022
|
+
unlock: () => import('lucide-angular').then((m) => ({ default: m.Unlock })),
|
|
1023
|
+
visibility: () => import('lucide-angular').then((m) => ({ default: m.Eye })),
|
|
1024
|
+
visibility_off: () => import('lucide-angular').then((m) => ({ default: m.EyeOff })),
|
|
1025
|
+
// User
|
|
1026
|
+
person: () => import('lucide-angular').then((m) => ({ default: m.User })),
|
|
1027
|
+
account_circle: () => import('lucide-angular').then((m) => ({ default: m.UserCircle })),
|
|
1028
|
+
logout: () => import('lucide-angular').then((m) => ({ default: m.LogOut })),
|
|
1029
|
+
login: () => import('lucide-angular').then((m) => ({ default: m.LogIn })),
|
|
1030
|
+
};
|
|
1031
|
+
/**
|
|
1032
|
+
* Get Lucide icon component by name
|
|
1033
|
+
*/
|
|
1034
|
+
function getLucideIcon(name) {
|
|
1035
|
+
return LUCIDE_ICON_MAP[name] || null;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* Check if an icon name has a Lucide mapping
|
|
1039
|
+
*/
|
|
1040
|
+
function hasLucideIcon(name) {
|
|
1041
|
+
return name in LUCIDE_ICON_MAP;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
* Icon exports
|
|
1046
|
+
*/
|
|
1047
|
+
|
|
602
1048
|
class IconButtonComponent {
|
|
603
1049
|
/** Button variant style. Options: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' */
|
|
604
1050
|
variant = 'primary';
|
|
@@ -656,6 +1102,170 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
656
1102
|
type: Output
|
|
657
1103
|
}] } });
|
|
658
1104
|
|
|
1105
|
+
class FabButtonComponent {
|
|
1106
|
+
/** Button variant style. Options: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' */
|
|
1107
|
+
variant = 'primary';
|
|
1108
|
+
/** FAB size. Options: 'sm' | 'md' | 'lg' */
|
|
1109
|
+
size = 'md';
|
|
1110
|
+
/** Whether the button is disabled */
|
|
1111
|
+
disabled = false;
|
|
1112
|
+
/** Button type. Options: 'button' | 'submit' | 'reset' */
|
|
1113
|
+
type = 'button';
|
|
1114
|
+
/** Additional CSS classes */
|
|
1115
|
+
class = '';
|
|
1116
|
+
/** Accessibility label for the button */
|
|
1117
|
+
ariaLabel = '';
|
|
1118
|
+
clicked = new EventEmitter();
|
|
1119
|
+
onClick(event) {
|
|
1120
|
+
if (!this.disabled) {
|
|
1121
|
+
this.clicked.emit(event);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
get buttonClasses() {
|
|
1125
|
+
return [
|
|
1126
|
+
'sefin-fab-button',
|
|
1127
|
+
`sefin-fab-button--${this.variant}`,
|
|
1128
|
+
`sefin-fab-button--${this.size}`,
|
|
1129
|
+
this.disabled ? 'sefin-fab-button--disabled' : '',
|
|
1130
|
+
this.class,
|
|
1131
|
+
]
|
|
1132
|
+
.filter(Boolean)
|
|
1133
|
+
.join(' ');
|
|
1134
|
+
}
|
|
1135
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FabButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: FabButtonComponent, isStandalone: true, selector: "sefin-fab-button", inputs: { variant: "variant", size: "size", disabled: "disabled", type: "type", class: "class", ariaLabel: "ariaLabel" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button \n [type]=\"type\" \n [disabled]=\"disabled\" \n [class]=\"buttonClasses\" \n (click)=\"onClick($event)\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-content></ng-content>\n</button>\n\n", styles: [".sefin-fab-button{display:inline-flex;align-items:center;justify-content:center;font-family:var(--sefin-font-family-base);border-radius:50%;transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent;padding:0;aspect-ratio:1;flex-shrink:0;box-shadow:var(--sefin-shadow-lg);position:relative}.sefin-fab-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-fab-button--sm{width:40px;height:40px;min-width:40px;min-height:40px;box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--md{width:56px;height:56px;min-width:56px;min-height:56px;box-shadow:var(--sefin-shadow-lg)}.sefin-fab-button--lg{width:64px;height:64px;min-width:64px;min-height:64px;box-shadow:var(--sefin-shadow-xl)}.sefin-fab-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-fab-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark);box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--primary:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-fab-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark);box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--secondary:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--outline{background-color:var(--sefin-color-surface);color:var(--sefin-color-primary);border-color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff;box-shadow:var(--sefin-shadow-lg);transform:translateY(-2px)}.sefin-fab-button--outline:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--ghost{background-color:var(--sefin-color-surface);color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover);box-shadow:var(--sefin-shadow-lg);transform:translateY(-2px)}.sefin-fab-button--ghost:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-sm)}.sefin-fab-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-fab-button--danger:hover:not(:disabled){opacity:.9;box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--danger:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none;box-shadow:var(--sefin-shadow-sm)}.sefin-fab-button svg{display:block;flex-shrink:0}.sefin-fab-button--sm svg{width:20px;height:20px}.sefin-fab-button--md svg{width:24px;height:24px}.sefin-fab-button--lg svg{width:28px;height:28px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1137
|
+
}
|
|
1138
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FabButtonComponent, decorators: [{
|
|
1139
|
+
type: Component,
|
|
1140
|
+
args: [{ selector: 'sefin-fab-button', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n [type]=\"type\" \n [disabled]=\"disabled\" \n [class]=\"buttonClasses\" \n (click)=\"onClick($event)\"\n [attr.aria-label]=\"ariaLabel || null\"\n>\n <ng-content></ng-content>\n</button>\n\n", styles: [".sefin-fab-button{display:inline-flex;align-items:center;justify-content:center;font-family:var(--sefin-font-family-base);border-radius:50%;transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent;padding:0;aspect-ratio:1;flex-shrink:0;box-shadow:var(--sefin-shadow-lg);position:relative}.sefin-fab-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-fab-button--sm{width:40px;height:40px;min-width:40px;min-height:40px;box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--md{width:56px;height:56px;min-width:56px;min-height:56px;box-shadow:var(--sefin-shadow-lg)}.sefin-fab-button--lg{width:64px;height:64px;min-width:64px;min-height:64px;box-shadow:var(--sefin-shadow-xl)}.sefin-fab-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-fab-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark);box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--primary:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-fab-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark);box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--secondary:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--outline{background-color:var(--sefin-color-surface);color:var(--sefin-color-primary);border-color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff;box-shadow:var(--sefin-shadow-lg);transform:translateY(-2px)}.sefin-fab-button--outline:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--ghost{background-color:var(--sefin-color-surface);color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover);box-shadow:var(--sefin-shadow-lg);transform:translateY(-2px)}.sefin-fab-button--ghost:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-sm)}.sefin-fab-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-fab-button--danger:hover:not(:disabled){opacity:.9;box-shadow:var(--sefin-shadow-xl);transform:translateY(-2px)}.sefin-fab-button--danger:active:not(:disabled){transform:translateY(0);box-shadow:var(--sefin-shadow-md)}.sefin-fab-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none;box-shadow:var(--sefin-shadow-sm)}.sefin-fab-button svg{display:block;flex-shrink:0}.sefin-fab-button--sm svg{width:20px;height:20px}.sefin-fab-button--md svg{width:24px;height:24px}.sefin-fab-button--lg svg{width:28px;height:28px}\n"] }]
|
|
1141
|
+
}], propDecorators: { variant: [{
|
|
1142
|
+
type: Input
|
|
1143
|
+
}], size: [{
|
|
1144
|
+
type: Input
|
|
1145
|
+
}], disabled: [{
|
|
1146
|
+
type: Input
|
|
1147
|
+
}], type: [{
|
|
1148
|
+
type: Input
|
|
1149
|
+
}], class: [{
|
|
1150
|
+
type: Input
|
|
1151
|
+
}], ariaLabel: [{
|
|
1152
|
+
type: Input
|
|
1153
|
+
}], clicked: [{
|
|
1154
|
+
type: Output
|
|
1155
|
+
}] } });
|
|
1156
|
+
|
|
1157
|
+
class ChipComponent {
|
|
1158
|
+
/** Chip variant style. Options: 'default' | 'primary' | 'secondary' | 'outline' | 'ghost' */
|
|
1159
|
+
variant = 'default';
|
|
1160
|
+
/** Chip size. Options: 'sm' | 'md' | 'lg' */
|
|
1161
|
+
size = 'md';
|
|
1162
|
+
/** Whether the chip is disabled */
|
|
1163
|
+
disabled = false;
|
|
1164
|
+
/** Whether the chip can be removed (shows remove button) */
|
|
1165
|
+
removable = false;
|
|
1166
|
+
/** Whether the chip is selected (for selectable chips) */
|
|
1167
|
+
selected = false;
|
|
1168
|
+
/** Additional CSS classes */
|
|
1169
|
+
class = '';
|
|
1170
|
+
removed = new EventEmitter();
|
|
1171
|
+
clicked = new EventEmitter();
|
|
1172
|
+
onRemove(event) {
|
|
1173
|
+
event.stopPropagation();
|
|
1174
|
+
if (!this.disabled) {
|
|
1175
|
+
this.removed.emit(event);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
onClick(event) {
|
|
1179
|
+
if (!this.disabled) {
|
|
1180
|
+
this.clicked.emit(event);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
get chipClasses() {
|
|
1184
|
+
return [
|
|
1185
|
+
'sefin-chip',
|
|
1186
|
+
`sefin-chip--${this.variant}`,
|
|
1187
|
+
`sefin-chip--${this.size}`,
|
|
1188
|
+
this.disabled ? 'sefin-chip--disabled' : '',
|
|
1189
|
+
this.selected ? 'sefin-chip--selected' : '',
|
|
1190
|
+
this.class,
|
|
1191
|
+
]
|
|
1192
|
+
.filter(Boolean)
|
|
1193
|
+
.join(' ');
|
|
1194
|
+
}
|
|
1195
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1196
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ChipComponent, isStandalone: true, selector: "sefin-chip", inputs: { variant: "variant", size: "size", disabled: "disabled", removable: "removable", selected: "selected", class: "class" }, outputs: { removed: "removed", clicked: "clicked" }, ngImport: i0, template: "<div\n [class]=\"chipClasses\"\n (click)=\"onClick($event)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-selected]=\"selected\"\n role=\"button\"\n tabindex=\"0\"\n>\n <span class=\"sefin-chip__content\">\n <ng-content></ng-content>\n </span>\n <button\n *ngIf=\"removable && !disabled\"\n type=\"button\"\n class=\"sefin-chip__remove\"\n (click)=\"onRemove($event)\"\n aria-label=\"Remove\"\n tabindex=\"-1\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n", styles: [".sefin-chip{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-full);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent;white-space:nowrap;-webkit-user-select:none;user-select:none}.sefin-chip:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-chip--sm{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-xs, 12px);min-height:24px}.sefin-chip--md{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-chip--lg{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-chip--default{background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-color:var(--sefin-color-border)}.sefin-chip--default:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-chip--default.sefin-chip--selected,.sefin-chip--primary{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-chip--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-chip--secondary{background-color:var(--sefin-color-secondary);color:#fff;border-color:var(--sefin-color-secondary)}.sefin-chip--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-chip--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-chip--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-chip--outline.sefin-chip--selected{background-color:var(--sefin-color-primary);color:#fff}.sefin-chip--ghost{background-color:transparent;color:var(--sefin-color-text)}.sefin-chip--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-chip--ghost.sefin-chip--selected{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-primary)}.sefin-chip--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-chip__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-chip__remove{display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:var(--sefin-spacing-xs, 4px);background:none;border:none;cursor:pointer;outline:none;color:currentColor;opacity:.7;transition:opacity .2s ease-in-out;border-radius:50%;width:16px;height:16px;flex-shrink:0}.sefin-chip__remove:hover{opacity:1;background-color:#0000001a}.sefin-chip__remove:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-chip__remove svg{display:block;width:12px;height:12px}.sefin-chip ::ng-deep svg,.sefin-chip ::ng-deep sefin-icon{flex-shrink:0}.sefin-chip--sm ::ng-deep svg{width:12px;height:12px}.sefin-chip--md ::ng-deep svg{width:14px;height:14px}.sefin-chip--lg ::ng-deep svg{width:16px;height:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1197
|
+
}
|
|
1198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ChipComponent, decorators: [{
|
|
1199
|
+
type: Component,
|
|
1200
|
+
args: [{ selector: 'sefin-chip', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [class]=\"chipClasses\"\n (click)=\"onClick($event)\"\n [attr.aria-disabled]=\"disabled\"\n [attr.aria-selected]=\"selected\"\n role=\"button\"\n tabindex=\"0\"\n>\n <span class=\"sefin-chip__content\">\n <ng-content></ng-content>\n </span>\n <button\n *ngIf=\"removable && !disabled\"\n type=\"button\"\n class=\"sefin-chip__remove\"\n (click)=\"onRemove($event)\"\n aria-label=\"Remove\"\n tabindex=\"-1\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</div>\n\n", styles: [".sefin-chip{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-full);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent;white-space:nowrap;-webkit-user-select:none;user-select:none}.sefin-chip:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-chip--sm{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-xs, 12px);min-height:24px}.sefin-chip--md{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-chip--lg{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-chip--default{background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-color:var(--sefin-color-border)}.sefin-chip--default:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-chip--default.sefin-chip--selected,.sefin-chip--primary{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-chip--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-chip--secondary{background-color:var(--sefin-color-secondary);color:#fff;border-color:var(--sefin-color-secondary)}.sefin-chip--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-chip--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-chip--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-chip--outline.sefin-chip--selected{background-color:var(--sefin-color-primary);color:#fff}.sefin-chip--ghost{background-color:transparent;color:var(--sefin-color-text)}.sefin-chip--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-chip--ghost.sefin-chip--selected{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-primary)}.sefin-chip--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-chip__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-chip__remove{display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:var(--sefin-spacing-xs, 4px);background:none;border:none;cursor:pointer;outline:none;color:currentColor;opacity:.7;transition:opacity .2s ease-in-out;border-radius:50%;width:16px;height:16px;flex-shrink:0}.sefin-chip__remove:hover{opacity:1;background-color:#0000001a}.sefin-chip__remove:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-chip__remove svg{display:block;width:12px;height:12px}.sefin-chip ::ng-deep svg,.sefin-chip ::ng-deep sefin-icon{flex-shrink:0}.sefin-chip--sm ::ng-deep svg{width:12px;height:12px}.sefin-chip--md ::ng-deep svg{width:14px;height:14px}.sefin-chip--lg ::ng-deep svg{width:16px;height:16px}\n"] }]
|
|
1201
|
+
}], propDecorators: { variant: [{
|
|
1202
|
+
type: Input
|
|
1203
|
+
}], size: [{
|
|
1204
|
+
type: Input
|
|
1205
|
+
}], disabled: [{
|
|
1206
|
+
type: Input
|
|
1207
|
+
}], removable: [{
|
|
1208
|
+
type: Input
|
|
1209
|
+
}], selected: [{
|
|
1210
|
+
type: Input
|
|
1211
|
+
}], class: [{
|
|
1212
|
+
type: Input
|
|
1213
|
+
}], removed: [{
|
|
1214
|
+
type: Output
|
|
1215
|
+
}], clicked: [{
|
|
1216
|
+
type: Output
|
|
1217
|
+
}] } });
|
|
1218
|
+
|
|
1219
|
+
class TagComponent {
|
|
1220
|
+
/** Tag variant style. Options: 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' */
|
|
1221
|
+
variant = 'default';
|
|
1222
|
+
/** Tag size. Options: 'sm' | 'md' | 'lg' */
|
|
1223
|
+
size = 'md';
|
|
1224
|
+
/** Whether the tag can be removed (shows remove button) */
|
|
1225
|
+
removable = false;
|
|
1226
|
+
/** Whether the tag is disabled */
|
|
1227
|
+
disabled = false;
|
|
1228
|
+
/** Additional CSS classes */
|
|
1229
|
+
class = '';
|
|
1230
|
+
/** Event emitted when the tag is removed */
|
|
1231
|
+
removed = new EventEmitter();
|
|
1232
|
+
onRemove(event) {
|
|
1233
|
+
event.stopPropagation();
|
|
1234
|
+
if (!this.disabled) {
|
|
1235
|
+
this.removed.emit(event);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
get tagClasses() {
|
|
1239
|
+
return [
|
|
1240
|
+
'sefin-tag',
|
|
1241
|
+
`sefin-tag--${this.variant}`,
|
|
1242
|
+
`sefin-tag--${this.size}`,
|
|
1243
|
+
this.disabled ? 'sefin-tag--disabled' : '',
|
|
1244
|
+
this.class,
|
|
1245
|
+
]
|
|
1246
|
+
.filter(Boolean)
|
|
1247
|
+
.join(' ');
|
|
1248
|
+
}
|
|
1249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1250
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TagComponent, isStandalone: true, selector: "sefin-tag", inputs: { variant: "variant", size: "size", removable: "removable", disabled: "disabled", class: "class" }, outputs: { removed: "removed" }, ngImport: i0, template: "<span\n [class]=\"tagClasses\"\n [attr.aria-disabled]=\"disabled\"\n role=\"status\"\n>\n <span class=\"sefin-tag__content\">\n <ng-content></ng-content>\n </span>\n <button\n *ngIf=\"removable && !disabled\"\n type=\"button\"\n class=\"sefin-tag__remove\"\n (click)=\"onRemove($event)\"\n aria-label=\"Remove tag\"\n tabindex=\"-1\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</span>\n\n", styles: [".sefin-tag{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);border-radius:var(--sefin-border-radius-sm, 4px);white-space:nowrap;vertical-align:middle;box-sizing:border-box;-webkit-user-select:none;user-select:none}.sefin-tag--sm{padding:var(--sefin-spacing-xs, 2px) var(--sefin-spacing-sm, 6px);font-size:var(--sefin-font-size-xs, 10px);min-height:20px}.sefin-tag--md{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 12px);min-height:24px}.sefin-tag--lg{padding:var(--sefin-spacing-sm, 6px) var(--sefin-spacing-md, 12px);font-size:var(--sefin-font-size-base, 14px);min-height:28px}.sefin-tag--default{background-color:var(--sefin-color-surface-hover, #f0f0f0);color:var(--sefin-color-text, #333);border:1px solid var(--sefin-color-border, #e0e0e0)}.sefin-tag--primary{background-color:var(--sefin-color-primary-light, #e3f2fd);color:var(--sefin-color-primary-dark, #0d47a1);border:1px solid var(--sefin-color-primary, #1976d2)}.sefin-tag--secondary{background-color:var(--sefin-color-secondary-light, #fce4ec);color:var(--sefin-color-secondary-dark, #880e4f);border:1px solid var(--sefin-color-secondary, #dc004e)}.sefin-tag--success{background-color:var(--sefin-color-success-light, #e8f5e9);color:var(--sefin-color-success-dark, #2e7d32);border:1px solid var(--sefin-color-success, #4caf50)}.sefin-tag--warning{background-color:var(--sefin-color-warning-light, #fff3e0);color:var(--sefin-color-warning-dark, #e65100);border:1px solid var(--sefin-color-warning, #ff9800)}.sefin-tag--error{background-color:var(--sefin-color-error-light, #ffebee);color:var(--sefin-color-error-dark, #c62828);border:1px solid var(--sefin-color-error, #f44336)}.sefin-tag--info{background-color:var(--sefin-color-primary-light, #e3f2fd);color:var(--sefin-color-text, #1a1a1a);border:1px solid var(--sefin-color-primary, #1976d2)}.sefin-tag--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-tag__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-tag__remove{display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:var(--sefin-spacing-xs, 4px);background:none;border:none;cursor:pointer;outline:none;color:currentColor;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out;border-radius:var(--sefin-border-radius-sm, 4px);width:16px;height:16px;flex-shrink:0}.sefin-tag__remove:hover{opacity:1;background-color:#0000001a}.sefin-tag__remove:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-tag__remove svg{display:block;width:12px;height:12px}.sefin-tag ::ng-deep svg,.sefin-tag ::ng-deep sefin-icon{flex-shrink:0}.sefin-tag--sm ::ng-deep svg{width:10px;height:10px}.sefin-tag--md ::ng-deep svg{width:12px;height:12px}.sefin-tag--lg ::ng-deep svg{width:14px;height:14px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1251
|
+
}
|
|
1252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TagComponent, decorators: [{
|
|
1253
|
+
type: Component,
|
|
1254
|
+
args: [{ selector: 'sefin-tag', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [class]=\"tagClasses\"\n [attr.aria-disabled]=\"disabled\"\n role=\"status\"\n>\n <span class=\"sefin-tag__content\">\n <ng-content></ng-content>\n </span>\n <button\n *ngIf=\"removable && !disabled\"\n type=\"button\"\n class=\"sefin-tag__remove\"\n (click)=\"onRemove($event)\"\n aria-label=\"Remove tag\"\n tabindex=\"-1\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M9 3L3 9M3 3L9 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>\n </button>\n</span>\n\n", styles: [".sefin-tag{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);border-radius:var(--sefin-border-radius-sm, 4px);white-space:nowrap;vertical-align:middle;box-sizing:border-box;-webkit-user-select:none;user-select:none}.sefin-tag--sm{padding:var(--sefin-spacing-xs, 2px) var(--sefin-spacing-sm, 6px);font-size:var(--sefin-font-size-xs, 10px);min-height:20px}.sefin-tag--md{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 12px);min-height:24px}.sefin-tag--lg{padding:var(--sefin-spacing-sm, 6px) var(--sefin-spacing-md, 12px);font-size:var(--sefin-font-size-base, 14px);min-height:28px}.sefin-tag--default{background-color:var(--sefin-color-surface-hover, #f0f0f0);color:var(--sefin-color-text, #333);border:1px solid var(--sefin-color-border, #e0e0e0)}.sefin-tag--primary{background-color:var(--sefin-color-primary-light, #e3f2fd);color:var(--sefin-color-primary-dark, #0d47a1);border:1px solid var(--sefin-color-primary, #1976d2)}.sefin-tag--secondary{background-color:var(--sefin-color-secondary-light, #fce4ec);color:var(--sefin-color-secondary-dark, #880e4f);border:1px solid var(--sefin-color-secondary, #dc004e)}.sefin-tag--success{background-color:var(--sefin-color-success-light, #e8f5e9);color:var(--sefin-color-success-dark, #2e7d32);border:1px solid var(--sefin-color-success, #4caf50)}.sefin-tag--warning{background-color:var(--sefin-color-warning-light, #fff3e0);color:var(--sefin-color-warning-dark, #e65100);border:1px solid var(--sefin-color-warning, #ff9800)}.sefin-tag--error{background-color:var(--sefin-color-error-light, #ffebee);color:var(--sefin-color-error-dark, #c62828);border:1px solid var(--sefin-color-error, #f44336)}.sefin-tag--info{background-color:var(--sefin-color-primary-light, #e3f2fd);color:var(--sefin-color-text, #1a1a1a);border:1px solid var(--sefin-color-primary, #1976d2)}.sefin-tag--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-tag__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-tag__remove{display:inline-flex;align-items:center;justify-content:center;padding:0;margin-left:var(--sefin-spacing-xs, 4px);background:none;border:none;cursor:pointer;outline:none;color:currentColor;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out;border-radius:var(--sefin-border-radius-sm, 4px);width:16px;height:16px;flex-shrink:0}.sefin-tag__remove:hover{opacity:1;background-color:#0000001a}.sefin-tag__remove:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-tag__remove svg{display:block;width:12px;height:12px}.sefin-tag ::ng-deep svg,.sefin-tag ::ng-deep sefin-icon{flex-shrink:0}.sefin-tag--sm ::ng-deep svg{width:10px;height:10px}.sefin-tag--md ::ng-deep svg{width:12px;height:12px}.sefin-tag--lg ::ng-deep svg{width:14px;height:14px}\n"] }]
|
|
1255
|
+
}], propDecorators: { variant: [{
|
|
1256
|
+
type: Input
|
|
1257
|
+
}], size: [{
|
|
1258
|
+
type: Input
|
|
1259
|
+
}], removable: [{
|
|
1260
|
+
type: Input
|
|
1261
|
+
}], disabled: [{
|
|
1262
|
+
type: Input
|
|
1263
|
+
}], class: [{
|
|
1264
|
+
type: Input
|
|
1265
|
+
}], removed: [{
|
|
1266
|
+
type: Output
|
|
1267
|
+
}] } });
|
|
1268
|
+
|
|
659
1269
|
class LinkComponent {
|
|
660
1270
|
/** Link variant style. Options: 'default' | 'primary' | 'secondary' | 'underline' */
|
|
661
1271
|
variant = 'default';
|
|
@@ -771,272 +1381,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
771
1381
|
type: Input
|
|
772
1382
|
}] } });
|
|
773
1383
|
|
|
774
|
-
class
|
|
775
|
-
|
|
776
|
-
dropdownRef;
|
|
777
|
-
containerRef;
|
|
778
|
-
options = [];
|
|
779
|
-
placeholder = '';
|
|
780
|
-
disabled = false;
|
|
1384
|
+
class CheckboxComponent {
|
|
1385
|
+
checkboxInput;
|
|
781
1386
|
size = 'md';
|
|
1387
|
+
disabled = false;
|
|
1388
|
+
indeterminate = false;
|
|
782
1389
|
class = '';
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
valueChange = new EventEmitter();
|
|
787
|
-
optionSelected = new EventEmitter();
|
|
788
|
-
inputChange = new EventEmitter();
|
|
789
|
-
searchText = '';
|
|
790
|
-
filteredOptions = [];
|
|
791
|
-
isOpen = false;
|
|
792
|
-
selectedIndex = -1;
|
|
793
|
-
ngOnInit() {
|
|
794
|
-
if (this.value !== null) {
|
|
795
|
-
const selectedOption = this.options.find((opt) => opt.value === this.value);
|
|
796
|
-
this.searchText = selectedOption?.label || String(this.value);
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
ngOnChanges(changes) {
|
|
800
|
-
if (changes['options']) {
|
|
801
|
-
const options = changes['options'].currentValue || [];
|
|
802
|
-
if (this.value !== null) {
|
|
803
|
-
const selectedOption = options.find((opt) => opt.value === this.value);
|
|
804
|
-
if (selectedOption) {
|
|
805
|
-
this.searchText = selectedOption.label;
|
|
806
|
-
}
|
|
807
|
-
else {
|
|
808
|
-
this.searchText = '';
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
if (changes['value']) {
|
|
813
|
-
if (this.value !== null) {
|
|
814
|
-
const selectedOption = this.options.find((opt) => opt.value === this.value);
|
|
815
|
-
this.searchText = selectedOption?.label || String(this.value);
|
|
816
|
-
}
|
|
817
|
-
else {
|
|
818
|
-
this.searchText = '';
|
|
819
|
-
}
|
|
820
|
-
this.filteredOptions = [];
|
|
821
|
-
this.isOpen = false;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
ngOnDestroy() {
|
|
825
|
-
}
|
|
826
|
-
onClickOutside(event) {
|
|
827
|
-
if (this.containerRef?.nativeElement && this.isOpen) {
|
|
828
|
-
const clickedInside = this.containerRef.nativeElement.contains(event.target);
|
|
829
|
-
if (!clickedInside) {
|
|
830
|
-
this.isOpen = false;
|
|
831
|
-
this.selectedIndex = -1;
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
onInputChange(value) {
|
|
836
|
-
this.searchText = value;
|
|
837
|
-
this.inputChange.emit(value);
|
|
838
|
-
if (this.options && this.options.length > 0) {
|
|
839
|
-
this.filterOptions();
|
|
840
|
-
this.isOpen = value.length >= this.minChars;
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
this.isOpen = false;
|
|
844
|
-
this.filteredOptions = [];
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
filterOptions() {
|
|
848
|
-
if (!this.options || this.options.length === 0) {
|
|
849
|
-
this.filteredOptions = [];
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
if (this.minChars > 0 &&
|
|
853
|
-
(!this.searchText || this.searchText.length < this.minChars)) {
|
|
854
|
-
this.filteredOptions = [];
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
const searchText = this.searchText || '';
|
|
858
|
-
if (searchText.length === 0) {
|
|
859
|
-
this.filteredOptions = this.options
|
|
860
|
-
.filter((option) => !option.disabled)
|
|
861
|
-
.slice(0, this.maxResults);
|
|
862
|
-
return;
|
|
863
|
-
}
|
|
864
|
-
const searchLower = searchText.toLowerCase();
|
|
865
|
-
this.filteredOptions = this.options
|
|
866
|
-
.filter((option) => {
|
|
867
|
-
if (option.disabled)
|
|
868
|
-
return false;
|
|
869
|
-
return option.label.toLowerCase().includes(searchLower);
|
|
870
|
-
})
|
|
871
|
-
.slice(0, this.maxResults);
|
|
872
|
-
}
|
|
873
|
-
selectOption(option) {
|
|
874
|
-
if (option.disabled)
|
|
875
|
-
return;
|
|
876
|
-
this.searchText = option.label;
|
|
877
|
-
this.value = option.value;
|
|
878
|
-
this.valueChange.emit(option.value);
|
|
879
|
-
this.optionSelected.emit(option);
|
|
880
|
-
this.isOpen = false;
|
|
881
|
-
this.selectedIndex = -1;
|
|
882
|
-
}
|
|
883
|
-
onInputFocus() {
|
|
884
|
-
if (this.disabled)
|
|
885
|
-
return;
|
|
886
|
-
if (this.options &&
|
|
887
|
-
Array.isArray(this.options) &&
|
|
888
|
-
this.options.length > 0) {
|
|
889
|
-
this.filterOptions();
|
|
890
|
-
this.isOpen = this.filteredOptions.length > 0;
|
|
891
|
-
}
|
|
892
|
-
else {
|
|
893
|
-
this.isOpen = false;
|
|
894
|
-
this.filteredOptions = [];
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
onInputBlur() {
|
|
898
|
-
if (this.disabled || !this.searchText) {
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
const exactMatch = this.options.find((option) => !option.disabled &&
|
|
902
|
-
option.label.toLowerCase().trim() === this.searchText.toLowerCase().trim());
|
|
903
|
-
if (!exactMatch) {
|
|
904
|
-
this.searchText = '';
|
|
905
|
-
this.value = null;
|
|
906
|
-
this.valueChange.emit(null);
|
|
907
|
-
this.isOpen = false;
|
|
908
|
-
this.filteredOptions = [];
|
|
909
|
-
this.selectedIndex = -1;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
onKeyDown(event) {
|
|
913
|
-
if (!this.isOpen ||
|
|
914
|
-
!this.filteredOptions ||
|
|
915
|
-
this.filteredOptions.length === 0) {
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
switch (event.key) {
|
|
919
|
-
case 'ArrowDown':
|
|
920
|
-
event.preventDefault();
|
|
921
|
-
this.selectedIndex = Math.min(this.selectedIndex + 1, this.filteredOptions.length - 1);
|
|
922
|
-
setTimeout(() => this.scrollToSelected(), 0);
|
|
923
|
-
break;
|
|
924
|
-
case 'ArrowUp':
|
|
925
|
-
event.preventDefault();
|
|
926
|
-
this.selectedIndex = Math.max(this.selectedIndex - 1, -1);
|
|
927
|
-
setTimeout(() => this.scrollToSelected(), 0);
|
|
928
|
-
break;
|
|
929
|
-
case 'Enter':
|
|
930
|
-
event.preventDefault();
|
|
931
|
-
if (this.selectedIndex >= 0 &&
|
|
932
|
-
this.selectedIndex < this.filteredOptions.length) {
|
|
933
|
-
this.selectOption(this.filteredOptions[this.selectedIndex]);
|
|
934
|
-
}
|
|
935
|
-
break;
|
|
936
|
-
case 'Escape':
|
|
937
|
-
event.preventDefault();
|
|
938
|
-
this.isOpen = false;
|
|
939
|
-
this.selectedIndex = -1;
|
|
940
|
-
break;
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
scrollToSelected() {
|
|
944
|
-
try {
|
|
945
|
-
if (this.dropdownRef?.nativeElement && this.selectedIndex >= 0) {
|
|
946
|
-
const selectedElement = this.dropdownRef.nativeElement.querySelector(`[data-index="${this.selectedIndex}"]`);
|
|
947
|
-
if (selectedElement && selectedElement instanceof HTMLElement) {
|
|
948
|
-
selectedElement.scrollIntoView({
|
|
949
|
-
block: 'nearest',
|
|
950
|
-
behavior: 'smooth',
|
|
951
|
-
});
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
catch (error) {
|
|
956
|
-
console.warn('Could not scroll to selected option:', error);
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
clearValue() {
|
|
960
|
-
this.searchText = '';
|
|
961
|
-
this.value = null;
|
|
962
|
-
this.valueChange.emit(null);
|
|
963
|
-
this.isOpen = false;
|
|
964
|
-
this.filteredOptions = [];
|
|
965
|
-
if (this.inputRef?.nativeElement) {
|
|
966
|
-
this.inputRef.nativeElement.focus();
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
get inputClasses() {
|
|
970
|
-
return [
|
|
971
|
-
'sefin-autocomplete__input',
|
|
972
|
-
`sefin-autocomplete__input--${this.size}`,
|
|
973
|
-
this.disabled ? 'sefin-autocomplete__input--disabled' : '',
|
|
974
|
-
this.class,
|
|
975
|
-
]
|
|
976
|
-
.filter(Boolean)
|
|
977
|
-
.join(' ');
|
|
978
|
-
}
|
|
979
|
-
get containerClasses() {
|
|
980
|
-
return [
|
|
981
|
-
'sefin-autocomplete',
|
|
982
|
-
this.isOpen && this.filteredOptions.length > 0
|
|
983
|
-
? 'sefin-autocomplete--open'
|
|
984
|
-
: '',
|
|
985
|
-
]
|
|
986
|
-
.filter(Boolean)
|
|
987
|
-
.join(' ');
|
|
988
|
-
}
|
|
989
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
990
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AutocompleteComponent, isStandalone: true, selector: "sefin-autocomplete", inputs: { options: "options", placeholder: "placeholder", disabled: "disabled", size: "size", class: "class", value: "value", minChars: "minChars", maxResults: "maxResults" }, outputs: { valueChange: "valueChange", optionSelected: "optionSelected", inputChange: "inputChange" }, host: { listeners: { "document:click": "onClickOutside($event)" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "dropdownRef", first: true, predicate: ["dropdownRef"], descendants: true }, { propertyName: "containerRef", first: true, predicate: ["containerRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"containerClasses\" #containerRef>\n <div class=\"sefin-autocomplete__wrapper\">\n <input\n #inputRef\n type=\"text\"\n [class]=\"inputClasses\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"onInputChange($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n (keydown)=\"onKeyDown($event)\"\n autocomplete=\"off\"\n />\n <div class=\"sefin-autocomplete__actions\">\n <button\n *ngIf=\"searchText && !disabled\"\n type=\"button\"\n class=\"sefin-autocomplete__clear\"\n (click)=\"clearValue()\"\n aria-label=\"Clear\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div class=\"sefin-autocomplete__arrow\" [class.sefin-autocomplete__arrow--open]=\"isOpen\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"isOpen && filteredOptions && filteredOptions.length > 0\"\n #dropdownRef\n class=\"sefin-autocomplete__dropdown\"\n >\n <ul class=\"sefin-autocomplete__list\">\n <li\n *ngFor=\"let option of filteredOptions; let i = index\"\n [attr.data-index]=\"i\"\n [class.sefin-autocomplete__option]=\"true\"\n [class.sefin-autocomplete__option--selected]=\"i === selectedIndex\"\n [class.sefin-autocomplete__option--disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [attr.aria-selected]=\"i === selectedIndex\"\n role=\"option\"\n >\n {{ option.label }}\n </li>\n </ul>\n </div>\n <div\n *ngIf=\"\n isOpen &&\n filteredOptions &&\n filteredOptions.length === 0 &&\n searchText &&\n searchText.length >= minChars\n \"\n class=\"sefin-autocomplete__dropdown sefin-autocomplete__dropdown--empty\"\n >\n <div class=\"sefin-autocomplete__no-results\">\n No se encontraron resultados\n </div>\n </div>\n</div>\n", styles: [".sefin-autocomplete{position:relative;width:100%}.sefin-autocomplete__wrapper{position:relative;display:flex;align-items:center;width:100%}.sefin-autocomplete__input{width:100%;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;outline:none}.sefin-autocomplete__input::placeholder{color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base)}.sefin-autocomplete__input:focus{border-color:var(--sefin-color-border-focus);box-shadow:0 0 0 3px var(--sefin-color-primary-light)}.sefin-autocomplete__input:disabled{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text-disabled);cursor:not-allowed;opacity:.6}.sefin-autocomplete__input--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);padding-right:calc(var(--sefin-spacing-md) * 2.5);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-autocomplete__input--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);padding-right:calc(var(--sefin-spacing-lg) * 2);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-autocomplete__input--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);padding-right:calc(var(--sefin-spacing-xl) * 1.75);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-autocomplete__input--disabled{cursor:not-allowed}.sefin-autocomplete__actions{position:absolute;right:var(--sefin-spacing-sm);display:flex;align-items:center;gap:var(--sefin-spacing-xs)}.sefin-autocomplete__clear{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--sefin-radius-sm);color:var(--sefin-color-text-secondary);cursor:pointer;transition:all .2s ease-in-out}.sefin-autocomplete__clear:hover{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-autocomplete__clear:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-autocomplete__clear svg{width:16px;height:16px}.sefin-autocomplete__arrow{display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--sefin-color-text-secondary);pointer-events:none;transition:transform .2s ease-in-out}.sefin-autocomplete__arrow svg{width:16px;height:16px}.sefin-autocomplete__arrow--open{transform:rotate(180deg)}.sefin-autocomplete__dropdown{position:absolute;top:calc(100% + var(--sefin-spacing-xs));left:0;right:0;z-index:9999;background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);box-shadow:var(--sefin-shadow-lg);max-height:300px;overflow-y:auto}.sefin-autocomplete__dropdown--empty{padding:var(--sefin-spacing-md)}.sefin-autocomplete__list{list-style:none;margin:0;padding:var(--sefin-spacing-xs)}.sefin-autocomplete__option{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);cursor:pointer;border-radius:var(--sefin-radius-sm);transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none}.sefin-autocomplete__option:hover:not(.sefin-autocomplete__option--disabled){background-color:var(--sefin-color-surface-hover)}.sefin-autocomplete__option--selected{background-color:var(--sefin-color-primary-light);color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-medium)}.sefin-autocomplete__option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-autocomplete__no-results{padding:var(--sefin-spacing-md);text-align:center;font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-sm);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text-secondary)}.sefin-autocomplete--open .sefin-autocomplete__input{border-color:var(--sefin-color-border-focus)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
991
|
-
}
|
|
992
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
993
|
-
type: Component,
|
|
994
|
-
args: [{ selector: 'sefin-autocomplete', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.Default, template: "<div [class]=\"containerClasses\" #containerRef>\n <div class=\"sefin-autocomplete__wrapper\">\n <input\n #inputRef\n type=\"text\"\n [class]=\"inputClasses\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"onInputChange($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n (keydown)=\"onKeyDown($event)\"\n autocomplete=\"off\"\n />\n <div class=\"sefin-autocomplete__actions\">\n <button\n *ngIf=\"searchText && !disabled\"\n type=\"button\"\n class=\"sefin-autocomplete__clear\"\n (click)=\"clearValue()\"\n aria-label=\"Clear\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div class=\"sefin-autocomplete__arrow\" [class.sefin-autocomplete__arrow--open]=\"isOpen\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"isOpen && filteredOptions && filteredOptions.length > 0\"\n #dropdownRef\n class=\"sefin-autocomplete__dropdown\"\n >\n <ul class=\"sefin-autocomplete__list\">\n <li\n *ngFor=\"let option of filteredOptions; let i = index\"\n [attr.data-index]=\"i\"\n [class.sefin-autocomplete__option]=\"true\"\n [class.sefin-autocomplete__option--selected]=\"i === selectedIndex\"\n [class.sefin-autocomplete__option--disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [attr.aria-selected]=\"i === selectedIndex\"\n role=\"option\"\n >\n {{ option.label }}\n </li>\n </ul>\n </div>\n <div\n *ngIf=\"\n isOpen &&\n filteredOptions &&\n filteredOptions.length === 0 &&\n searchText &&\n searchText.length >= minChars\n \"\n class=\"sefin-autocomplete__dropdown sefin-autocomplete__dropdown--empty\"\n >\n <div class=\"sefin-autocomplete__no-results\">\n No se encontraron resultados\n </div>\n </div>\n</div>\n", styles: [".sefin-autocomplete{position:relative;width:100%}.sefin-autocomplete__wrapper{position:relative;display:flex;align-items:center;width:100%}.sefin-autocomplete__input{width:100%;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;outline:none}.sefin-autocomplete__input::placeholder{color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base)}.sefin-autocomplete__input:focus{border-color:var(--sefin-color-border-focus);box-shadow:0 0 0 3px var(--sefin-color-primary-light)}.sefin-autocomplete__input:disabled{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text-disabled);cursor:not-allowed;opacity:.6}.sefin-autocomplete__input--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);padding-right:calc(var(--sefin-spacing-md) * 2.5);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-autocomplete__input--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);padding-right:calc(var(--sefin-spacing-lg) * 2);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-autocomplete__input--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);padding-right:calc(var(--sefin-spacing-xl) * 1.75);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-autocomplete__input--disabled{cursor:not-allowed}.sefin-autocomplete__actions{position:absolute;right:var(--sefin-spacing-sm);display:flex;align-items:center;gap:var(--sefin-spacing-xs)}.sefin-autocomplete__clear{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--sefin-radius-sm);color:var(--sefin-color-text-secondary);cursor:pointer;transition:all .2s ease-in-out}.sefin-autocomplete__clear:hover{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-autocomplete__clear:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-autocomplete__clear svg{width:16px;height:16px}.sefin-autocomplete__arrow{display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--sefin-color-text-secondary);pointer-events:none;transition:transform .2s ease-in-out}.sefin-autocomplete__arrow svg{width:16px;height:16px}.sefin-autocomplete__arrow--open{transform:rotate(180deg)}.sefin-autocomplete__dropdown{position:absolute;top:calc(100% + var(--sefin-spacing-xs));left:0;right:0;z-index:9999;background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);box-shadow:var(--sefin-shadow-lg);max-height:300px;overflow-y:auto}.sefin-autocomplete__dropdown--empty{padding:var(--sefin-spacing-md)}.sefin-autocomplete__list{list-style:none;margin:0;padding:var(--sefin-spacing-xs)}.sefin-autocomplete__option{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);cursor:pointer;border-radius:var(--sefin-radius-sm);transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none}.sefin-autocomplete__option:hover:not(.sefin-autocomplete__option--disabled){background-color:var(--sefin-color-surface-hover)}.sefin-autocomplete__option--selected{background-color:var(--sefin-color-primary-light);color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-medium)}.sefin-autocomplete__option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-autocomplete__no-results{padding:var(--sefin-spacing-md);text-align:center;font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-sm);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text-secondary)}.sefin-autocomplete--open .sefin-autocomplete__input{border-color:var(--sefin-color-border-focus)}\n"] }]
|
|
995
|
-
}], propDecorators: { inputRef: [{
|
|
996
|
-
type: ViewChild,
|
|
997
|
-
args: ['inputRef', { static: false }]
|
|
998
|
-
}], dropdownRef: [{
|
|
999
|
-
type: ViewChild,
|
|
1000
|
-
args: ['dropdownRef', { static: false }]
|
|
1001
|
-
}], containerRef: [{
|
|
1002
|
-
type: ViewChild,
|
|
1003
|
-
args: ['containerRef', { static: false }]
|
|
1004
|
-
}], options: [{
|
|
1005
|
-
type: Input
|
|
1006
|
-
}], placeholder: [{
|
|
1007
|
-
type: Input
|
|
1008
|
-
}], disabled: [{
|
|
1009
|
-
type: Input
|
|
1010
|
-
}], size: [{
|
|
1011
|
-
type: Input
|
|
1012
|
-
}], class: [{
|
|
1013
|
-
type: Input
|
|
1014
|
-
}], value: [{
|
|
1015
|
-
type: Input
|
|
1016
|
-
}], minChars: [{
|
|
1017
|
-
type: Input
|
|
1018
|
-
}], maxResults: [{
|
|
1019
|
-
type: Input
|
|
1020
|
-
}], valueChange: [{
|
|
1021
|
-
type: Output
|
|
1022
|
-
}], optionSelected: [{
|
|
1023
|
-
type: Output
|
|
1024
|
-
}], inputChange: [{
|
|
1025
|
-
type: Output
|
|
1026
|
-
}], onClickOutside: [{
|
|
1027
|
-
type: HostListener,
|
|
1028
|
-
args: ['document:click', ['$event']]
|
|
1029
|
-
}] } });
|
|
1030
|
-
|
|
1031
|
-
class CheckboxComponent {
|
|
1032
|
-
checkboxInput;
|
|
1033
|
-
size = 'md';
|
|
1034
|
-
disabled = false;
|
|
1035
|
-
indeterminate = false;
|
|
1036
|
-
class = '';
|
|
1037
|
-
label = '';
|
|
1038
|
-
name = '';
|
|
1039
|
-
value = false;
|
|
1390
|
+
label = '';
|
|
1391
|
+
name = '';
|
|
1392
|
+
value = false;
|
|
1040
1393
|
valueChange = new EventEmitter();
|
|
1041
1394
|
checkedChange = new EventEmitter();
|
|
1042
1395
|
onChange = (value) => { };
|
|
@@ -1134,17 +1487,110 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1134
1487
|
type: Output
|
|
1135
1488
|
}] } });
|
|
1136
1489
|
|
|
1137
|
-
class
|
|
1138
|
-
|
|
1139
|
-
dropdownRef;
|
|
1140
|
-
buttonRef;
|
|
1141
|
-
options = [];
|
|
1142
|
-
placeholder = 'Seleccionar...';
|
|
1143
|
-
disabled = false;
|
|
1490
|
+
class RadioComponent {
|
|
1491
|
+
radioInput;
|
|
1144
1492
|
size = 'md';
|
|
1493
|
+
disabled = false;
|
|
1145
1494
|
class = '';
|
|
1146
|
-
|
|
1147
|
-
|
|
1495
|
+
label = '';
|
|
1496
|
+
name = '';
|
|
1497
|
+
value = '';
|
|
1498
|
+
checked = false;
|
|
1499
|
+
valueChange = new EventEmitter();
|
|
1500
|
+
checkedChange = new EventEmitter();
|
|
1501
|
+
onChange = (value) => { };
|
|
1502
|
+
onTouched = () => { };
|
|
1503
|
+
onRadioChange(event) {
|
|
1504
|
+
if (this.disabled) {
|
|
1505
|
+
return;
|
|
1506
|
+
}
|
|
1507
|
+
const target = event.target;
|
|
1508
|
+
this.checked = target.checked;
|
|
1509
|
+
this.onChange(this.value);
|
|
1510
|
+
this.onTouched();
|
|
1511
|
+
this.valueChange.emit(this.value);
|
|
1512
|
+
this.checkedChange.emit(this.checked);
|
|
1513
|
+
}
|
|
1514
|
+
writeValue(value) {
|
|
1515
|
+
// For radio buttons, the value is managed by the form control
|
|
1516
|
+
// The checked state is determined by comparing the value
|
|
1517
|
+
if (value === this.value) {
|
|
1518
|
+
this.checked = true;
|
|
1519
|
+
}
|
|
1520
|
+
else {
|
|
1521
|
+
this.checked = false;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
registerOnChange(fn) {
|
|
1525
|
+
this.onChange = fn;
|
|
1526
|
+
}
|
|
1527
|
+
registerOnTouched(fn) {
|
|
1528
|
+
this.onTouched = fn;
|
|
1529
|
+
}
|
|
1530
|
+
setDisabledState(isDisabled) {
|
|
1531
|
+
this.disabled = isDisabled;
|
|
1532
|
+
}
|
|
1533
|
+
get wrapperClasses() {
|
|
1534
|
+
return [
|
|
1535
|
+
'sefin-radio__wrapper',
|
|
1536
|
+
this.disabled ? 'sefin-radio__wrapper--disabled' : '',
|
|
1537
|
+
this.class,
|
|
1538
|
+
]
|
|
1539
|
+
.filter(Boolean)
|
|
1540
|
+
.join(' ');
|
|
1541
|
+
}
|
|
1542
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1543
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: RadioComponent, isStandalone: true, selector: "sefin-radio", inputs: { size: "size", disabled: "disabled", class: "class", label: "label", name: "name", value: "value", checked: "checked" }, outputs: { valueChange: "valueChange", checkedChange: "checkedChange" }, providers: [
|
|
1544
|
+
{
|
|
1545
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1546
|
+
useExisting: forwardRef(() => RadioComponent),
|
|
1547
|
+
multi: true,
|
|
1548
|
+
},
|
|
1549
|
+
], viewQueries: [{ propertyName: "radioInput", first: true, predicate: ["radioInput"], descendants: true }], ngImport: i0, template: "<label [class]=\"wrapperClasses\">\n <input\n type=\"radio\"\n class=\"sefin-radio\"\n [class.sefin-radio--sm]=\"size === 'sm'\"\n [class.sefin-radio--md]=\"size === 'md'\"\n [class.sefin-radio--lg]=\"size === 'lg'\"\n [class.sefin-radio--disabled]=\"disabled\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [value]=\"value\"\n (change)=\"onRadioChange($event)\"\n #radioInput\n />\n <span \n class=\"sefin-radio__circle\" \n [class.sefin-radio__circle--sm]=\"size === 'sm'\" \n [class.sefin-radio__circle--md]=\"size === 'md'\" \n [class.sefin-radio__circle--lg]=\"size === 'lg'\" \n [class.sefin-radio__circle--checked]=\"checked\"\n >\n <span *ngIf=\"checked\" class=\"sefin-radio__dot\"></span>\n </span>\n <span *ngIf=\"label\" class=\"sefin-radio__label\" [class.sefin-radio__label--sm]=\"size === 'sm'\" [class.sefin-radio__label--md]=\"size === 'md'\" [class.sefin-radio__label--lg]=\"size === 'lg'\">{{ label }}</span>\n</label>\n\n", styles: [".sefin-radio__wrapper{display:inline-flex;align-items:center;gap:var(--sefin-spacing-sm);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.sefin-radio__wrapper--disabled{cursor:not-allowed;opacity:.6}.sefin-radio{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.sefin-radio__circle{display:flex;align-items:center;justify-content:center;border:2px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);border-radius:50%;transition:background-color .2s ease-in-out,border-color .2s ease-in-out;flex-shrink:0;box-sizing:border-box}.sefin-radio__circle--checked{border-color:var(--sefin-color-primary)}.sefin-radio__circle--sm{width:16px;height:16px;min-width:16px;min-height:16px}.sefin-radio__circle--md{width:20px;height:20px;min-width:20px;min-height:20px}.sefin-radio__circle--lg{width:24px;height:24px;min-width:24px;min-height:24px}.sefin-radio__dot{width:8px;height:8px;border-radius:50%;background-color:var(--sefin-color-primary);transition:transform .2s ease-in-out;transform:scale(0);animation:radio-dot-appear .2s ease-in-out forwards}.sefin-radio__circle--sm .sefin-radio__dot{width:6px;height:6px}.sefin-radio__circle--md .sefin-radio__dot{width:8px;height:8px}.sefin-radio__circle--lg .sefin-radio__dot{width:10px;height:10px}.sefin-radio__wrapper:hover .sefin-radio__circle{border-color:var(--sefin-color-border-focus)}.sefin-radio__wrapper--disabled:hover .sefin-radio__circle{border-color:var(--sefin-color-border)}.sefin-radio__wrapper:focus-within .sefin-radio__circle{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-radio__wrapper:focus-within{outline:none}.sefin-radio__wrapper--disabled .sefin-radio__circle{background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-border);cursor:not-allowed}.sefin-radio__wrapper--disabled .sefin-radio__circle--checked{border-color:var(--sefin-color-border);opacity:.6}.sefin-radio__wrapper--disabled .sefin-radio__dot{background-color:var(--sefin-color-text-disabled)}.sefin-radio__label{font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);-webkit-user-select:none;user-select:none}.sefin-radio__label--sm{font-size:var(--sefin-font-size-sm)}.sefin-radio__label--md{font-size:var(--sefin-font-size-base)}.sefin-radio__label--lg{font-size:var(--sefin-font-size-lg)}.sefin-radio__wrapper--disabled .sefin-radio__label{color:var(--sefin-color-text-disabled)}.sefin-radio--disabled{cursor:not-allowed}@keyframes radio-dot-appear{0%{transform:scale(0)}to{transform:scale(1)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
1550
|
+
}
|
|
1551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RadioComponent, decorators: [{
|
|
1552
|
+
type: Component,
|
|
1553
|
+
args: [{ selector: 'sefin-radio', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
1554
|
+
{
|
|
1555
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1556
|
+
useExisting: forwardRef(() => RadioComponent),
|
|
1557
|
+
multi: true,
|
|
1558
|
+
},
|
|
1559
|
+
], template: "<label [class]=\"wrapperClasses\">\n <input\n type=\"radio\"\n class=\"sefin-radio\"\n [class.sefin-radio--sm]=\"size === 'sm'\"\n [class.sefin-radio--md]=\"size === 'md'\"\n [class.sefin-radio--lg]=\"size === 'lg'\"\n [class.sefin-radio--disabled]=\"disabled\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [name]=\"name\"\n [value]=\"value\"\n (change)=\"onRadioChange($event)\"\n #radioInput\n />\n <span \n class=\"sefin-radio__circle\" \n [class.sefin-radio__circle--sm]=\"size === 'sm'\" \n [class.sefin-radio__circle--md]=\"size === 'md'\" \n [class.sefin-radio__circle--lg]=\"size === 'lg'\" \n [class.sefin-radio__circle--checked]=\"checked\"\n >\n <span *ngIf=\"checked\" class=\"sefin-radio__dot\"></span>\n </span>\n <span *ngIf=\"label\" class=\"sefin-radio__label\" [class.sefin-radio__label--sm]=\"size === 'sm'\" [class.sefin-radio__label--md]=\"size === 'md'\" [class.sefin-radio__label--lg]=\"size === 'lg'\">{{ label }}</span>\n</label>\n\n", styles: [".sefin-radio__wrapper{display:inline-flex;align-items:center;gap:var(--sefin-spacing-sm);cursor:pointer;-webkit-user-select:none;user-select:none;position:relative}.sefin-radio__wrapper--disabled{cursor:not-allowed;opacity:.6}.sefin-radio{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.sefin-radio__circle{display:flex;align-items:center;justify-content:center;border:2px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);border-radius:50%;transition:background-color .2s ease-in-out,border-color .2s ease-in-out;flex-shrink:0;box-sizing:border-box}.sefin-radio__circle--checked{border-color:var(--sefin-color-primary)}.sefin-radio__circle--sm{width:16px;height:16px;min-width:16px;min-height:16px}.sefin-radio__circle--md{width:20px;height:20px;min-width:20px;min-height:20px}.sefin-radio__circle--lg{width:24px;height:24px;min-width:24px;min-height:24px}.sefin-radio__dot{width:8px;height:8px;border-radius:50%;background-color:var(--sefin-color-primary);transition:transform .2s ease-in-out;transform:scale(0);animation:radio-dot-appear .2s ease-in-out forwards}.sefin-radio__circle--sm .sefin-radio__dot{width:6px;height:6px}.sefin-radio__circle--md .sefin-radio__dot{width:8px;height:8px}.sefin-radio__circle--lg .sefin-radio__dot{width:10px;height:10px}.sefin-radio__wrapper:hover .sefin-radio__circle{border-color:var(--sefin-color-border-focus)}.sefin-radio__wrapper--disabled:hover .sefin-radio__circle{border-color:var(--sefin-color-border)}.sefin-radio__wrapper:focus-within .sefin-radio__circle{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-radio__wrapper:focus-within{outline:none}.sefin-radio__wrapper--disabled .sefin-radio__circle{background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-border);cursor:not-allowed}.sefin-radio__wrapper--disabled .sefin-radio__circle--checked{border-color:var(--sefin-color-border);opacity:.6}.sefin-radio__wrapper--disabled .sefin-radio__dot{background-color:var(--sefin-color-text-disabled)}.sefin-radio__label{font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);-webkit-user-select:none;user-select:none}.sefin-radio__label--sm{font-size:var(--sefin-font-size-sm)}.sefin-radio__label--md{font-size:var(--sefin-font-size-base)}.sefin-radio__label--lg{font-size:var(--sefin-font-size-lg)}.sefin-radio__wrapper--disabled .sefin-radio__label{color:var(--sefin-color-text-disabled)}.sefin-radio--disabled{cursor:not-allowed}@keyframes radio-dot-appear{0%{transform:scale(0)}to{transform:scale(1)}}\n"] }]
|
|
1560
|
+
}], propDecorators: { radioInput: [{
|
|
1561
|
+
type: ViewChild,
|
|
1562
|
+
args: ['radioInput', { static: false }]
|
|
1563
|
+
}], size: [{
|
|
1564
|
+
type: Input
|
|
1565
|
+
}], disabled: [{
|
|
1566
|
+
type: Input
|
|
1567
|
+
}], class: [{
|
|
1568
|
+
type: Input
|
|
1569
|
+
}], label: [{
|
|
1570
|
+
type: Input
|
|
1571
|
+
}], name: [{
|
|
1572
|
+
type: Input
|
|
1573
|
+
}], value: [{
|
|
1574
|
+
type: Input
|
|
1575
|
+
}], checked: [{
|
|
1576
|
+
type: Input
|
|
1577
|
+
}], valueChange: [{
|
|
1578
|
+
type: Output
|
|
1579
|
+
}], checkedChange: [{
|
|
1580
|
+
type: Output
|
|
1581
|
+
}] } });
|
|
1582
|
+
|
|
1583
|
+
class SelectComponent {
|
|
1584
|
+
containerRef;
|
|
1585
|
+
dropdownRef;
|
|
1586
|
+
buttonRef;
|
|
1587
|
+
options = [];
|
|
1588
|
+
placeholder = 'Seleccionar...';
|
|
1589
|
+
disabled = false;
|
|
1590
|
+
size = 'md';
|
|
1591
|
+
class = '';
|
|
1592
|
+
value = null;
|
|
1593
|
+
valueChange = new EventEmitter();
|
|
1148
1594
|
optionSelected = new EventEmitter();
|
|
1149
1595
|
isOpen = false;
|
|
1150
1596
|
selectedIndex = -1;
|
|
@@ -1538,8 +1984,712 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
1538
1984
|
type: Input
|
|
1539
1985
|
}] } });
|
|
1540
1986
|
|
|
1541
|
-
|
|
1542
|
-
|
|
1987
|
+
class DividerComponent {
|
|
1988
|
+
/** Divider orientation. Options: 'horizontal' | 'vertical' */
|
|
1989
|
+
orientation = 'horizontal';
|
|
1990
|
+
/** Divider variant style. Options: 'solid' | 'dashed' | 'dotted' */
|
|
1991
|
+
variant = 'solid';
|
|
1992
|
+
/** Spacing around the divider (margin) */
|
|
1993
|
+
spacing = 'md';
|
|
1994
|
+
/** Thickness of the divider */
|
|
1995
|
+
thickness = 'thin';
|
|
1996
|
+
/** Additional CSS classes */
|
|
1997
|
+
class = '';
|
|
1998
|
+
get dividerClasses() {
|
|
1999
|
+
return [
|
|
2000
|
+
'sefin-divider',
|
|
2001
|
+
`sefin-divider--${this.orientation}`,
|
|
2002
|
+
`sefin-divider--${this.variant}`,
|
|
2003
|
+
`sefin-divider--spacing-${this.spacing}`,
|
|
2004
|
+
`sefin-divider--${this.thickness}`,
|
|
2005
|
+
this.class,
|
|
2006
|
+
]
|
|
2007
|
+
.filter(Boolean)
|
|
2008
|
+
.join(' ');
|
|
2009
|
+
}
|
|
2010
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DividerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2011
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: DividerComponent, isStandalone: true, selector: "sefin-divider", inputs: { orientation: "orientation", variant: "variant", spacing: "spacing", thickness: "thickness", class: "class" }, ngImport: i0, template: "<hr [class]=\"dividerClasses\" [attr.aria-orientation]=\"orientation\" />\n\n", styles: [".sefin-divider{border:none;margin:0;padding:0;box-sizing:border-box}.sefin-divider--horizontal{width:100%;height:0;border-top-width:1px;border-top-style:solid;border-top-color:var(--sefin-color-border, #e0e0e0)}.sefin-divider--vertical{width:0;height:100%;min-height:1em;border-left-width:1px;border-left-style:solid;border-left-color:var(--sefin-color-border, #e0e0e0);align-self:stretch}.sefin-divider--solid.sefin-divider--horizontal{border-top-style:solid}.sefin-divider--solid.sefin-divider--vertical{border-left-style:solid}.sefin-divider--dashed.sefin-divider--horizontal{border-top-style:dashed}.sefin-divider--dashed.sefin-divider--vertical{border-left-style:dashed}.sefin-divider--dotted.sefin-divider--horizontal{border-top-style:dotted}.sefin-divider--dotted.sefin-divider--vertical{border-left-style:dotted}.sefin-divider--thin.sefin-divider--horizontal{border-top-width:1px}.sefin-divider--thin.sefin-divider--vertical{border-left-width:1px}.sefin-divider--medium.sefin-divider--horizontal{border-top-width:2px}.sefin-divider--medium.sefin-divider--vertical{border-left-width:2px}.sefin-divider--thick.sefin-divider--horizontal{border-top-width:3px}.sefin-divider--thick.sefin-divider--vertical{border-left-width:3px}.sefin-divider--spacing-none{margin:0}.sefin-divider--spacing-xs.sefin-divider--horizontal{margin-top:var(--sefin-spacing-xs, 4px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-divider--spacing-xs.sefin-divider--vertical{margin-left:var(--sefin-spacing-xs, 4px);margin-right:var(--sefin-spacing-xs, 4px)}.sefin-divider--spacing-sm.sefin-divider--horizontal{margin-top:var(--sefin-spacing-sm, 8px);margin-bottom:var(--sefin-spacing-sm, 8px)}.sefin-divider--spacing-sm.sefin-divider--vertical{margin-left:var(--sefin-spacing-sm, 8px);margin-right:var(--sefin-spacing-sm, 8px)}.sefin-divider--spacing-md.sefin-divider--horizontal{margin-top:var(--sefin-spacing-md, 16px);margin-bottom:var(--sefin-spacing-md, 16px)}.sefin-divider--spacing-md.sefin-divider--vertical{margin-left:var(--sefin-spacing-md, 16px);margin-right:var(--sefin-spacing-md, 16px)}.sefin-divider--spacing-lg.sefin-divider--horizontal{margin-top:var(--sefin-spacing-lg, 24px);margin-bottom:var(--sefin-spacing-lg, 24px)}.sefin-divider--spacing-lg.sefin-divider--vertical{margin-left:var(--sefin-spacing-lg, 24px);margin-right:var(--sefin-spacing-lg, 24px)}.sefin-divider--spacing-xl.sefin-divider--horizontal{margin-top:var(--sefin-spacing-xl, 32px);margin-bottom:var(--sefin-spacing-xl, 32px)}.sefin-divider--spacing-xl.sefin-divider--vertical{margin-left:var(--sefin-spacing-xl, 32px);margin-right:var(--sefin-spacing-xl, 32px)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2012
|
+
}
|
|
2013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: DividerComponent, decorators: [{
|
|
2014
|
+
type: Component,
|
|
2015
|
+
args: [{ selector: 'sefin-divider', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<hr [class]=\"dividerClasses\" [attr.aria-orientation]=\"orientation\" />\n\n", styles: [".sefin-divider{border:none;margin:0;padding:0;box-sizing:border-box}.sefin-divider--horizontal{width:100%;height:0;border-top-width:1px;border-top-style:solid;border-top-color:var(--sefin-color-border, #e0e0e0)}.sefin-divider--vertical{width:0;height:100%;min-height:1em;border-left-width:1px;border-left-style:solid;border-left-color:var(--sefin-color-border, #e0e0e0);align-self:stretch}.sefin-divider--solid.sefin-divider--horizontal{border-top-style:solid}.sefin-divider--solid.sefin-divider--vertical{border-left-style:solid}.sefin-divider--dashed.sefin-divider--horizontal{border-top-style:dashed}.sefin-divider--dashed.sefin-divider--vertical{border-left-style:dashed}.sefin-divider--dotted.sefin-divider--horizontal{border-top-style:dotted}.sefin-divider--dotted.sefin-divider--vertical{border-left-style:dotted}.sefin-divider--thin.sefin-divider--horizontal{border-top-width:1px}.sefin-divider--thin.sefin-divider--vertical{border-left-width:1px}.sefin-divider--medium.sefin-divider--horizontal{border-top-width:2px}.sefin-divider--medium.sefin-divider--vertical{border-left-width:2px}.sefin-divider--thick.sefin-divider--horizontal{border-top-width:3px}.sefin-divider--thick.sefin-divider--vertical{border-left-width:3px}.sefin-divider--spacing-none{margin:0}.sefin-divider--spacing-xs.sefin-divider--horizontal{margin-top:var(--sefin-spacing-xs, 4px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-divider--spacing-xs.sefin-divider--vertical{margin-left:var(--sefin-spacing-xs, 4px);margin-right:var(--sefin-spacing-xs, 4px)}.sefin-divider--spacing-sm.sefin-divider--horizontal{margin-top:var(--sefin-spacing-sm, 8px);margin-bottom:var(--sefin-spacing-sm, 8px)}.sefin-divider--spacing-sm.sefin-divider--vertical{margin-left:var(--sefin-spacing-sm, 8px);margin-right:var(--sefin-spacing-sm, 8px)}.sefin-divider--spacing-md.sefin-divider--horizontal{margin-top:var(--sefin-spacing-md, 16px);margin-bottom:var(--sefin-spacing-md, 16px)}.sefin-divider--spacing-md.sefin-divider--vertical{margin-left:var(--sefin-spacing-md, 16px);margin-right:var(--sefin-spacing-md, 16px)}.sefin-divider--spacing-lg.sefin-divider--horizontal{margin-top:var(--sefin-spacing-lg, 24px);margin-bottom:var(--sefin-spacing-lg, 24px)}.sefin-divider--spacing-lg.sefin-divider--vertical{margin-left:var(--sefin-spacing-lg, 24px);margin-right:var(--sefin-spacing-lg, 24px)}.sefin-divider--spacing-xl.sefin-divider--horizontal{margin-top:var(--sefin-spacing-xl, 32px);margin-bottom:var(--sefin-spacing-xl, 32px)}.sefin-divider--spacing-xl.sefin-divider--vertical{margin-left:var(--sefin-spacing-xl, 32px);margin-right:var(--sefin-spacing-xl, 32px)}\n"] }]
|
|
2016
|
+
}], propDecorators: { orientation: [{
|
|
2017
|
+
type: Input
|
|
2018
|
+
}], variant: [{
|
|
2019
|
+
type: Input
|
|
2020
|
+
}], spacing: [{
|
|
2021
|
+
type: Input
|
|
2022
|
+
}], thickness: [{
|
|
2023
|
+
type: Input
|
|
2024
|
+
}], class: [{
|
|
2025
|
+
type: Input
|
|
2026
|
+
}] } });
|
|
2027
|
+
|
|
2028
|
+
class SpinnerComponent {
|
|
2029
|
+
/** Spinner size. Options: 'sm' | 'md' | 'lg' */
|
|
2030
|
+
size = 'md';
|
|
2031
|
+
/** Spinner variant color. Options: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'default' */
|
|
2032
|
+
variant = 'primary';
|
|
2033
|
+
/** Whether the spinner should be displayed inline (smaller margins) */
|
|
2034
|
+
inline = false;
|
|
2035
|
+
/** Additional CSS classes */
|
|
2036
|
+
class = '';
|
|
2037
|
+
get spinnerClasses() {
|
|
2038
|
+
return [
|
|
2039
|
+
'sefin-spinner',
|
|
2040
|
+
`sefin-spinner--${this.size}`,
|
|
2041
|
+
`sefin-spinner--${this.variant}`,
|
|
2042
|
+
this.inline ? 'sefin-spinner--inline' : '',
|
|
2043
|
+
this.class,
|
|
2044
|
+
]
|
|
2045
|
+
.filter(Boolean)
|
|
2046
|
+
.join(' ');
|
|
2047
|
+
}
|
|
2048
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2049
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: SpinnerComponent, isStandalone: true, selector: "sefin-spinner", inputs: { size: "size", variant: "variant", inline: "inline", class: "class" }, ngImport: i0, template: "<div [class]=\"spinnerClasses\" role=\"status\" [attr.aria-label]=\"'Loading'\">\n <div class=\"sefin-spinner__circle\"></div>\n <span class=\"sr-only\">Loading...</span>\n</div>\n\n", styles: [".sefin-spinner{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}.sefin-spinner--inline{margin:0}.sefin-spinner:not(.sefin-spinner--inline){padding:var(--sefin-spacing-lg, 24px)}.sefin-spinner--sm .sefin-spinner__circle{width:16px;height:16px;border-width:2px}.sefin-spinner--md .sefin-spinner__circle{width:32px;height:32px;border-width:3px}.sefin-spinner--lg .sefin-spinner__circle{width:48px;height:48px;border-width:4px}.sefin-spinner--primary .sefin-spinner__circle{border-color:var(--sefin-color-primary, #1976d2);border-top-color:transparent}.sefin-spinner--secondary .sefin-spinner__circle{border-color:var(--sefin-color-secondary, #dc004e);border-top-color:transparent}.sefin-spinner--success .sefin-spinner__circle{border-color:var(--sefin-color-success, #4caf50);border-top-color:transparent}.sefin-spinner--warning .sefin-spinner__circle{border-color:var(--sefin-color-warning, #ff9800);border-top-color:transparent}.sefin-spinner--error .sefin-spinner__circle{border-color:var(--sefin-color-error, #f44336);border-top-color:transparent}.sefin-spinner--default .sefin-spinner__circle{border-color:var(--sefin-color-text-secondary, #666);border-top-color:transparent}.sefin-spinner__circle{border-style:solid;border-radius:50%;animation:sefin-spinner-rotate .8s linear infinite;box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes sefin-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2050
|
+
}
|
|
2051
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SpinnerComponent, decorators: [{
|
|
2052
|
+
type: Component,
|
|
2053
|
+
args: [{ selector: 'sefin-spinner', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"spinnerClasses\" role=\"status\" [attr.aria-label]=\"'Loading'\">\n <div class=\"sefin-spinner__circle\"></div>\n <span class=\"sr-only\">Loading...</span>\n</div>\n\n", styles: [".sefin-spinner{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}.sefin-spinner--inline{margin:0}.sefin-spinner:not(.sefin-spinner--inline){padding:var(--sefin-spacing-lg, 24px)}.sefin-spinner--sm .sefin-spinner__circle{width:16px;height:16px;border-width:2px}.sefin-spinner--md .sefin-spinner__circle{width:32px;height:32px;border-width:3px}.sefin-spinner--lg .sefin-spinner__circle{width:48px;height:48px;border-width:4px}.sefin-spinner--primary .sefin-spinner__circle{border-color:var(--sefin-color-primary, #1976d2);border-top-color:transparent}.sefin-spinner--secondary .sefin-spinner__circle{border-color:var(--sefin-color-secondary, #dc004e);border-top-color:transparent}.sefin-spinner--success .sefin-spinner__circle{border-color:var(--sefin-color-success, #4caf50);border-top-color:transparent}.sefin-spinner--warning .sefin-spinner__circle{border-color:var(--sefin-color-warning, #ff9800);border-top-color:transparent}.sefin-spinner--error .sefin-spinner__circle{border-color:var(--sefin-color-error, #f44336);border-top-color:transparent}.sefin-spinner--default .sefin-spinner__circle{border-color:var(--sefin-color-text-secondary, #666);border-top-color:transparent}.sefin-spinner__circle{border-style:solid;border-radius:50%;animation:sefin-spinner-rotate .8s linear infinite;box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}@keyframes sefin-spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
2054
|
+
}], propDecorators: { size: [{
|
|
2055
|
+
type: Input
|
|
2056
|
+
}], variant: [{
|
|
2057
|
+
type: Input
|
|
2058
|
+
}], inline: [{
|
|
2059
|
+
type: Input
|
|
2060
|
+
}], class: [{
|
|
2061
|
+
type: Input
|
|
2062
|
+
}] } });
|
|
2063
|
+
|
|
2064
|
+
class ProgressBarComponent {
|
|
2065
|
+
/** Progress value (0-100) */
|
|
2066
|
+
value = 0;
|
|
2067
|
+
/** Progress bar variant color. Options: 'primary' | 'secondary' | 'success' | 'warning' | 'error' */
|
|
2068
|
+
variant = 'primary';
|
|
2069
|
+
/** Progress bar size. Options: 'sm' | 'md' | 'lg' */
|
|
2070
|
+
size = 'md';
|
|
2071
|
+
/** Whether to show the progress percentage label */
|
|
2072
|
+
showLabel = false;
|
|
2073
|
+
/** Whether the progress bar is in indeterminate state (animated) */
|
|
2074
|
+
indeterminate = false;
|
|
2075
|
+
/** Additional CSS classes */
|
|
2076
|
+
class = '';
|
|
2077
|
+
get progressBarClasses() {
|
|
2078
|
+
return [
|
|
2079
|
+
'sefin-progress-bar',
|
|
2080
|
+
`sefin-progress-bar--${this.size}`,
|
|
2081
|
+
`sefin-progress-bar--${this.variant}`,
|
|
2082
|
+
this.indeterminate ? 'sefin-progress-bar--indeterminate' : '',
|
|
2083
|
+
this.class,
|
|
2084
|
+
]
|
|
2085
|
+
.filter(Boolean)
|
|
2086
|
+
.join(' ');
|
|
2087
|
+
}
|
|
2088
|
+
get clampedValue() {
|
|
2089
|
+
return Math.min(Math.max(this.value, 0), 100);
|
|
2090
|
+
}
|
|
2091
|
+
get percentageText() {
|
|
2092
|
+
return `${Math.round(this.clampedValue)}%`;
|
|
2093
|
+
}
|
|
2094
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2095
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ProgressBarComponent, isStandalone: true, selector: "sefin-progress-bar", inputs: { value: "value", variant: "variant", size: "size", showLabel: "showLabel", indeterminate: "indeterminate", class: "class" }, ngImport: i0, template: "<div [class]=\"progressBarClasses\" role=\"progressbar\" [attr.aria-valuenow]=\"indeterminate ? null : clampedValue\" [attr.aria-valuemin]=\"0\" [attr.aria-valuemax]=\"100\" [attr.aria-label]=\"indeterminate ? 'Loading progress' : percentageText + ' complete'\">\n <div class=\"sefin-progress-bar__track\">\n <div \n class=\"sefin-progress-bar__fill\" \n [style.width.%]=\"indeterminate ? undefined : clampedValue\"\n ></div>\n </div>\n <span *ngIf=\"showLabel && !indeterminate\" class=\"sefin-progress-bar__label\">{{ percentageText }}</span>\n</div>\n\n", styles: [".sefin-progress-bar{display:flex;flex-direction:column;gap:var(--sefin-spacing-xs, 4px);width:100%;box-sizing:border-box}.sefin-progress-bar--sm .sefin-progress-bar__track{height:4px}.sefin-progress-bar--sm .sefin-progress-bar__label{font-size:var(--sefin-font-size-xs, 10px)}.sefin-progress-bar--md .sefin-progress-bar__track{height:8px}.sefin-progress-bar--md .sefin-progress-bar__label{font-size:var(--sefin-font-size-sm, 12px)}.sefin-progress-bar--lg .sefin-progress-bar__track{height:12px}.sefin-progress-bar--lg .sefin-progress-bar__label{font-size:var(--sefin-font-size-base, 14px)}.sefin-progress-bar__track{position:relative;width:100%;background-color:var(--sefin-color-surface-hover, #f0f0f0);border-radius:var(--sefin-border-radius-full, 9999px);overflow:hidden;box-sizing:border-box}.sefin-progress-bar__fill{height:100%;background-color:var(--sefin-color-primary, #1976d2);border-radius:var(--sefin-border-radius-full, 9999px);transition:width .3s ease-in-out;box-sizing:border-box}.sefin-progress-bar--primary .sefin-progress-bar__fill{background-color:var(--sefin-color-primary, #1976d2)}.sefin-progress-bar--secondary .sefin-progress-bar__fill{background-color:var(--sefin-color-secondary, #dc004e)}.sefin-progress-bar--success .sefin-progress-bar__fill{background-color:var(--sefin-color-success, #4caf50)}.sefin-progress-bar--warning .sefin-progress-bar__fill{background-color:var(--sefin-color-warning, #ff9800)}.sefin-progress-bar--error .sefin-progress-bar__fill{background-color:var(--sefin-color-error, #f44336)}.sefin-progress-bar--indeterminate .sefin-progress-bar__fill{width:30%!important;animation:sefin-progress-bar-indeterminate 1.5s ease-in-out infinite}.sefin-progress-bar__label{font-family:var(--sefin-font-family-base, sans-serif);font-weight:var(--sefin-font-weight-medium, 500);color:var(--sefin-color-text, #333);line-height:1;text-align:left}@keyframes sefin-progress-bar-indeterminate{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(400%)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2096
|
+
}
|
|
2097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
2098
|
+
type: Component,
|
|
2099
|
+
args: [{ selector: 'sefin-progress-bar', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"progressBarClasses\" role=\"progressbar\" [attr.aria-valuenow]=\"indeterminate ? null : clampedValue\" [attr.aria-valuemin]=\"0\" [attr.aria-valuemax]=\"100\" [attr.aria-label]=\"indeterminate ? 'Loading progress' : percentageText + ' complete'\">\n <div class=\"sefin-progress-bar__track\">\n <div \n class=\"sefin-progress-bar__fill\" \n [style.width.%]=\"indeterminate ? undefined : clampedValue\"\n ></div>\n </div>\n <span *ngIf=\"showLabel && !indeterminate\" class=\"sefin-progress-bar__label\">{{ percentageText }}</span>\n</div>\n\n", styles: [".sefin-progress-bar{display:flex;flex-direction:column;gap:var(--sefin-spacing-xs, 4px);width:100%;box-sizing:border-box}.sefin-progress-bar--sm .sefin-progress-bar__track{height:4px}.sefin-progress-bar--sm .sefin-progress-bar__label{font-size:var(--sefin-font-size-xs, 10px)}.sefin-progress-bar--md .sefin-progress-bar__track{height:8px}.sefin-progress-bar--md .sefin-progress-bar__label{font-size:var(--sefin-font-size-sm, 12px)}.sefin-progress-bar--lg .sefin-progress-bar__track{height:12px}.sefin-progress-bar--lg .sefin-progress-bar__label{font-size:var(--sefin-font-size-base, 14px)}.sefin-progress-bar__track{position:relative;width:100%;background-color:var(--sefin-color-surface-hover, #f0f0f0);border-radius:var(--sefin-border-radius-full, 9999px);overflow:hidden;box-sizing:border-box}.sefin-progress-bar__fill{height:100%;background-color:var(--sefin-color-primary, #1976d2);border-radius:var(--sefin-border-radius-full, 9999px);transition:width .3s ease-in-out;box-sizing:border-box}.sefin-progress-bar--primary .sefin-progress-bar__fill{background-color:var(--sefin-color-primary, #1976d2)}.sefin-progress-bar--secondary .sefin-progress-bar__fill{background-color:var(--sefin-color-secondary, #dc004e)}.sefin-progress-bar--success .sefin-progress-bar__fill{background-color:var(--sefin-color-success, #4caf50)}.sefin-progress-bar--warning .sefin-progress-bar__fill{background-color:var(--sefin-color-warning, #ff9800)}.sefin-progress-bar--error .sefin-progress-bar__fill{background-color:var(--sefin-color-error, #f44336)}.sefin-progress-bar--indeterminate .sefin-progress-bar__fill{width:30%!important;animation:sefin-progress-bar-indeterminate 1.5s ease-in-out infinite}.sefin-progress-bar__label{font-family:var(--sefin-font-family-base, sans-serif);font-weight:var(--sefin-font-weight-medium, 500);color:var(--sefin-color-text, #333);line-height:1;text-align:left}@keyframes sefin-progress-bar-indeterminate{0%{transform:translate(-100%)}50%{transform:translate(0)}to{transform:translate(400%)}}\n"] }]
|
|
2100
|
+
}], propDecorators: { value: [{
|
|
2101
|
+
type: Input
|
|
2102
|
+
}], variant: [{
|
|
2103
|
+
type: Input
|
|
2104
|
+
}], size: [{
|
|
2105
|
+
type: Input
|
|
2106
|
+
}], showLabel: [{
|
|
2107
|
+
type: Input
|
|
2108
|
+
}], indeterminate: [{
|
|
2109
|
+
type: Input
|
|
2110
|
+
}], class: [{
|
|
2111
|
+
type: Input
|
|
2112
|
+
}] } });
|
|
2113
|
+
|
|
2114
|
+
class TooltipComponent {
|
|
2115
|
+
cdr;
|
|
2116
|
+
/** Tooltip text content */
|
|
2117
|
+
text = '';
|
|
2118
|
+
/** Tooltip position. Options: 'top' | 'bottom' | 'left' | 'right' */
|
|
2119
|
+
position = 'top';
|
|
2120
|
+
/** Trigger event. Options: 'hover' | 'click' | 'focus' */
|
|
2121
|
+
trigger = 'hover';
|
|
2122
|
+
/** Delay before showing tooltip (in milliseconds) */
|
|
2123
|
+
delay = 200;
|
|
2124
|
+
/** Whether the tooltip is disabled */
|
|
2125
|
+
disabled = false;
|
|
2126
|
+
/** Additional CSS classes */
|
|
2127
|
+
class = '';
|
|
2128
|
+
tooltipContent;
|
|
2129
|
+
tooltipTrigger;
|
|
2130
|
+
isVisible = false;
|
|
2131
|
+
showTimeout;
|
|
2132
|
+
hideTimeout;
|
|
2133
|
+
constructor(cdr) {
|
|
2134
|
+
this.cdr = cdr;
|
|
2135
|
+
}
|
|
2136
|
+
ngAfterViewInit() {
|
|
2137
|
+
if (this.trigger === 'click') {
|
|
2138
|
+
document.addEventListener('click', this.handleOutsideClick);
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
ngOnDestroy() {
|
|
2142
|
+
this.clearTimeouts();
|
|
2143
|
+
if (this.trigger === 'click') {
|
|
2144
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
onMouseEnter(event) {
|
|
2148
|
+
if (this.trigger === 'hover' && !this.disabled) {
|
|
2149
|
+
this.show();
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
onMouseLeave(event) {
|
|
2153
|
+
if (this.trigger === 'hover' && !this.disabled) {
|
|
2154
|
+
this.hide();
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
onClick(event) {
|
|
2158
|
+
if (this.trigger === 'click' && !this.disabled) {
|
|
2159
|
+
event.stopPropagation();
|
|
2160
|
+
this.toggle();
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
onFocus(event) {
|
|
2164
|
+
if (this.trigger === 'focus' && !this.disabled) {
|
|
2165
|
+
this.show();
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
onBlur(event) {
|
|
2169
|
+
if (this.trigger === 'focus' && !this.disabled) {
|
|
2170
|
+
this.hide();
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
show() {
|
|
2174
|
+
this.clearTimeouts();
|
|
2175
|
+
this.showTimeout = setTimeout(() => {
|
|
2176
|
+
this.isVisible = true;
|
|
2177
|
+
this.cdr.markForCheck();
|
|
2178
|
+
}, this.delay);
|
|
2179
|
+
}
|
|
2180
|
+
hide() {
|
|
2181
|
+
this.clearTimeouts();
|
|
2182
|
+
this.hideTimeout = setTimeout(() => {
|
|
2183
|
+
this.isVisible = false;
|
|
2184
|
+
this.cdr.markForCheck();
|
|
2185
|
+
}, 50);
|
|
2186
|
+
}
|
|
2187
|
+
toggle() {
|
|
2188
|
+
if (this.isVisible) {
|
|
2189
|
+
this.hide();
|
|
2190
|
+
}
|
|
2191
|
+
else {
|
|
2192
|
+
this.show();
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
clearTimeouts() {
|
|
2196
|
+
if (this.showTimeout) {
|
|
2197
|
+
clearTimeout(this.showTimeout);
|
|
2198
|
+
this.showTimeout = undefined;
|
|
2199
|
+
}
|
|
2200
|
+
if (this.hideTimeout) {
|
|
2201
|
+
clearTimeout(this.hideTimeout);
|
|
2202
|
+
this.hideTimeout = undefined;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
handleOutsideClick = (event) => {
|
|
2206
|
+
if (this.isVisible && this.tooltipTrigger?.nativeElement) {
|
|
2207
|
+
const target = event.target;
|
|
2208
|
+
const clickedInside = this.tooltipTrigger.nativeElement.contains(target);
|
|
2209
|
+
if (!clickedInside) {
|
|
2210
|
+
this.hide();
|
|
2211
|
+
}
|
|
2212
|
+
}
|
|
2213
|
+
};
|
|
2214
|
+
get tooltipClasses() {
|
|
2215
|
+
return [
|
|
2216
|
+
'sefin-tooltip',
|
|
2217
|
+
`sefin-tooltip--${this.position}`,
|
|
2218
|
+
this.isVisible ? 'sefin-tooltip--visible' : '',
|
|
2219
|
+
this.class,
|
|
2220
|
+
]
|
|
2221
|
+
.filter(Boolean)
|
|
2222
|
+
.join(' ');
|
|
2223
|
+
}
|
|
2224
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2225
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TooltipComponent, isStandalone: true, selector: "sefin-tooltip", inputs: { text: "text", position: "position", trigger: "trigger", delay: "delay", disabled: "disabled", class: "class" }, host: { listeners: { "mouseenter": "onMouseEnter($event)", "mouseleave": "onMouseLeave($event)", "click": "onClick($event)", "focus": "onFocus($event)", "blur": "onBlur($event)" } }, viewQueries: [{ propertyName: "tooltipContent", first: true, predicate: ["tooltipContent"], descendants: true }, { propertyName: "tooltipTrigger", first: true, predicate: ["tooltipTrigger"], descendants: true }], ngImport: i0, template: "<div #tooltipTrigger class=\"sefin-tooltip__wrapper\">\n <ng-content></ng-content>\n <div\n #tooltipContent\n [class]=\"tooltipClasses\"\n role=\"tooltip\"\n [attr.aria-hidden]=\"!isVisible\"\n *ngIf=\"text && !disabled\"\n >\n <div class=\"sefin-tooltip__content\">{{ text }}</div>\n <div class=\"sefin-tooltip__arrow\"></div>\n </div>\n</div>\n\n", styles: [".sefin-tooltip__wrapper{display:inline-block;position:relative}.sefin-tooltip{position:absolute;z-index:1000;pointer-events:none;opacity:0;transform:scale(.95);transition:opacity .2s ease-in-out,transform .2s ease-in-out;white-space:nowrap}.sefin-tooltip--visible{opacity:1;transform:scale(1);pointer-events:auto}.sefin-tooltip__content{background-color:var(--sefin-color-surface-inverse, #333);color:var(--sefin-color-text-inverse, #ffffff);font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-sm, 12px);font-weight:var(--sefin-font-weight-normal, 400);line-height:var(--sefin-line-height-normal, 1.5);padding:var(--sefin-spacing-xs, 6px) var(--sefin-spacing-sm, 10px);border-radius:var(--sefin-border-radius-sm, 4px);box-shadow:var(--sefin-shadow-md, 0 4px 6px rgba(0, 0, 0, .1));max-width:200px;white-space:normal;word-wrap:break-word;box-sizing:border-box}.sefin-tooltip__arrow{position:absolute;width:0;height:0;border-style:solid}.sefin-tooltip--top{bottom:calc(100% + 8px);left:50%;transform:translate(-50%) scale(.95)}.sefin-tooltip--top.sefin-tooltip--visible{transform:translate(-50%) scale(1)}.sefin-tooltip--top .sefin-tooltip__arrow{top:100%;left:50%;transform:translate(-50%);border-width:6px 6px 0 6px;border-color:var(--sefin-color-surface-inverse, #333) transparent transparent transparent}.sefin-tooltip--bottom{top:calc(100% + 8px);left:50%;transform:translate(-50%) scale(.95)}.sefin-tooltip--bottom.sefin-tooltip--visible{transform:translate(-50%) scale(1)}.sefin-tooltip--bottom .sefin-tooltip__arrow{bottom:100%;left:50%;transform:translate(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--sefin-color-surface-inverse, #333) transparent}.sefin-tooltip--left{right:calc(100% + 8px);top:50%;transform:translateY(-50%) scale(.95)}.sefin-tooltip--left.sefin-tooltip--visible{transform:translateY(-50%) scale(1)}.sefin-tooltip--left .sefin-tooltip__arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--sefin-color-surface-inverse, #333)}.sefin-tooltip--right{left:calc(100% + 8px);top:50%;transform:translateY(-50%) scale(.95)}.sefin-tooltip--right.sefin-tooltip--visible{transform:translateY(-50%) scale(1)}.sefin-tooltip--right .sefin-tooltip__arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--sefin-color-surface-inverse, #333) transparent transparent}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2226
|
+
}
|
|
2227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
2228
|
+
type: Component,
|
|
2229
|
+
args: [{ selector: 'sefin-tooltip', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div #tooltipTrigger class=\"sefin-tooltip__wrapper\">\n <ng-content></ng-content>\n <div\n #tooltipContent\n [class]=\"tooltipClasses\"\n role=\"tooltip\"\n [attr.aria-hidden]=\"!isVisible\"\n *ngIf=\"text && !disabled\"\n >\n <div class=\"sefin-tooltip__content\">{{ text }}</div>\n <div class=\"sefin-tooltip__arrow\"></div>\n </div>\n</div>\n\n", styles: [".sefin-tooltip__wrapper{display:inline-block;position:relative}.sefin-tooltip{position:absolute;z-index:1000;pointer-events:none;opacity:0;transform:scale(.95);transition:opacity .2s ease-in-out,transform .2s ease-in-out;white-space:nowrap}.sefin-tooltip--visible{opacity:1;transform:scale(1);pointer-events:auto}.sefin-tooltip__content{background-color:var(--sefin-color-surface-inverse, #333);color:var(--sefin-color-text-inverse, #ffffff);font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-sm, 12px);font-weight:var(--sefin-font-weight-normal, 400);line-height:var(--sefin-line-height-normal, 1.5);padding:var(--sefin-spacing-xs, 6px) var(--sefin-spacing-sm, 10px);border-radius:var(--sefin-border-radius-sm, 4px);box-shadow:var(--sefin-shadow-md, 0 4px 6px rgba(0, 0, 0, .1));max-width:200px;white-space:normal;word-wrap:break-word;box-sizing:border-box}.sefin-tooltip__arrow{position:absolute;width:0;height:0;border-style:solid}.sefin-tooltip--top{bottom:calc(100% + 8px);left:50%;transform:translate(-50%) scale(.95)}.sefin-tooltip--top.sefin-tooltip--visible{transform:translate(-50%) scale(1)}.sefin-tooltip--top .sefin-tooltip__arrow{top:100%;left:50%;transform:translate(-50%);border-width:6px 6px 0 6px;border-color:var(--sefin-color-surface-inverse, #333) transparent transparent transparent}.sefin-tooltip--bottom{top:calc(100% + 8px);left:50%;transform:translate(-50%) scale(.95)}.sefin-tooltip--bottom.sefin-tooltip--visible{transform:translate(-50%) scale(1)}.sefin-tooltip--bottom .sefin-tooltip__arrow{bottom:100%;left:50%;transform:translate(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--sefin-color-surface-inverse, #333) transparent}.sefin-tooltip--left{right:calc(100% + 8px);top:50%;transform:translateY(-50%) scale(.95)}.sefin-tooltip--left.sefin-tooltip--visible{transform:translateY(-50%) scale(1)}.sefin-tooltip--left .sefin-tooltip__arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--sefin-color-surface-inverse, #333)}.sefin-tooltip--right{left:calc(100% + 8px);top:50%;transform:translateY(-50%) scale(.95)}.sefin-tooltip--right.sefin-tooltip--visible{transform:translateY(-50%) scale(1)}.sefin-tooltip--right .sefin-tooltip__arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--sefin-color-surface-inverse, #333) transparent transparent}\n"] }]
|
|
2230
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { text: [{
|
|
2231
|
+
type: Input
|
|
2232
|
+
}], position: [{
|
|
2233
|
+
type: Input
|
|
2234
|
+
}], trigger: [{
|
|
2235
|
+
type: Input
|
|
2236
|
+
}], delay: [{
|
|
2237
|
+
type: Input
|
|
2238
|
+
}], disabled: [{
|
|
2239
|
+
type: Input
|
|
2240
|
+
}], class: [{
|
|
2241
|
+
type: Input
|
|
2242
|
+
}], tooltipContent: [{
|
|
2243
|
+
type: ViewChild,
|
|
2244
|
+
args: ['tooltipContent', { static: false }]
|
|
2245
|
+
}], tooltipTrigger: [{
|
|
2246
|
+
type: ViewChild,
|
|
2247
|
+
args: ['tooltipTrigger', { static: false }]
|
|
2248
|
+
}], onMouseEnter: [{
|
|
2249
|
+
type: HostListener,
|
|
2250
|
+
args: ['mouseenter', ['$event']]
|
|
2251
|
+
}], onMouseLeave: [{
|
|
2252
|
+
type: HostListener,
|
|
2253
|
+
args: ['mouseleave', ['$event']]
|
|
2254
|
+
}], onClick: [{
|
|
2255
|
+
type: HostListener,
|
|
2256
|
+
args: ['click', ['$event']]
|
|
2257
|
+
}], onFocus: [{
|
|
2258
|
+
type: HostListener,
|
|
2259
|
+
args: ['focus', ['$event']]
|
|
2260
|
+
}], onBlur: [{
|
|
2261
|
+
type: HostListener,
|
|
2262
|
+
args: ['blur', ['$event']]
|
|
2263
|
+
}] } });
|
|
2264
|
+
|
|
2265
|
+
class AlertComponent {
|
|
2266
|
+
/** Alert variant style. Options: 'success' | 'warning' | 'error' | 'info' | 'default' */
|
|
2267
|
+
variant = 'default';
|
|
2268
|
+
/** Alert size. Options: 'sm' | 'md' | 'lg' */
|
|
2269
|
+
size = 'md';
|
|
2270
|
+
/** Alert title (optional) */
|
|
2271
|
+
title;
|
|
2272
|
+
/** Whether the alert can be dismissed (shows close button) */
|
|
2273
|
+
dismissible = false;
|
|
2274
|
+
/** Whether to show an icon */
|
|
2275
|
+
showIcon = true;
|
|
2276
|
+
/** Whether the alert is visible */
|
|
2277
|
+
visible = true;
|
|
2278
|
+
/** Additional CSS classes */
|
|
2279
|
+
class = '';
|
|
2280
|
+
/** Event emitted when the alert is dismissed */
|
|
2281
|
+
dismissed = new EventEmitter();
|
|
2282
|
+
onDismiss() {
|
|
2283
|
+
this.visible = false;
|
|
2284
|
+
this.dismissed.emit();
|
|
2285
|
+
}
|
|
2286
|
+
get alertClasses() {
|
|
2287
|
+
return [
|
|
2288
|
+
'sefin-alert',
|
|
2289
|
+
`sefin-alert--${this.variant}`,
|
|
2290
|
+
`sefin-alert--${this.size}`,
|
|
2291
|
+
!this.visible ? 'sefin-alert--hidden' : '',
|
|
2292
|
+
this.class,
|
|
2293
|
+
]
|
|
2294
|
+
.filter(Boolean)
|
|
2295
|
+
.join(' ');
|
|
2296
|
+
}
|
|
2297
|
+
get iconClass() {
|
|
2298
|
+
const iconMap = {
|
|
2299
|
+
success: '✓',
|
|
2300
|
+
warning: '⚠',
|
|
2301
|
+
error: '✕',
|
|
2302
|
+
info: 'ⓘ',
|
|
2303
|
+
default: '•',
|
|
2304
|
+
};
|
|
2305
|
+
return iconMap[this.variant];
|
|
2306
|
+
}
|
|
2307
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2308
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AlertComponent, isStandalone: true, selector: "sefin-alert", inputs: { variant: "variant", size: "size", title: "title", dismissible: "dismissible", showIcon: "showIcon", visible: "visible", class: "class" }, outputs: { dismissed: "dismissed" }, ngImport: i0, template: "<div\n *ngIf=\"visible\"\n [class]=\"alertClasses\"\n role=\"alert\"\n [attr.aria-live]=\"variant === 'error' ? 'assertive' : 'polite'\"\n>\n <div class=\"sefin-alert__content\">\n <div *ngIf=\"showIcon\" class=\"sefin-alert__icon\" [attr.aria-hidden]=\"true\">\n <span class=\"sefin-alert__icon-symbol\">{{ iconClass }}</span>\n </div>\n <div class=\"sefin-alert__body\">\n <div *ngIf=\"title\" class=\"sefin-alert__title\">{{ title }}</div>\n <div class=\"sefin-alert__message\">\n <ng-content></ng-content>\n </div>\n </div>\n <button\n *ngIf=\"dismissible\"\n type=\"button\"\n class=\"sefin-alert__close\"\n (click)=\"onDismiss()\"\n aria-label=\"Close alert\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n </div>\n</div>\n\n", styles: [".sefin-alert{display:flex;width:100%;box-sizing:border-box;border-radius:var(--sefin-border-radius-md, 8px);border:1px solid transparent;font-family:var(--sefin-font-family-base, sans-serif);transition:opacity .2s ease-in-out,transform .2s ease-in-out}.sefin-alert--hidden{display:none}.sefin-alert--sm{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 12px);font-size:var(--sefin-font-size-sm, 12px)}.sefin-alert--sm .sefin-alert__icon{width:20px;height:20px}.sefin-alert--sm .sefin-alert__icon-symbol{font-size:12px}.sefin-alert--sm .sefin-alert__title{font-size:var(--sefin-font-size-sm, 12px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-alert--md{padding:var(--sefin-spacing-md, 12px) var(--sefin-spacing-lg, 16px);font-size:var(--sefin-font-size-base, 14px)}.sefin-alert--md .sefin-alert__icon{width:24px;height:24px}.sefin-alert--md .sefin-alert__icon-symbol{font-size:16px}.sefin-alert--md .sefin-alert__title{font-size:var(--sefin-font-size-base, 14px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-alert--lg{padding:var(--sefin-spacing-lg, 16px) var(--sefin-spacing-xl, 20px);font-size:var(--sefin-font-size-lg, 16px)}.sefin-alert--lg .sefin-alert__icon{width:28px;height:28px}.sefin-alert--lg .sefin-alert__icon-symbol{font-size:20px}.sefin-alert--lg .sefin-alert__title{font-size:var(--sefin-font-size-lg, 16px);margin-bottom:var(--sefin-spacing-sm, 8px)}.sefin-alert__content{display:flex;align-items:flex-start;width:100%;gap:var(--sefin-spacing-sm, 8px)}.sefin-alert__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;font-weight:var(--sefin-font-weight-bold, 700);line-height:1}.sefin-alert__icon-symbol{display:block;line-height:1}.sefin-alert__body{flex:1;min-width:0}.sefin-alert__title{font-weight:var(--sefin-font-weight-semibold, 600);line-height:var(--sefin-line-height-tight, 1.4);margin:0}.sefin-alert__message{line-height:var(--sefin-line-height-normal, 1.5);margin:0}.sefin-alert__close{flex-shrink:0;background:none;border:none;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--sefin-border-radius-sm, 4px);font-size:20px;line-height:1;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out}.sefin-alert__close:hover{opacity:1;background-color:#0000000d}.sefin-alert__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-alert__close span{display:block;line-height:1}.sefin-alert--success{background-color:var(--sefin-color-success-light, #e8f5e9);border-color:var(--sefin-color-success, #4caf50);color:var(--sefin-color-success-dark, #2e7d32)}.sefin-alert--success .sefin-alert__icon{background-color:var(--sefin-color-success, #4caf50);color:#fff}.sefin-alert--success .sefin-alert__title,.sefin-alert--success .sefin-alert__message,.sefin-alert--success .sefin-alert__close{color:var(--sefin-color-success-dark, #2e7d32)}.sefin-alert--warning{background-color:var(--sefin-color-warning-light, #fff3e0);border-color:var(--sefin-color-warning, #ff9800);color:var(--sefin-color-warning-dark, #e65100)}.sefin-alert--warning .sefin-alert__icon{background-color:var(--sefin-color-warning, #ff9800);color:#fff}.sefin-alert--warning .sefin-alert__title,.sefin-alert--warning .sefin-alert__message,.sefin-alert--warning .sefin-alert__close{color:var(--sefin-color-warning-dark, #e65100)}.sefin-alert--error{background-color:var(--sefin-color-error-light, #ffebee);border-color:var(--sefin-color-error, #f44336);color:var(--sefin-color-error-dark, #c62828)}.sefin-alert--error .sefin-alert__icon{background-color:var(--sefin-color-error, #f44336);color:#fff}.sefin-alert--error .sefin-alert__title,.sefin-alert--error .sefin-alert__message,.sefin-alert--error .sefin-alert__close{color:var(--sefin-color-error-dark, #c62828)}.sefin-alert--info{background-color:var(--sefin-color-primary-light, #e3f2fd);border-color:var(--sefin-color-primary, #1976d2);color:var(--sefin-color-text, #1a1a1a)}.sefin-alert--info .sefin-alert__icon{background-color:var(--sefin-color-primary, #1976d2);color:#fff;font-weight:var(--sefin-font-weight-bold, 700)}.sefin-alert--info .sefin-alert__icon-symbol{font-weight:var(--sefin-font-weight-bold, 700)}.sefin-alert--info .sefin-alert__title{color:var(--sefin-color-text, #1a1a1a);font-weight:var(--sefin-font-weight-semibold, 600)}.sefin-alert--info .sefin-alert__message,.sefin-alert--info .sefin-alert__close{color:var(--sefin-color-text, #1a1a1a)}.sefin-alert--default{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-color:var(--sefin-color-border, #e0e0e0);color:var(--sefin-color-text, #333)}.sefin-alert--default .sefin-alert__icon{background-color:var(--sefin-color-text-secondary, #666);color:#fff}.sefin-alert--default .sefin-alert__title,.sefin-alert--default .sefin-alert__message,.sefin-alert--default .sefin-alert__close{color:var(--sefin-color-text, #333)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2309
|
+
}
|
|
2310
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AlertComponent, decorators: [{
|
|
2311
|
+
type: Component,
|
|
2312
|
+
args: [{ selector: 'sefin-alert', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"visible\"\n [class]=\"alertClasses\"\n role=\"alert\"\n [attr.aria-live]=\"variant === 'error' ? 'assertive' : 'polite'\"\n>\n <div class=\"sefin-alert__content\">\n <div *ngIf=\"showIcon\" class=\"sefin-alert__icon\" [attr.aria-hidden]=\"true\">\n <span class=\"sefin-alert__icon-symbol\">{{ iconClass }}</span>\n </div>\n <div class=\"sefin-alert__body\">\n <div *ngIf=\"title\" class=\"sefin-alert__title\">{{ title }}</div>\n <div class=\"sefin-alert__message\">\n <ng-content></ng-content>\n </div>\n </div>\n <button\n *ngIf=\"dismissible\"\n type=\"button\"\n class=\"sefin-alert__close\"\n (click)=\"onDismiss()\"\n aria-label=\"Close alert\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n </div>\n</div>\n\n", styles: [".sefin-alert{display:flex;width:100%;box-sizing:border-box;border-radius:var(--sefin-border-radius-md, 8px);border:1px solid transparent;font-family:var(--sefin-font-family-base, sans-serif);transition:opacity .2s ease-in-out,transform .2s ease-in-out}.sefin-alert--hidden{display:none}.sefin-alert--sm{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 12px);font-size:var(--sefin-font-size-sm, 12px)}.sefin-alert--sm .sefin-alert__icon{width:20px;height:20px}.sefin-alert--sm .sefin-alert__icon-symbol{font-size:12px}.sefin-alert--sm .sefin-alert__title{font-size:var(--sefin-font-size-sm, 12px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-alert--md{padding:var(--sefin-spacing-md, 12px) var(--sefin-spacing-lg, 16px);font-size:var(--sefin-font-size-base, 14px)}.sefin-alert--md .sefin-alert__icon{width:24px;height:24px}.sefin-alert--md .sefin-alert__icon-symbol{font-size:16px}.sefin-alert--md .sefin-alert__title{font-size:var(--sefin-font-size-base, 14px);margin-bottom:var(--sefin-spacing-xs, 4px)}.sefin-alert--lg{padding:var(--sefin-spacing-lg, 16px) var(--sefin-spacing-xl, 20px);font-size:var(--sefin-font-size-lg, 16px)}.sefin-alert--lg .sefin-alert__icon{width:28px;height:28px}.sefin-alert--lg .sefin-alert__icon-symbol{font-size:20px}.sefin-alert--lg .sefin-alert__title{font-size:var(--sefin-font-size-lg, 16px);margin-bottom:var(--sefin-spacing-sm, 8px)}.sefin-alert__content{display:flex;align-items:flex-start;width:100%;gap:var(--sefin-spacing-sm, 8px)}.sefin-alert__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;font-weight:var(--sefin-font-weight-bold, 700);line-height:1}.sefin-alert__icon-symbol{display:block;line-height:1}.sefin-alert__body{flex:1;min-width:0}.sefin-alert__title{font-weight:var(--sefin-font-weight-semibold, 600);line-height:var(--sefin-line-height-tight, 1.4);margin:0}.sefin-alert__message{line-height:var(--sefin-line-height-normal, 1.5);margin:0}.sefin-alert__close{flex-shrink:0;background:none;border:none;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--sefin-border-radius-sm, 4px);font-size:20px;line-height:1;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out}.sefin-alert__close:hover{opacity:1;background-color:#0000000d}.sefin-alert__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-alert__close span{display:block;line-height:1}.sefin-alert--success{background-color:var(--sefin-color-success-light, #e8f5e9);border-color:var(--sefin-color-success, #4caf50);color:var(--sefin-color-success-dark, #2e7d32)}.sefin-alert--success .sefin-alert__icon{background-color:var(--sefin-color-success, #4caf50);color:#fff}.sefin-alert--success .sefin-alert__title,.sefin-alert--success .sefin-alert__message,.sefin-alert--success .sefin-alert__close{color:var(--sefin-color-success-dark, #2e7d32)}.sefin-alert--warning{background-color:var(--sefin-color-warning-light, #fff3e0);border-color:var(--sefin-color-warning, #ff9800);color:var(--sefin-color-warning-dark, #e65100)}.sefin-alert--warning .sefin-alert__icon{background-color:var(--sefin-color-warning, #ff9800);color:#fff}.sefin-alert--warning .sefin-alert__title,.sefin-alert--warning .sefin-alert__message,.sefin-alert--warning .sefin-alert__close{color:var(--sefin-color-warning-dark, #e65100)}.sefin-alert--error{background-color:var(--sefin-color-error-light, #ffebee);border-color:var(--sefin-color-error, #f44336);color:var(--sefin-color-error-dark, #c62828)}.sefin-alert--error .sefin-alert__icon{background-color:var(--sefin-color-error, #f44336);color:#fff}.sefin-alert--error .sefin-alert__title,.sefin-alert--error .sefin-alert__message,.sefin-alert--error .sefin-alert__close{color:var(--sefin-color-error-dark, #c62828)}.sefin-alert--info{background-color:var(--sefin-color-primary-light, #e3f2fd);border-color:var(--sefin-color-primary, #1976d2);color:var(--sefin-color-text, #1a1a1a)}.sefin-alert--info .sefin-alert__icon{background-color:var(--sefin-color-primary, #1976d2);color:#fff;font-weight:var(--sefin-font-weight-bold, 700)}.sefin-alert--info .sefin-alert__icon-symbol{font-weight:var(--sefin-font-weight-bold, 700)}.sefin-alert--info .sefin-alert__title{color:var(--sefin-color-text, #1a1a1a);font-weight:var(--sefin-font-weight-semibold, 600)}.sefin-alert--info .sefin-alert__message,.sefin-alert--info .sefin-alert__close{color:var(--sefin-color-text, #1a1a1a)}.sefin-alert--default{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-color:var(--sefin-color-border, #e0e0e0);color:var(--sefin-color-text, #333)}.sefin-alert--default .sefin-alert__icon{background-color:var(--sefin-color-text-secondary, #666);color:#fff}.sefin-alert--default .sefin-alert__title,.sefin-alert--default .sefin-alert__message,.sefin-alert--default .sefin-alert__close{color:var(--sefin-color-text, #333)}\n"] }]
|
|
2313
|
+
}], propDecorators: { variant: [{
|
|
2314
|
+
type: Input
|
|
2315
|
+
}], size: [{
|
|
2316
|
+
type: Input
|
|
2317
|
+
}], title: [{
|
|
2318
|
+
type: Input
|
|
2319
|
+
}], dismissible: [{
|
|
2320
|
+
type: Input
|
|
2321
|
+
}], showIcon: [{
|
|
2322
|
+
type: Input
|
|
2323
|
+
}], visible: [{
|
|
2324
|
+
type: Input
|
|
2325
|
+
}], class: [{
|
|
2326
|
+
type: Input
|
|
2327
|
+
}], dismissed: [{
|
|
2328
|
+
type: Output
|
|
2329
|
+
}] } });
|
|
2330
|
+
|
|
2331
|
+
class ToastComponent {
|
|
2332
|
+
cdr;
|
|
2333
|
+
/** Toast variant style. Options: 'success' | 'warning' | 'error' | 'info' | 'default' */
|
|
2334
|
+
variant = 'default';
|
|
2335
|
+
/** Toast position. Options: 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center' */
|
|
2336
|
+
position = 'top-right';
|
|
2337
|
+
/** Toast title (optional) */
|
|
2338
|
+
title;
|
|
2339
|
+
/** Toast message */
|
|
2340
|
+
message = '';
|
|
2341
|
+
/** Duration in milliseconds before auto-dismiss (0 = no auto-dismiss) */
|
|
2342
|
+
duration = 5000;
|
|
2343
|
+
/** Whether to show an icon */
|
|
2344
|
+
showIcon = true;
|
|
2345
|
+
/** Whether the toast can be dismissed manually */
|
|
2346
|
+
dismissible = true;
|
|
2347
|
+
/** Additional CSS classes */
|
|
2348
|
+
class = '';
|
|
2349
|
+
/** Event emitted when the toast is dismissed */
|
|
2350
|
+
dismissed = new EventEmitter();
|
|
2351
|
+
isVisible = true;
|
|
2352
|
+
isExiting = false;
|
|
2353
|
+
dismissTimeout;
|
|
2354
|
+
constructor(cdr) {
|
|
2355
|
+
this.cdr = cdr;
|
|
2356
|
+
}
|
|
2357
|
+
ngOnInit() {
|
|
2358
|
+
if (this.duration > 0) {
|
|
2359
|
+
this.dismissTimeout = setTimeout(() => {
|
|
2360
|
+
this.dismiss();
|
|
2361
|
+
}, this.duration);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
ngOnDestroy() {
|
|
2365
|
+
if (this.dismissTimeout) {
|
|
2366
|
+
clearTimeout(this.dismissTimeout);
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
dismiss() {
|
|
2370
|
+
if (this.isExiting) {
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
this.isExiting = true;
|
|
2374
|
+
this.cdr.markForCheck();
|
|
2375
|
+
// Wait for exit animation to complete
|
|
2376
|
+
setTimeout(() => {
|
|
2377
|
+
this.isVisible = false;
|
|
2378
|
+
this.dismissed.emit();
|
|
2379
|
+
this.cdr.markForCheck();
|
|
2380
|
+
}, 300);
|
|
2381
|
+
}
|
|
2382
|
+
get toastClasses() {
|
|
2383
|
+
return [
|
|
2384
|
+
'sefin-toast',
|
|
2385
|
+
`sefin-toast--${this.variant}`,
|
|
2386
|
+
`sefin-toast--${this.position}`,
|
|
2387
|
+
this.isExiting ? 'sefin-toast--exiting' : '',
|
|
2388
|
+
this.isVisible ? 'sefin-toast--visible' : '',
|
|
2389
|
+
this.class,
|
|
2390
|
+
]
|
|
2391
|
+
.filter(Boolean)
|
|
2392
|
+
.join(' ');
|
|
2393
|
+
}
|
|
2394
|
+
get iconClass() {
|
|
2395
|
+
const iconMap = {
|
|
2396
|
+
success: '✓',
|
|
2397
|
+
warning: '⚠',
|
|
2398
|
+
error: '✕',
|
|
2399
|
+
info: 'ⓘ',
|
|
2400
|
+
default: '•',
|
|
2401
|
+
};
|
|
2402
|
+
return iconMap[this.variant];
|
|
2403
|
+
}
|
|
2404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ToastComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2405
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ToastComponent, isStandalone: true, selector: "sefin-toast", inputs: { variant: "variant", position: "position", title: "title", message: "message", duration: "duration", showIcon: "showIcon", dismissible: "dismissible", class: "class" }, outputs: { dismissed: "dismissed" }, ngImport: i0, template: "<div\n *ngIf=\"isVisible\"\n [class]=\"toastClasses\"\n role=\"alert\"\n [attr.aria-live]=\"variant === 'error' ? 'assertive' : 'polite'\"\n>\n <div class=\"sefin-toast__content\">\n <div *ngIf=\"showIcon\" class=\"sefin-toast__icon\" [attr.aria-hidden]=\"true\">\n <span class=\"sefin-toast__icon-symbol\">{{ iconClass }}</span>\n </div>\n <div class=\"sefin-toast__body\">\n <div *ngIf=\"title\" class=\"sefin-toast__title\">{{ title }}</div>\n <div *ngIf=\"message\" class=\"sefin-toast__message\">{{ message }}</div>\n <ng-content></ng-content>\n </div>\n <button\n *ngIf=\"dismissible\"\n type=\"button\"\n class=\"sefin-toast__close\"\n (click)=\"dismiss()\"\n aria-label=\"Close toast\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n </div>\n</div>\n\n", styles: [".sefin-toast{display:flex;min-width:300px;max-width:500px;box-sizing:border-box;border-radius:var(--sefin-border-radius-md, 8px);border:1px solid transparent;font-family:var(--sefin-font-family-base, sans-serif);box-shadow:var(--sefin-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15));padding:var(--sefin-spacing-md, 12px) var(--sefin-spacing-lg, 16px);margin-bottom:var(--sefin-spacing-sm, 8px);opacity:0;transform:translateY(-10px) scale(.95);transition:opacity .3s ease-in-out,transform .3s ease-in-out}.sefin-toast--visible{opacity:1;transform:translateY(0) scale(1)}.sefin-toast--exiting{opacity:0;transform:translateY(-10px) scale(.95)}.sefin-toast--top-right.sefin-toast--exiting,.sefin-toast--top-left.sefin-toast--exiting,.sefin-toast--top-center.sefin-toast--exiting{transform:translateY(-10px) scale(.95)}.sefin-toast--bottom-right.sefin-toast--visible,.sefin-toast--bottom-left.sefin-toast--visible,.sefin-toast--bottom-center.sefin-toast--visible{transform:translateY(0) scale(1)}.sefin-toast--bottom-right.sefin-toast--exiting,.sefin-toast--bottom-left.sefin-toast--exiting,.sefin-toast--bottom-center.sefin-toast--exiting{transform:translateY(10px) scale(.95)}.sefin-toast__content{display:flex;align-items:flex-start;width:100%;gap:var(--sefin-spacing-sm, 8px)}.sefin-toast__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;font-weight:var(--sefin-font-weight-bold, 700);line-height:1;width:24px;height:24px}.sefin-toast__icon-symbol{display:block;line-height:1;font-size:16px}.sefin-toast__body{flex:1;min-width:0}.sefin-toast__title{font-weight:var(--sefin-font-weight-semibold, 600);font-size:var(--sefin-font-size-base, 14px);line-height:var(--sefin-line-height-tight, 1.4);margin:0 0 var(--sefin-spacing-xs, 4px) 0}.sefin-toast__message{font-size:var(--sefin-font-size-base, 14px);line-height:var(--sefin-line-height-normal, 1.5);margin:0}.sefin-toast__close{flex-shrink:0;background:none;border:none;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--sefin-border-radius-sm, 4px);font-size:20px;line-height:1;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out}.sefin-toast__close:hover{opacity:1;background-color:#0000000d}.sefin-toast__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-toast__close span{display:block;line-height:1}.sefin-toast--success{background-color:#fff;border-color:var(--sefin-color-success, #4caf50);border-left:4px solid var(--sefin-color-success, #4caf50)}.sefin-toast--success .sefin-toast__icon{background-color:var(--sefin-color-success, #4caf50);color:#fff}.sefin-toast--success .sefin-toast__title,.sefin-toast--success .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--success .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--warning{background-color:#fff;border-color:var(--sefin-color-warning, #ff9800);border-left:4px solid var(--sefin-color-warning, #ff9800)}.sefin-toast--warning .sefin-toast__icon{background-color:var(--sefin-color-warning, #ff9800);color:#fff}.sefin-toast--warning .sefin-toast__title,.sefin-toast--warning .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--warning .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--error{background-color:#fff;border-color:var(--sefin-color-error, #f44336);border-left:4px solid var(--sefin-color-error, #f44336)}.sefin-toast--error .sefin-toast__icon{background-color:var(--sefin-color-error, #f44336);color:#fff}.sefin-toast--error .sefin-toast__title,.sefin-toast--error .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--error .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--info{background-color:#fff;border-color:var(--sefin-color-primary, #1976d2);border-left:4px solid var(--sefin-color-primary, #1976d2)}.sefin-toast--info .sefin-toast__icon{background-color:var(--sefin-color-primary, #1976d2);color:#fff;font-weight:var(--sefin-font-weight-bold, 700)}.sefin-toast--info .sefin-toast__icon-symbol{font-weight:var(--sefin-font-weight-bold, 700)}.sefin-toast--info .sefin-toast__title{color:var(--sefin-color-text, #1a1a1a);font-weight:var(--sefin-font-weight-semibold, 600)}.sefin-toast--info .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--info .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--default{background-color:#fff;border-color:var(--sefin-color-border, #e0e0e0);border-left:4px solid var(--sefin-color-border, #e0e0e0)}.sefin-toast--default .sefin-toast__icon{background-color:var(--sefin-color-text-secondary, #666);color:#fff}.sefin-toast--default .sefin-toast__title,.sefin-toast--default .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--default .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast-container{position:fixed;z-index:99999;pointer-events:none;display:flex;flex-direction:column;isolation:isolate}.sefin-toast-container--top-right{top:var(--sefin-spacing-lg, 24px);right:var(--sefin-spacing-lg, 24px);align-items:flex-end}.sefin-toast-container--top-left{top:var(--sefin-spacing-lg, 24px);left:var(--sefin-spacing-lg, 24px);align-items:flex-start}.sefin-toast-container--top-center{top:var(--sefin-spacing-lg, 24px);left:50%;transform:translate(-50%);align-items:center}.sefin-toast-container--bottom-right{bottom:var(--sefin-spacing-lg, 24px);right:var(--sefin-spacing-lg, 24px);align-items:flex-end}.sefin-toast-container--bottom-left{bottom:var(--sefin-spacing-lg, 24px);left:var(--sefin-spacing-lg, 24px);align-items:flex-start}.sefin-toast-container--bottom-center{bottom:var(--sefin-spacing-lg, 24px);left:50%;transform:translate(-50%);align-items:center}.sefin-toast-container .sefin-toast{pointer-events:auto}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2406
|
+
}
|
|
2407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ToastComponent, decorators: [{
|
|
2408
|
+
type: Component,
|
|
2409
|
+
args: [{ selector: 'sefin-toast', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"isVisible\"\n [class]=\"toastClasses\"\n role=\"alert\"\n [attr.aria-live]=\"variant === 'error' ? 'assertive' : 'polite'\"\n>\n <div class=\"sefin-toast__content\">\n <div *ngIf=\"showIcon\" class=\"sefin-toast__icon\" [attr.aria-hidden]=\"true\">\n <span class=\"sefin-toast__icon-symbol\">{{ iconClass }}</span>\n </div>\n <div class=\"sefin-toast__body\">\n <div *ngIf=\"title\" class=\"sefin-toast__title\">{{ title }}</div>\n <div *ngIf=\"message\" class=\"sefin-toast__message\">{{ message }}</div>\n <ng-content></ng-content>\n </div>\n <button\n *ngIf=\"dismissible\"\n type=\"button\"\n class=\"sefin-toast__close\"\n (click)=\"dismiss()\"\n aria-label=\"Close toast\"\n >\n <span aria-hidden=\"true\">\u00D7</span>\n </button>\n </div>\n</div>\n\n", styles: [".sefin-toast{display:flex;min-width:300px;max-width:500px;box-sizing:border-box;border-radius:var(--sefin-border-radius-md, 8px);border:1px solid transparent;font-family:var(--sefin-font-family-base, sans-serif);box-shadow:var(--sefin-shadow-lg, 0 10px 25px rgba(0, 0, 0, .15));padding:var(--sefin-spacing-md, 12px) var(--sefin-spacing-lg, 16px);margin-bottom:var(--sefin-spacing-sm, 8px);opacity:0;transform:translateY(-10px) scale(.95);transition:opacity .3s ease-in-out,transform .3s ease-in-out}.sefin-toast--visible{opacity:1;transform:translateY(0) scale(1)}.sefin-toast--exiting{opacity:0;transform:translateY(-10px) scale(.95)}.sefin-toast--top-right.sefin-toast--exiting,.sefin-toast--top-left.sefin-toast--exiting,.sefin-toast--top-center.sefin-toast--exiting{transform:translateY(-10px) scale(.95)}.sefin-toast--bottom-right.sefin-toast--visible,.sefin-toast--bottom-left.sefin-toast--visible,.sefin-toast--bottom-center.sefin-toast--visible{transform:translateY(0) scale(1)}.sefin-toast--bottom-right.sefin-toast--exiting,.sefin-toast--bottom-left.sefin-toast--exiting,.sefin-toast--bottom-center.sefin-toast--exiting{transform:translateY(10px) scale(.95)}.sefin-toast__content{display:flex;align-items:flex-start;width:100%;gap:var(--sefin-spacing-sm, 8px)}.sefin-toast__icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:50%;font-weight:var(--sefin-font-weight-bold, 700);line-height:1;width:24px;height:24px}.sefin-toast__icon-symbol{display:block;line-height:1;font-size:16px}.sefin-toast__body{flex:1;min-width:0}.sefin-toast__title{font-weight:var(--sefin-font-weight-semibold, 600);font-size:var(--sefin-font-size-base, 14px);line-height:var(--sefin-line-height-tight, 1.4);margin:0 0 var(--sefin-spacing-xs, 4px) 0}.sefin-toast__message{font-size:var(--sefin-font-size-base, 14px);line-height:var(--sefin-line-height-normal, 1.5);margin:0}.sefin-toast__close{flex-shrink:0;background:none;border:none;padding:0;margin:0;cursor:pointer;display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--sefin-border-radius-sm, 4px);font-size:20px;line-height:1;opacity:.7;transition:opacity .2s ease-in-out,background-color .2s ease-in-out}.sefin-toast__close:hover{opacity:1;background-color:#0000000d}.sefin-toast__close:focus-visible{outline:2px solid currentColor;outline-offset:2px}.sefin-toast__close span{display:block;line-height:1}.sefin-toast--success{background-color:#fff;border-color:var(--sefin-color-success, #4caf50);border-left:4px solid var(--sefin-color-success, #4caf50)}.sefin-toast--success .sefin-toast__icon{background-color:var(--sefin-color-success, #4caf50);color:#fff}.sefin-toast--success .sefin-toast__title,.sefin-toast--success .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--success .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--warning{background-color:#fff;border-color:var(--sefin-color-warning, #ff9800);border-left:4px solid var(--sefin-color-warning, #ff9800)}.sefin-toast--warning .sefin-toast__icon{background-color:var(--sefin-color-warning, #ff9800);color:#fff}.sefin-toast--warning .sefin-toast__title,.sefin-toast--warning .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--warning .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--error{background-color:#fff;border-color:var(--sefin-color-error, #f44336);border-left:4px solid var(--sefin-color-error, #f44336)}.sefin-toast--error .sefin-toast__icon{background-color:var(--sefin-color-error, #f44336);color:#fff}.sefin-toast--error .sefin-toast__title,.sefin-toast--error .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--error .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--info{background-color:#fff;border-color:var(--sefin-color-primary, #1976d2);border-left:4px solid var(--sefin-color-primary, #1976d2)}.sefin-toast--info .sefin-toast__icon{background-color:var(--sefin-color-primary, #1976d2);color:#fff;font-weight:var(--sefin-font-weight-bold, 700)}.sefin-toast--info .sefin-toast__icon-symbol{font-weight:var(--sefin-font-weight-bold, 700)}.sefin-toast--info .sefin-toast__title{color:var(--sefin-color-text, #1a1a1a);font-weight:var(--sefin-font-weight-semibold, 600)}.sefin-toast--info .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--info .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast--default{background-color:#fff;border-color:var(--sefin-color-border, #e0e0e0);border-left:4px solid var(--sefin-color-border, #e0e0e0)}.sefin-toast--default .sefin-toast__icon{background-color:var(--sefin-color-text-secondary, #666);color:#fff}.sefin-toast--default .sefin-toast__title,.sefin-toast--default .sefin-toast__message{color:var(--sefin-color-text, #1a1a1a)}.sefin-toast--default .sefin-toast__close{color:var(--sefin-color-text-secondary, #666)}.sefin-toast-container{position:fixed;z-index:99999;pointer-events:none;display:flex;flex-direction:column;isolation:isolate}.sefin-toast-container--top-right{top:var(--sefin-spacing-lg, 24px);right:var(--sefin-spacing-lg, 24px);align-items:flex-end}.sefin-toast-container--top-left{top:var(--sefin-spacing-lg, 24px);left:var(--sefin-spacing-lg, 24px);align-items:flex-start}.sefin-toast-container--top-center{top:var(--sefin-spacing-lg, 24px);left:50%;transform:translate(-50%);align-items:center}.sefin-toast-container--bottom-right{bottom:var(--sefin-spacing-lg, 24px);right:var(--sefin-spacing-lg, 24px);align-items:flex-end}.sefin-toast-container--bottom-left{bottom:var(--sefin-spacing-lg, 24px);left:var(--sefin-spacing-lg, 24px);align-items:flex-start}.sefin-toast-container--bottom-center{bottom:var(--sefin-spacing-lg, 24px);left:50%;transform:translate(-50%);align-items:center}.sefin-toast-container .sefin-toast{pointer-events:auto}\n"] }]
|
|
2410
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { variant: [{
|
|
2411
|
+
type: Input
|
|
2412
|
+
}], position: [{
|
|
2413
|
+
type: Input
|
|
2414
|
+
}], title: [{
|
|
2415
|
+
type: Input
|
|
2416
|
+
}], message: [{
|
|
2417
|
+
type: Input
|
|
2418
|
+
}], duration: [{
|
|
2419
|
+
type: Input
|
|
2420
|
+
}], showIcon: [{
|
|
2421
|
+
type: Input
|
|
2422
|
+
}], dismissible: [{
|
|
2423
|
+
type: Input
|
|
2424
|
+
}], class: [{
|
|
2425
|
+
type: Input
|
|
2426
|
+
}], dismissed: [{
|
|
2427
|
+
type: Output
|
|
2428
|
+
}] } });
|
|
2429
|
+
|
|
2430
|
+
/**
|
|
2431
|
+
* Atoms index
|
|
2432
|
+
*/
|
|
2433
|
+
|
|
2434
|
+
class AutocompleteComponent {
|
|
2435
|
+
inputRef;
|
|
2436
|
+
dropdownRef;
|
|
2437
|
+
containerRef;
|
|
2438
|
+
options = [];
|
|
2439
|
+
placeholder = '';
|
|
2440
|
+
disabled = false;
|
|
2441
|
+
size = 'md';
|
|
2442
|
+
class = '';
|
|
2443
|
+
value = null;
|
|
2444
|
+
minChars = 0;
|
|
2445
|
+
maxResults = 10;
|
|
2446
|
+
valueChange = new EventEmitter();
|
|
2447
|
+
optionSelected = new EventEmitter();
|
|
2448
|
+
inputChange = new EventEmitter();
|
|
2449
|
+
searchText = '';
|
|
2450
|
+
filteredOptions = [];
|
|
2451
|
+
isOpen = false;
|
|
2452
|
+
selectedIndex = -1;
|
|
2453
|
+
ngOnInit() {
|
|
2454
|
+
if (this.value !== null) {
|
|
2455
|
+
const selectedOption = this.options.find((opt) => opt.value === this.value);
|
|
2456
|
+
this.searchText = selectedOption?.label || String(this.value);
|
|
2457
|
+
}
|
|
2458
|
+
}
|
|
2459
|
+
ngOnChanges(changes) {
|
|
2460
|
+
if (changes['options']) {
|
|
2461
|
+
const options = changes['options'].currentValue || [];
|
|
2462
|
+
if (this.value !== null) {
|
|
2463
|
+
const selectedOption = options.find((opt) => opt.value === this.value);
|
|
2464
|
+
if (selectedOption) {
|
|
2465
|
+
this.searchText = selectedOption.label;
|
|
2466
|
+
}
|
|
2467
|
+
else {
|
|
2468
|
+
this.searchText = '';
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
if (changes['value']) {
|
|
2473
|
+
if (this.value !== null) {
|
|
2474
|
+
const selectedOption = this.options.find((opt) => opt.value === this.value);
|
|
2475
|
+
this.searchText = selectedOption?.label || String(this.value);
|
|
2476
|
+
}
|
|
2477
|
+
else {
|
|
2478
|
+
this.searchText = '';
|
|
2479
|
+
}
|
|
2480
|
+
this.filteredOptions = [];
|
|
2481
|
+
this.isOpen = false;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
ngOnDestroy() {
|
|
2485
|
+
}
|
|
2486
|
+
onClickOutside(event) {
|
|
2487
|
+
if (this.containerRef?.nativeElement && this.isOpen) {
|
|
2488
|
+
const clickedInside = this.containerRef.nativeElement.contains(event.target);
|
|
2489
|
+
if (!clickedInside) {
|
|
2490
|
+
this.isOpen = false;
|
|
2491
|
+
this.selectedIndex = -1;
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
onInputChange(value) {
|
|
2496
|
+
this.searchText = value;
|
|
2497
|
+
this.inputChange.emit(value);
|
|
2498
|
+
if (this.options && this.options.length > 0) {
|
|
2499
|
+
this.filterOptions();
|
|
2500
|
+
this.isOpen = value.length >= this.minChars;
|
|
2501
|
+
}
|
|
2502
|
+
else {
|
|
2503
|
+
this.isOpen = false;
|
|
2504
|
+
this.filteredOptions = [];
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
filterOptions() {
|
|
2508
|
+
if (!this.options || this.options.length === 0) {
|
|
2509
|
+
this.filteredOptions = [];
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
if (this.minChars > 0 &&
|
|
2513
|
+
(!this.searchText || this.searchText.length < this.minChars)) {
|
|
2514
|
+
this.filteredOptions = [];
|
|
2515
|
+
return;
|
|
2516
|
+
}
|
|
2517
|
+
const searchText = this.searchText || '';
|
|
2518
|
+
if (searchText.length === 0) {
|
|
2519
|
+
this.filteredOptions = this.options
|
|
2520
|
+
.filter((option) => !option.disabled)
|
|
2521
|
+
.slice(0, this.maxResults);
|
|
2522
|
+
return;
|
|
2523
|
+
}
|
|
2524
|
+
const searchLower = searchText.toLowerCase();
|
|
2525
|
+
this.filteredOptions = this.options
|
|
2526
|
+
.filter((option) => {
|
|
2527
|
+
if (option.disabled)
|
|
2528
|
+
return false;
|
|
2529
|
+
return option.label.toLowerCase().includes(searchLower);
|
|
2530
|
+
})
|
|
2531
|
+
.slice(0, this.maxResults);
|
|
2532
|
+
}
|
|
2533
|
+
selectOption(option) {
|
|
2534
|
+
if (option.disabled)
|
|
2535
|
+
return;
|
|
2536
|
+
this.searchText = option.label;
|
|
2537
|
+
this.value = option.value;
|
|
2538
|
+
this.valueChange.emit(option.value);
|
|
2539
|
+
this.optionSelected.emit(option);
|
|
2540
|
+
this.isOpen = false;
|
|
2541
|
+
this.selectedIndex = -1;
|
|
2542
|
+
}
|
|
2543
|
+
onInputFocus() {
|
|
2544
|
+
if (this.disabled)
|
|
2545
|
+
return;
|
|
2546
|
+
if (this.options &&
|
|
2547
|
+
Array.isArray(this.options) &&
|
|
2548
|
+
this.options.length > 0) {
|
|
2549
|
+
this.filterOptions();
|
|
2550
|
+
this.isOpen = this.filteredOptions.length > 0;
|
|
2551
|
+
}
|
|
2552
|
+
else {
|
|
2553
|
+
this.isOpen = false;
|
|
2554
|
+
this.filteredOptions = [];
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
onInputBlur() {
|
|
2558
|
+
if (this.disabled || !this.searchText) {
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
const exactMatch = this.options.find((option) => !option.disabled &&
|
|
2562
|
+
option.label.toLowerCase().trim() === this.searchText.toLowerCase().trim());
|
|
2563
|
+
if (!exactMatch) {
|
|
2564
|
+
this.searchText = '';
|
|
2565
|
+
this.value = null;
|
|
2566
|
+
this.valueChange.emit(null);
|
|
2567
|
+
this.isOpen = false;
|
|
2568
|
+
this.filteredOptions = [];
|
|
2569
|
+
this.selectedIndex = -1;
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
onKeyDown(event) {
|
|
2573
|
+
if (!this.isOpen ||
|
|
2574
|
+
!this.filteredOptions ||
|
|
2575
|
+
this.filteredOptions.length === 0) {
|
|
2576
|
+
return;
|
|
2577
|
+
}
|
|
2578
|
+
switch (event.key) {
|
|
2579
|
+
case 'ArrowDown':
|
|
2580
|
+
event.preventDefault();
|
|
2581
|
+
this.selectedIndex = Math.min(this.selectedIndex + 1, this.filteredOptions.length - 1);
|
|
2582
|
+
setTimeout(() => this.scrollToSelected(), 0);
|
|
2583
|
+
break;
|
|
2584
|
+
case 'ArrowUp':
|
|
2585
|
+
event.preventDefault();
|
|
2586
|
+
this.selectedIndex = Math.max(this.selectedIndex - 1, -1);
|
|
2587
|
+
setTimeout(() => this.scrollToSelected(), 0);
|
|
2588
|
+
break;
|
|
2589
|
+
case 'Enter':
|
|
2590
|
+
event.preventDefault();
|
|
2591
|
+
if (this.selectedIndex >= 0 &&
|
|
2592
|
+
this.selectedIndex < this.filteredOptions.length) {
|
|
2593
|
+
this.selectOption(this.filteredOptions[this.selectedIndex]);
|
|
2594
|
+
}
|
|
2595
|
+
break;
|
|
2596
|
+
case 'Escape':
|
|
2597
|
+
event.preventDefault();
|
|
2598
|
+
this.isOpen = false;
|
|
2599
|
+
this.selectedIndex = -1;
|
|
2600
|
+
break;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
scrollToSelected() {
|
|
2604
|
+
try {
|
|
2605
|
+
if (this.dropdownRef?.nativeElement && this.selectedIndex >= 0) {
|
|
2606
|
+
const selectedElement = this.dropdownRef.nativeElement.querySelector(`[data-index="${this.selectedIndex}"]`);
|
|
2607
|
+
if (selectedElement && selectedElement instanceof HTMLElement) {
|
|
2608
|
+
selectedElement.scrollIntoView({
|
|
2609
|
+
block: 'nearest',
|
|
2610
|
+
behavior: 'smooth',
|
|
2611
|
+
});
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
catch (error) {
|
|
2616
|
+
console.warn('Could not scroll to selected option:', error);
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
clearValue() {
|
|
2620
|
+
this.searchText = '';
|
|
2621
|
+
this.value = null;
|
|
2622
|
+
this.valueChange.emit(null);
|
|
2623
|
+
this.isOpen = false;
|
|
2624
|
+
this.filteredOptions = [];
|
|
2625
|
+
if (this.inputRef?.nativeElement) {
|
|
2626
|
+
this.inputRef.nativeElement.focus();
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
get inputClasses() {
|
|
2630
|
+
return [
|
|
2631
|
+
'sefin-autocomplete__input',
|
|
2632
|
+
`sefin-autocomplete__input--${this.size}`,
|
|
2633
|
+
this.disabled ? 'sefin-autocomplete__input--disabled' : '',
|
|
2634
|
+
this.class,
|
|
2635
|
+
]
|
|
2636
|
+
.filter(Boolean)
|
|
2637
|
+
.join(' ');
|
|
2638
|
+
}
|
|
2639
|
+
get containerClasses() {
|
|
2640
|
+
return [
|
|
2641
|
+
'sefin-autocomplete',
|
|
2642
|
+
this.isOpen && this.filteredOptions.length > 0
|
|
2643
|
+
? 'sefin-autocomplete--open'
|
|
2644
|
+
: '',
|
|
2645
|
+
]
|
|
2646
|
+
.filter(Boolean)
|
|
2647
|
+
.join(' ');
|
|
2648
|
+
}
|
|
2649
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2650
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: AutocompleteComponent, isStandalone: true, selector: "sefin-autocomplete", inputs: { options: "options", placeholder: "placeholder", disabled: "disabled", size: "size", class: "class", value: "value", minChars: "minChars", maxResults: "maxResults" }, outputs: { valueChange: "valueChange", optionSelected: "optionSelected", inputChange: "inputChange" }, host: { listeners: { "document:click": "onClickOutside($event)" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "dropdownRef", first: true, predicate: ["dropdownRef"], descendants: true }, { propertyName: "containerRef", first: true, predicate: ["containerRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div [class]=\"containerClasses\" #containerRef>\n <div class=\"sefin-autocomplete__wrapper\">\n <input\n #inputRef\n type=\"text\"\n [class]=\"inputClasses\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"onInputChange($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n (keydown)=\"onKeyDown($event)\"\n autocomplete=\"off\"\n />\n <div class=\"sefin-autocomplete__actions\">\n <button\n *ngIf=\"searchText && !disabled\"\n type=\"button\"\n class=\"sefin-autocomplete__clear\"\n (click)=\"clearValue()\"\n aria-label=\"Clear\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div class=\"sefin-autocomplete__arrow\" [class.sefin-autocomplete__arrow--open]=\"isOpen\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"isOpen && filteredOptions && filteredOptions.length > 0\"\n #dropdownRef\n class=\"sefin-autocomplete__dropdown\"\n >\n <ul class=\"sefin-autocomplete__list\">\n <li\n *ngFor=\"let option of filteredOptions; let i = index\"\n [attr.data-index]=\"i\"\n [class.sefin-autocomplete__option]=\"true\"\n [class.sefin-autocomplete__option--selected]=\"i === selectedIndex\"\n [class.sefin-autocomplete__option--disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [attr.aria-selected]=\"i === selectedIndex\"\n role=\"option\"\n >\n {{ option.label }}\n </li>\n </ul>\n </div>\n <div\n *ngIf=\"\n isOpen &&\n filteredOptions &&\n filteredOptions.length === 0 &&\n searchText &&\n searchText.length >= minChars\n \"\n class=\"sefin-autocomplete__dropdown sefin-autocomplete__dropdown--empty\"\n >\n <div class=\"sefin-autocomplete__no-results\">\n No se encontraron resultados\n </div>\n </div>\n</div>\n", styles: [".sefin-autocomplete{position:relative;width:100%}.sefin-autocomplete__wrapper{position:relative;display:flex;align-items:center;width:100%}.sefin-autocomplete__input{width:100%;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;outline:none}.sefin-autocomplete__input::placeholder{color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base)}.sefin-autocomplete__input:focus{border-color:var(--sefin-color-border-focus);box-shadow:0 0 0 3px var(--sefin-color-primary-light)}.sefin-autocomplete__input:disabled{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text-disabled);cursor:not-allowed;opacity:.6}.sefin-autocomplete__input--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);padding-right:calc(var(--sefin-spacing-md) * 2.5);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-autocomplete__input--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);padding-right:calc(var(--sefin-spacing-lg) * 2);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-autocomplete__input--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);padding-right:calc(var(--sefin-spacing-xl) * 1.75);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-autocomplete__input--disabled{cursor:not-allowed}.sefin-autocomplete__actions{position:absolute;right:var(--sefin-spacing-sm);display:flex;align-items:center;gap:var(--sefin-spacing-xs)}.sefin-autocomplete__clear{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--sefin-radius-sm);color:var(--sefin-color-text-secondary);cursor:pointer;transition:all .2s ease-in-out}.sefin-autocomplete__clear:hover{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-autocomplete__clear:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-autocomplete__clear svg{width:16px;height:16px}.sefin-autocomplete__arrow{display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--sefin-color-text-secondary);pointer-events:none;transition:transform .2s ease-in-out}.sefin-autocomplete__arrow svg{width:16px;height:16px}.sefin-autocomplete__arrow--open{transform:rotate(180deg)}.sefin-autocomplete__dropdown{position:absolute;top:calc(100% + var(--sefin-spacing-xs));left:0;right:0;z-index:9999;background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);box-shadow:var(--sefin-shadow-lg);max-height:300px;overflow-y:auto}.sefin-autocomplete__dropdown--empty{padding:var(--sefin-spacing-md)}.sefin-autocomplete__list{list-style:none;margin:0;padding:var(--sefin-spacing-xs)}.sefin-autocomplete__option{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);cursor:pointer;border-radius:var(--sefin-radius-sm);transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none}.sefin-autocomplete__option:hover:not(.sefin-autocomplete__option--disabled){background-color:var(--sefin-color-surface-hover)}.sefin-autocomplete__option--selected{background-color:var(--sefin-color-primary-light);color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-medium)}.sefin-autocomplete__option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-autocomplete__no-results{padding:var(--sefin-spacing-md);text-align:center;font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-sm);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text-secondary)}.sefin-autocomplete--open .sefin-autocomplete__input{border-color:var(--sefin-color-border-focus)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
2651
|
+
}
|
|
2652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
2653
|
+
type: Component,
|
|
2654
|
+
args: [{ selector: 'sefin-autocomplete', standalone: true, imports: [CommonModule, FormsModule], changeDetection: ChangeDetectionStrategy.Default, template: "<div [class]=\"containerClasses\" #containerRef>\n <div class=\"sefin-autocomplete__wrapper\">\n <input\n #inputRef\n type=\"text\"\n [class]=\"inputClasses\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [ngModel]=\"searchText\"\n (ngModelChange)=\"onInputChange($event)\"\n (focus)=\"onInputFocus()\"\n (click)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n (keydown)=\"onKeyDown($event)\"\n autocomplete=\"off\"\n />\n <div class=\"sefin-autocomplete__actions\">\n <button\n *ngIf=\"searchText && !disabled\"\n type=\"button\"\n class=\"sefin-autocomplete__clear\"\n (click)=\"clearValue()\"\n aria-label=\"Clear\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 4L4 12M4 4L12 12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <div class=\"sefin-autocomplete__arrow\" [class.sefin-autocomplete__arrow--open]=\"isOpen\">\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n <div\n *ngIf=\"isOpen && filteredOptions && filteredOptions.length > 0\"\n #dropdownRef\n class=\"sefin-autocomplete__dropdown\"\n >\n <ul class=\"sefin-autocomplete__list\">\n <li\n *ngFor=\"let option of filteredOptions; let i = index\"\n [attr.data-index]=\"i\"\n [class.sefin-autocomplete__option]=\"true\"\n [class.sefin-autocomplete__option--selected]=\"i === selectedIndex\"\n [class.sefin-autocomplete__option--disabled]=\"option.disabled\"\n (click)=\"selectOption(option)\"\n [attr.aria-selected]=\"i === selectedIndex\"\n role=\"option\"\n >\n {{ option.label }}\n </li>\n </ul>\n </div>\n <div\n *ngIf=\"\n isOpen &&\n filteredOptions &&\n filteredOptions.length === 0 &&\n searchText &&\n searchText.length >= minChars\n \"\n class=\"sefin-autocomplete__dropdown sefin-autocomplete__dropdown--empty\"\n >\n <div class=\"sefin-autocomplete__no-results\">\n No se encontraron resultados\n </div>\n </div>\n</div>\n", styles: [".sefin-autocomplete{position:relative;width:100%}.sefin-autocomplete__wrapper{position:relative;display:flex;align-items:center;width:100%}.sefin-autocomplete__input{width:100%;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;outline:none}.sefin-autocomplete__input::placeholder{color:var(--sefin-color-text-secondary);font-family:var(--sefin-font-family-base)}.sefin-autocomplete__input:focus{border-color:var(--sefin-color-border-focus);box-shadow:0 0 0 3px var(--sefin-color-primary-light)}.sefin-autocomplete__input:disabled{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text-disabled);cursor:not-allowed;opacity:.6}.sefin-autocomplete__input--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);padding-right:calc(var(--sefin-spacing-md) * 2.5);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-autocomplete__input--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);padding-right:calc(var(--sefin-spacing-lg) * 2);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-autocomplete__input--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);padding-right:calc(var(--sefin-spacing-xl) * 1.75);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-autocomplete__input--disabled{cursor:not-allowed}.sefin-autocomplete__actions{position:absolute;right:var(--sefin-spacing-sm);display:flex;align-items:center;gap:var(--sefin-spacing-xs)}.sefin-autocomplete__clear{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;background:transparent;border:none;border-radius:var(--sefin-radius-sm);color:var(--sefin-color-text-secondary);cursor:pointer;transition:all .2s ease-in-out}.sefin-autocomplete__clear:hover{background-color:var(--sefin-color-surface-hover);color:var(--sefin-color-text)}.sefin-autocomplete__clear:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-autocomplete__clear svg{width:16px;height:16px}.sefin-autocomplete__arrow{display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--sefin-color-text-secondary);pointer-events:none;transition:transform .2s ease-in-out}.sefin-autocomplete__arrow svg{width:16px;height:16px}.sefin-autocomplete__arrow--open{transform:rotate(180deg)}.sefin-autocomplete__dropdown{position:absolute;top:calc(100% + var(--sefin-spacing-xs));left:0;right:0;z-index:9999;background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);border-radius:var(--sefin-radius-md);box-shadow:var(--sefin-shadow-lg);max-height:300px;overflow-y:auto}.sefin-autocomplete__dropdown--empty{padding:var(--sefin-spacing-md)}.sefin-autocomplete__list{list-style:none;margin:0;padding:var(--sefin-spacing-xs)}.sefin-autocomplete__option{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-base);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text);cursor:pointer;border-radius:var(--sefin-radius-sm);transition:all .15s ease-in-out;-webkit-user-select:none;user-select:none}.sefin-autocomplete__option:hover:not(.sefin-autocomplete__option--disabled){background-color:var(--sefin-color-surface-hover)}.sefin-autocomplete__option--selected{background-color:var(--sefin-color-primary-light);color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-medium)}.sefin-autocomplete__option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-autocomplete__no-results{padding:var(--sefin-spacing-md);text-align:center;font-family:var(--sefin-font-family-base);font-size:var(--sefin-font-size-sm);font-weight:var(--sefin-font-weight-normal);line-height:var(--sefin-line-height-normal);color:var(--sefin-color-text-secondary)}.sefin-autocomplete--open .sefin-autocomplete__input{border-color:var(--sefin-color-border-focus)}\n"] }]
|
|
2655
|
+
}], propDecorators: { inputRef: [{
|
|
2656
|
+
type: ViewChild,
|
|
2657
|
+
args: ['inputRef', { static: false }]
|
|
2658
|
+
}], dropdownRef: [{
|
|
2659
|
+
type: ViewChild,
|
|
2660
|
+
args: ['dropdownRef', { static: false }]
|
|
2661
|
+
}], containerRef: [{
|
|
2662
|
+
type: ViewChild,
|
|
2663
|
+
args: ['containerRef', { static: false }]
|
|
2664
|
+
}], options: [{
|
|
2665
|
+
type: Input
|
|
2666
|
+
}], placeholder: [{
|
|
2667
|
+
type: Input
|
|
2668
|
+
}], disabled: [{
|
|
2669
|
+
type: Input
|
|
2670
|
+
}], size: [{
|
|
2671
|
+
type: Input
|
|
2672
|
+
}], class: [{
|
|
2673
|
+
type: Input
|
|
2674
|
+
}], value: [{
|
|
2675
|
+
type: Input
|
|
2676
|
+
}], minChars: [{
|
|
2677
|
+
type: Input
|
|
2678
|
+
}], maxResults: [{
|
|
2679
|
+
type: Input
|
|
2680
|
+
}], valueChange: [{
|
|
2681
|
+
type: Output
|
|
2682
|
+
}], optionSelected: [{
|
|
2683
|
+
type: Output
|
|
2684
|
+
}], inputChange: [{
|
|
2685
|
+
type: Output
|
|
2686
|
+
}], onClickOutside: [{
|
|
2687
|
+
type: HostListener,
|
|
2688
|
+
args: ['document:click', ['$event']]
|
|
2689
|
+
}] } });
|
|
2690
|
+
|
|
2691
|
+
/**
|
|
2692
|
+
* Molecules index
|
|
1543
2693
|
*/
|
|
1544
2694
|
|
|
1545
2695
|
/*
|
|
@@ -1553,5 +2703,5 @@ const STYLES_PATH = './styles/index.scss';
|
|
|
1553
2703
|
* Generated bundle index. Do not edit.
|
|
1554
2704
|
*/
|
|
1555
2705
|
|
|
1556
|
-
export { AutocompleteComponent, BORDER_RADIUS_TOKENS, BRAND_THEME, ButtonComponent, COLOR_TOKENS, CheckboxComponent, DARK_THEME, DESIGN_TOKENS, IconButtonComponent, LIGHT_THEME, LinkComponent, SHADOW_TOKENS, SPACING_TOKENS, STYLES_PATH, SelectComponent, StackComponent, SwitchComponent, TYPOGRAPHY_TOKENS, ThemeLoader, TypographyComponent };
|
|
2706
|
+
export { AlertComponent, AutocompleteComponent, AvatarComponent, BORDER_RADIUS_TOKENS, BRAND_THEME, BadgeComponent, ButtonComponent, COLOR_TOKENS, CheckboxComponent, ChipComponent, DARK_THEME, DESIGN_TOKENS, DividerComponent, FabButtonComponent, IconButtonComponent, IconComponent, LIGHT_THEME, LUCIDE_ICON_MAP, LinkComponent, ProgressBarComponent, RadioComponent, SHADOW_TOKENS, SPACING_TOKENS, STYLES_PATH, SelectComponent, SpinnerComponent, StackComponent, SwitchComponent, TYPOGRAPHY_TOKENS, TagComponent, ThemeLoader, ToastComponent, TooltipComponent, TypographyComponent, getLucideIcon, hasLucideIcon };
|
|
1557
2707
|
//# sourceMappingURL=lesterarte-sefin-ui.mjs.map
|