@lesterarte/sefin-ui 0.0.20-dev.1 → 0.0.20-dev.11
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, ChangeDetectionStrategy, Component, EventEmitter, Output, forwardRef, ViewChild, HostListener } from '@angular/core';
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, EventEmitter, Output, forwardRef, ViewChild, HostListener, signal, computed, ViewEncapsulation } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1$1 from '@angular/platform-browser';
|
|
5
6
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
6
7
|
import * as LucideIcons from 'lucide';
|
|
7
8
|
import * as i2 from '@angular/forms';
|
|
@@ -938,6 +939,8 @@ class ButtonComponent {
|
|
|
938
939
|
size = 'md';
|
|
939
940
|
/** Whether the button is disabled */
|
|
940
941
|
disabled = false;
|
|
942
|
+
/** Whether the button should take full width of the container */
|
|
943
|
+
fullWidth = false;
|
|
941
944
|
/** Button type. Options: 'button' | 'submit' | 'reset' */
|
|
942
945
|
type = 'button';
|
|
943
946
|
/** Additional CSS classes */
|
|
@@ -953,6 +956,7 @@ class ButtonComponent {
|
|
|
953
956
|
'sefin-button',
|
|
954
957
|
`sefin-button--${this.variant}`,
|
|
955
958
|
`sefin-button--${this.size}`,
|
|
959
|
+
this.fullWidth ? 'sefin-button--full-width' : '',
|
|
956
960
|
this.disabled ? 'sefin-button--disabled' : '',
|
|
957
961
|
this.class,
|
|
958
962
|
]
|
|
@@ -960,17 +964,19 @@ class ButtonComponent {
|
|
|
960
964
|
.join(' ');
|
|
961
965
|
}
|
|
962
966
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
963
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ButtonComponent, isStandalone: true, selector: "sefin-button", inputs: { variant: "variant", size: "size", disabled: "disabled", type: "type", class: "class" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button [type]=\"type\" [disabled]=\"disabled\" [class]=\"buttonClasses\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [".sefin-button{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:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent}.sefin-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-button--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-button--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-button--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-button--primary:active:not(:disabled){transform:translateY(1px)}.sefin-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-button--secondary:active:not(:disabled){transform:translateY(1px)}.sefin-button--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-button--ghost{background-color:transparent;color:var(--sefin-color-primary)}.sefin-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-button--danger:hover:not(:disabled){background-color:var(--sefin-color-error);opacity:.9}.sefin-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
967
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ButtonComponent, isStandalone: true, selector: "sefin-button", inputs: { variant: "variant", size: "size", disabled: "disabled", fullWidth: "fullWidth", type: "type", class: "class" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button [type]=\"type\" [disabled]=\"disabled\" [class]=\"buttonClasses\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [".sefin-button{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:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent}.sefin-button--full-width{display:flex;width:100%}.sefin-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-button--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-button--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-button--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-button--primary:active:not(:disabled){transform:translateY(1px)}.sefin-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-button--secondary:active:not(:disabled){transform:translateY(1px)}.sefin-button--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-button--ghost{background-color:transparent;color:var(--sefin-color-primary)}.sefin-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-button--danger:hover:not(:disabled){background-color:var(--sefin-color-error);opacity:.9}.sefin-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
964
968
|
}
|
|
965
969
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
966
970
|
type: Component,
|
|
967
|
-
args: [{ selector: 'sefin-button', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button [type]=\"type\" [disabled]=\"disabled\" [class]=\"buttonClasses\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [".sefin-button{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:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent}.sefin-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-button--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-button--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-button--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-button--primary:active:not(:disabled){transform:translateY(1px)}.sefin-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-button--secondary:active:not(:disabled){transform:translateY(1px)}.sefin-button--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-button--ghost{background-color:transparent;color:var(--sefin-color-primary)}.sefin-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-button--danger:hover:not(:disabled){background-color:var(--sefin-color-error);opacity:.9}.sefin-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}\n"] }]
|
|
971
|
+
args: [{ selector: 'sefin-button', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button [type]=\"type\" [disabled]=\"disabled\" [class]=\"buttonClasses\" (click)=\"onClick($event)\">\n <ng-content></ng-content>\n</button>\n", styles: [".sefin-button{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:var(--sefin-line-height-normal);border-radius:var(--sefin-radius-md);transition:all .2s ease-in-out;cursor:pointer;outline:none;border:1px solid transparent}.sefin-button--full-width{display:flex;width:100%}.sefin-button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-button--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);line-height:var(--sefin-line-height-normal);min-height:32px}.sefin-button--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);line-height:var(--sefin-line-height-normal);min-height:40px}.sefin-button--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);line-height:var(--sefin-line-height-normal);min-height:48px}.sefin-button--primary{background-color:var(--sefin-color-primary);color:#fff}.sefin-button--primary:hover:not(:disabled){background-color:var(--sefin-color-primary-dark)}.sefin-button--primary:active:not(:disabled){transform:translateY(1px)}.sefin-button--secondary{background-color:var(--sefin-color-secondary);color:#fff}.sefin-button--secondary:hover:not(:disabled){background-color:var(--sefin-color-secondary-dark)}.sefin-button--secondary:active:not(:disabled){transform:translateY(1px)}.sefin-button--outline{background-color:transparent;color:var(--sefin-color-primary);border-color:var(--sefin-color-primary)}.sefin-button--outline:hover:not(:disabled){background-color:var(--sefin-color-primary);color:#fff}.sefin-button--ghost{background-color:transparent;color:var(--sefin-color-primary)}.sefin-button--ghost:hover:not(:disabled){background-color:var(--sefin-color-surface-hover)}.sefin-button--danger{background-color:var(--sefin-color-error);color:#fff}.sefin-button--danger:hover:not(:disabled){background-color:var(--sefin-color-error);opacity:.9}.sefin-button--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}\n"] }]
|
|
968
972
|
}], propDecorators: { variant: [{
|
|
969
973
|
type: Input
|
|
970
974
|
}], size: [{
|
|
971
975
|
type: Input
|
|
972
976
|
}], disabled: [{
|
|
973
977
|
type: Input
|
|
978
|
+
}], fullWidth: [{
|
|
979
|
+
type: Input
|
|
974
980
|
}], type: [{
|
|
975
981
|
type: Input
|
|
976
982
|
}], class: [{
|
|
@@ -2976,6 +2982,205 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
2976
2982
|
type: Input
|
|
2977
2983
|
}] } });
|
|
2978
2984
|
|
|
2985
|
+
class TabComponent {
|
|
2986
|
+
/** Tab variant style. Options: 'default' | 'primary' | 'secondary' | 'underline' */
|
|
2987
|
+
variant = 'default';
|
|
2988
|
+
/** Tab size. Options: 'sm' | 'md' | 'lg' */
|
|
2989
|
+
size = 'md';
|
|
2990
|
+
/** Whether the tab is disabled */
|
|
2991
|
+
disabled = false;
|
|
2992
|
+
/** Whether the tab is active */
|
|
2993
|
+
active = false;
|
|
2994
|
+
/** Additional CSS classes */
|
|
2995
|
+
class = '';
|
|
2996
|
+
clicked = new EventEmitter();
|
|
2997
|
+
onClick(event) {
|
|
2998
|
+
if (!this.disabled) {
|
|
2999
|
+
this.clicked.emit(event);
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
3002
|
+
get tabClasses() {
|
|
3003
|
+
return [
|
|
3004
|
+
'sefin-tab',
|
|
3005
|
+
`sefin-tab--${this.variant}`,
|
|
3006
|
+
`sefin-tab--${this.size}`,
|
|
3007
|
+
this.disabled ? 'sefin-tab--disabled' : '',
|
|
3008
|
+
this.active ? 'sefin-tab--active' : '',
|
|
3009
|
+
this.class,
|
|
3010
|
+
]
|
|
3011
|
+
.filter(Boolean)
|
|
3012
|
+
.join(' ');
|
|
3013
|
+
}
|
|
3014
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3015
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TabComponent, isStandalone: true, selector: "sefin-tab", inputs: { variant: "variant", size: "size", disabled: "disabled", active: "active", class: "class" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<button\n type=\"button\"\n [class]=\"tabClasses\"\n (click)=\"onClick($event)\"\n [disabled]=\"disabled\"\n [attr.aria-selected]=\"active\"\n role=\"tab\"\n [attr.tabindex]=\"disabled ? '-1' : '0'\"\n>\n <span class=\"sefin-tab__content\">\n <ng-content></ng-content>\n </span>\n <span *ngIf=\"active && variant === 'underline'\" class=\"sefin-tab__indicator\"></span>\n</button>\n\n", styles: [".sefin-tab{display:inline-flex;align-items:center;justify-content:center;position:relative;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:none;background:transparent;cursor:pointer;outline:none;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out;text-align:center}.sefin-tab:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px;border-radius:var(--sefin-radius-sm)}.sefin-tab--sm{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-tab--md{padding:var(--sefin-spacing-md, 16px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-tab--lg{padding:var(--sefin-spacing-lg, 24px) var(--sefin-spacing-xl, 32px);font-size:var(--sefin-font-size-lg, 18px);min-height:48px}.sefin-tab--default{color:var(--sefin-color-text-secondary);border-bottom:2px solid transparent}.sefin-tab--default:hover:not(:disabled){color:var(--sefin-color-text);background-color:var(--sefin-color-surface-hover);border-radius:var(--sefin-radius-md) var(--sefin-radius-md) 0 0}.sefin-tab--default.sefin-tab--active{color:var(--sefin-color-primary);border-bottom-color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--primary{color:var(--sefin-color-text-secondary);background-color:transparent;border-radius:var(--sefin-radius-md) var(--sefin-radius-md) 0 0}.sefin-tab--primary:hover:not(:disabled){color:var(--sefin-color-primary);background-color:var(--sefin-color-surface-hover)}.sefin-tab--primary.sefin-tab--active{color:var(--sefin-color-primary);background-color:var(--sefin-color-surface);font-weight:var(--sefin-font-weight-semibold);border-bottom:2px solid var(--sefin-color-primary)}.sefin-tab--secondary{color:var(--sefin-color-text-secondary);background-color:var(--sefin-color-surface-hover);border-radius:var(--sefin-radius-md)}.sefin-tab--secondary:hover:not(:disabled){color:var(--sefin-color-text);background-color:var(--sefin-color-border)}.sefin-tab--secondary.sefin-tab--active{color:#fff;background-color:var(--sefin-color-secondary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--underline{color:var(--sefin-color-text-secondary);border-bottom:2px solid transparent}.sefin-tab--underline:hover:not(:disabled){color:var(--sefin-color-text)}.sefin-tab--underline.sefin-tab--active{color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-tab__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);position:relative;z-index:1}.sefin-tab__indicator{position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--sefin-color-primary);border-radius:var(--sefin-radius-sm) var(--sefin-radius-sm) 0 0}.sefin-tab ::ng-deep svg,.sefin-tab ::ng-deep sefin-icon{flex-shrink:0}.sefin-tab--sm ::ng-deep svg{width:14px;height:14px}.sefin-tab--md ::ng-deep svg{width:16px;height:16px}.sefin-tab--lg ::ng-deep svg{width:18px;height:18px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3016
|
+
}
|
|
3017
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TabComponent, decorators: [{
|
|
3018
|
+
type: Component,
|
|
3019
|
+
args: [{ selector: 'sefin-tab', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n type=\"button\"\n [class]=\"tabClasses\"\n (click)=\"onClick($event)\"\n [disabled]=\"disabled\"\n [attr.aria-selected]=\"active\"\n role=\"tab\"\n [attr.tabindex]=\"disabled ? '-1' : '0'\"\n>\n <span class=\"sefin-tab__content\">\n <ng-content></ng-content>\n </span>\n <span *ngIf=\"active && variant === 'underline'\" class=\"sefin-tab__indicator\"></span>\n</button>\n\n", styles: [".sefin-tab{display:inline-flex;align-items:center;justify-content:center;position:relative;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:none;background:transparent;cursor:pointer;outline:none;white-space:nowrap;-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out;text-align:center}.sefin-tab:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px;border-radius:var(--sefin-radius-sm)}.sefin-tab--sm{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-tab--md{padding:var(--sefin-spacing-md, 16px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-tab--lg{padding:var(--sefin-spacing-lg, 24px) var(--sefin-spacing-xl, 32px);font-size:var(--sefin-font-size-lg, 18px);min-height:48px}.sefin-tab--default{color:var(--sefin-color-text-secondary);border-bottom:2px solid transparent}.sefin-tab--default:hover:not(:disabled){color:var(--sefin-color-text);background-color:var(--sefin-color-surface-hover);border-radius:var(--sefin-radius-md) var(--sefin-radius-md) 0 0}.sefin-tab--default.sefin-tab--active{color:var(--sefin-color-primary);border-bottom-color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--primary{color:var(--sefin-color-text-secondary);background-color:transparent;border-radius:var(--sefin-radius-md) var(--sefin-radius-md) 0 0}.sefin-tab--primary:hover:not(:disabled){color:var(--sefin-color-primary);background-color:var(--sefin-color-surface-hover)}.sefin-tab--primary.sefin-tab--active{color:var(--sefin-color-primary);background-color:var(--sefin-color-surface);font-weight:var(--sefin-font-weight-semibold);border-bottom:2px solid var(--sefin-color-primary)}.sefin-tab--secondary{color:var(--sefin-color-text-secondary);background-color:var(--sefin-color-surface-hover);border-radius:var(--sefin-radius-md)}.sefin-tab--secondary:hover:not(:disabled){color:var(--sefin-color-text);background-color:var(--sefin-color-border)}.sefin-tab--secondary.sefin-tab--active{color:#fff;background-color:var(--sefin-color-secondary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--underline{color:var(--sefin-color-text-secondary);border-bottom:2px solid transparent}.sefin-tab--underline:hover:not(:disabled){color:var(--sefin-color-text)}.sefin-tab--underline.sefin-tab--active{color:var(--sefin-color-primary);font-weight:var(--sefin-font-weight-semibold)}.sefin-tab--disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-tab__content{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);position:relative;z-index:1}.sefin-tab__indicator{position:absolute;bottom:0;left:0;right:0;height:2px;background-color:var(--sefin-color-primary);border-radius:var(--sefin-radius-sm) var(--sefin-radius-sm) 0 0}.sefin-tab ::ng-deep svg,.sefin-tab ::ng-deep sefin-icon{flex-shrink:0}.sefin-tab--sm ::ng-deep svg{width:14px;height:14px}.sefin-tab--md ::ng-deep svg{width:16px;height:16px}.sefin-tab--lg ::ng-deep svg{width:18px;height:18px}\n"] }]
|
|
3020
|
+
}], propDecorators: { variant: [{
|
|
3021
|
+
type: Input
|
|
3022
|
+
}], size: [{
|
|
3023
|
+
type: Input
|
|
3024
|
+
}], disabled: [{
|
|
3025
|
+
type: Input
|
|
3026
|
+
}], active: [{
|
|
3027
|
+
type: Input
|
|
3028
|
+
}], class: [{
|
|
3029
|
+
type: Input
|
|
3030
|
+
}], clicked: [{
|
|
3031
|
+
type: Output
|
|
3032
|
+
}] } });
|
|
3033
|
+
|
|
3034
|
+
class RateComponent {
|
|
3035
|
+
/** Current rating value (0 to max) */
|
|
3036
|
+
set value(value) {
|
|
3037
|
+
this._value.set(Math.max(0, Math.min(value, this.max)));
|
|
3038
|
+
}
|
|
3039
|
+
get value() {
|
|
3040
|
+
return this._value();
|
|
3041
|
+
}
|
|
3042
|
+
_value = signal(0, ...(ngDevMode ? [{ debugName: "_value" }] : []));
|
|
3043
|
+
/** Maximum rating value */
|
|
3044
|
+
max = 5;
|
|
3045
|
+
/** Whether the rating is disabled */
|
|
3046
|
+
disabled = false;
|
|
3047
|
+
/** Whether the rating is readonly */
|
|
3048
|
+
readonly = false;
|
|
3049
|
+
/** Whether to allow half stars */
|
|
3050
|
+
allowHalf = false;
|
|
3051
|
+
/** Icon type. Options: 'star' | 'heart' | 'thumb' */
|
|
3052
|
+
icon = 'star';
|
|
3053
|
+
/** Rate size. Options: 'sm' | 'md' | 'lg' */
|
|
3054
|
+
size = 'md';
|
|
3055
|
+
/** Whether to show text with rating */
|
|
3056
|
+
showText = false;
|
|
3057
|
+
/** Additional CSS classes */
|
|
3058
|
+
class = '';
|
|
3059
|
+
/** Event emitted when rating changes */
|
|
3060
|
+
valueChange = new EventEmitter();
|
|
3061
|
+
/** Event emitted when rating is hovered */
|
|
3062
|
+
hoverChange = new EventEmitter();
|
|
3063
|
+
/** Internal hover value */
|
|
3064
|
+
_hoverValue = signal(null, ...(ngDevMode ? [{ debugName: "_hoverValue" }] : []));
|
|
3065
|
+
items = computed(() => {
|
|
3066
|
+
return Array.from({ length: this.max }, (_, i) => i + 1);
|
|
3067
|
+
}, ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
3068
|
+
get rateClasses() {
|
|
3069
|
+
return [
|
|
3070
|
+
'sefin-rate',
|
|
3071
|
+
`sefin-rate--${this.size}`,
|
|
3072
|
+
`sefin-rate--${this.icon}`,
|
|
3073
|
+
this.disabled ? 'sefin-rate--disabled' : '',
|
|
3074
|
+
this.readonly ? 'sefin-rate--readonly' : '',
|
|
3075
|
+
this.class,
|
|
3076
|
+
]
|
|
3077
|
+
.filter(Boolean)
|
|
3078
|
+
.join(' ');
|
|
3079
|
+
}
|
|
3080
|
+
isInteractive() {
|
|
3081
|
+
return !this.disabled && !this.readonly;
|
|
3082
|
+
}
|
|
3083
|
+
getDisplayValue() {
|
|
3084
|
+
return this._hoverValue() ?? this.value;
|
|
3085
|
+
}
|
|
3086
|
+
getIconState(index) {
|
|
3087
|
+
const displayValue = this.getDisplayValue();
|
|
3088
|
+
if (displayValue >= index) {
|
|
3089
|
+
return 'full';
|
|
3090
|
+
}
|
|
3091
|
+
if (this.allowHalf && displayValue >= index - 0.5) {
|
|
3092
|
+
return 'half';
|
|
3093
|
+
}
|
|
3094
|
+
return 'empty';
|
|
3095
|
+
}
|
|
3096
|
+
onItemClick(index) {
|
|
3097
|
+
if (!this.isInteractive()) {
|
|
3098
|
+
return;
|
|
3099
|
+
}
|
|
3100
|
+
const newValue = index;
|
|
3101
|
+
if (newValue !== this.value) {
|
|
3102
|
+
this._value.set(newValue);
|
|
3103
|
+
this.valueChange.emit(newValue);
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3106
|
+
onItemHover(index) {
|
|
3107
|
+
if (!this.isInteractive()) {
|
|
3108
|
+
return;
|
|
3109
|
+
}
|
|
3110
|
+
this._hoverValue.set(index);
|
|
3111
|
+
this.hoverChange.emit(index);
|
|
3112
|
+
}
|
|
3113
|
+
onHalfClick(index, isLeftHalf) {
|
|
3114
|
+
if (!this.isInteractive() || !this.allowHalf) {
|
|
3115
|
+
return;
|
|
3116
|
+
}
|
|
3117
|
+
const newValue = isLeftHalf ? index - 0.5 : index;
|
|
3118
|
+
if (newValue !== this.value) {
|
|
3119
|
+
this._value.set(newValue);
|
|
3120
|
+
this.valueChange.emit(newValue);
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RateComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: RateComponent, isStandalone: true, selector: "sefin-rate", inputs: { value: "value", max: "max", disabled: "disabled", readonly: "readonly", allowHalf: "allowHalf", icon: "icon", size: "size", showText: "showText", class: "class" }, outputs: { valueChange: "valueChange", hoverChange: "hoverChange" }, ngImport: i0, template: "<div [class]=\"rateClasses\">\n <div class=\"sefin-rate__container\">\n <div\n *ngFor=\"let item of items(); let i = index\"\n class=\"sefin-rate__item\"\n (mouseenter)=\"onItemHover(item)\"\n (mouseleave)=\"onItemHover(null)\"\n [class.sefin-rate__item--interactive]=\"isInteractive()\"\n >\n <ng-container [ngSwitch]=\"icon\">\n <!-- Star icon -->\n <div *ngSwitchCase=\"'star'\" class=\"sefin-rate__icon-wrapper\">\n <ng-container *ngIf=\"allowHalf && isInteractive(); else fullStar\">\n <div class=\"sefin-rate__icon-half\" (click)=\"onHalfClick(item, true)\">\n <svg\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n <div class=\"sefin-rate__icon-half sefin-rate__icon-half--right\" (click)=\"onHalfClick(item, false)\">\n <svg\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </ng-container>\n <ng-template #fullStar>\n <svg\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </ng-template>\n </div>\n\n <!-- Heart icon -->\n <svg\n *ngSwitchCase=\"'heart'\"\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20.84 4.61C20.3292 4.099 19.7228 3.69364 19.0554 3.41708C18.3879 3.14052 17.6725 2.99817 16.95 2.99817C16.2275 2.99817 15.5121 3.14052 14.8446 3.41708C14.1772 3.69364 13.5708 4.099 13.06 4.61L12 5.67L10.94 4.61C9.9083 3.57831 8.50903 2.99871 7.05 2.99871C5.59096 2.99871 4.19169 3.57831 3.16 4.61C2.1283 5.64169 1.54871 7.04097 1.54871 8.5C1.54871 9.95903 2.1283 11.3583 3.16 12.39L4.22 13.45L12 21.23L19.78 13.45L20.84 12.39C21.351 11.8792 21.7564 11.2728 22.0329 10.6054C22.3095 9.93789 22.4518 9.22248 22.4518 8.5C22.4518 7.77752 22.3095 7.0621 22.0329 6.39464C21.7564 5.72718 21.351 5.12075 20.84 4.61Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n\n <!-- Thumb icon -->\n <svg\n *ngSwitchCase=\"'thumb'\"\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 22V11M2 13V20C2 21.1046 2.89543 22 4 22H16.4262C17.907 22 19.1662 20.9197 19.3914 19.4562L20.4683 12.4562C20.7479 10.6388 19.3411 9 17.5032 9H14C13.4477 9 13 8.55228 13 8V4.46584C13 3.10399 11.896 2 10.5342 2C10.2093 2 9.91498 2.1913 9.78306 2.48812L7.26394 8.57899C7.09882 8.95673 6.74568 9.2 6.35471 9.2H4C2.89543 9.2 2 10.0954 2 11.2V13Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </ng-container>\n </div>\n </div>\n \n <span *ngIf=\"showText\" class=\"sefin-rate__text\">\n {{ value }} / {{ max }}\n </span>\n</div>\n\n", styles: [".sefin-rate{display:inline-flex;align-items:center;gap:var(--sefin-spacing-sm, 8px);font-family:var(--sefin-font-family-base)}.sefin-rate__container{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-rate__item{display:inline-flex;align-items:center;justify-content:center;position:relative;line-height:0}.sefin-rate__item--interactive{cursor:pointer}.sefin-rate__icon-wrapper{display:flex;position:relative;width:100%;height:100%}.sefin-rate__icon-half{position:absolute;width:50%;height:100%;overflow:hidden;display:flex;align-items:center;justify-content:flex-start;cursor:pointer}.sefin-rate__icon-half--right{right:0;justify-content:flex-end}.sefin-rate__icon-half svg{width:200%;height:100%}.sefin-rate__icon-half--right svg{transform:translate(-50%)}.sefin-rate__icon{display:block;transition:all .2s ease-in-out;stroke:var(--sefin-color-border);fill:none}.sefin-rate__icon--full{stroke:var(--sefin-color-primary);fill:var(--sefin-color-primary)}.sefin-rate__icon--half{stroke:var(--sefin-color-primary)}.sefin-rate__icon--empty{stroke:var(--sefin-color-border);fill:none}.sefin-rate__item--interactive .sefin-rate__icon{cursor:pointer}.sefin-rate__item--interactive .sefin-rate__icon:hover{stroke:var(--sefin-color-primary);transform:scale(1.1)}.sefin-rate__text{font-size:var(--sefin-font-size-base);color:var(--sefin-color-text-secondary);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal)}.sefin-rate--sm .sefin-rate__icon,.sefin-rate--sm .sefin-rate__icon-wrapper{width:16px;height:16px}.sefin-rate--sm .sefin-rate__text{font-size:var(--sefin-font-size-sm, 14px)}.sefin-rate--md .sefin-rate__icon,.sefin-rate--md .sefin-rate__icon-wrapper{width:20px;height:20px}.sefin-rate--md .sefin-rate__text{font-size:var(--sefin-font-size-base, 16px)}.sefin-rate--lg .sefin-rate__icon,.sefin-rate--lg .sefin-rate__icon-wrapper{width:24px;height:24px}.sefin-rate--lg .sefin-rate__text{font-size:var(--sefin-font-size-lg, 18px)}.sefin-rate--star .sefin-rate__icon--full{color:var(--sefin-color-warning);stroke:var(--sefin-color-warning);fill:var(--sefin-color-warning)}.sefin-rate--star .sefin-rate__icon--half,.sefin-rate--star .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-warning);stroke:var(--sefin-color-warning)}.sefin-rate--heart .sefin-rate__icon--full{color:var(--sefin-color-error);stroke:var(--sefin-color-error);fill:var(--sefin-color-error)}.sefin-rate--heart .sefin-rate__icon--half,.sefin-rate--heart .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-error);stroke:var(--sefin-color-error)}.sefin-rate--thumb .sefin-rate__icon--full{color:var(--sefin-color-success);stroke:var(--sefin-color-success);fill:var(--sefin-color-success)}.sefin-rate--thumb .sefin-rate__icon--half,.sefin-rate--thumb .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-success);stroke:var(--sefin-color-success)}.sefin-rate--disabled .sefin-rate__item,.sefin-rate--readonly .sefin-rate__item{cursor:default;pointer-events:none}.sefin-rate--disabled .sefin-rate__icon,.sefin-rate--readonly .sefin-rate__icon{opacity:.6}.sefin-rate .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-primary)}.sefin-rate--star .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-warning)}.sefin-rate--heart .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-error)}.sefin-rate--thumb .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-success)}\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: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3125
|
+
}
|
|
3126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: RateComponent, decorators: [{
|
|
3127
|
+
type: Component,
|
|
3128
|
+
args: [{ selector: 'sefin-rate', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"rateClasses\">\n <div class=\"sefin-rate__container\">\n <div\n *ngFor=\"let item of items(); let i = index\"\n class=\"sefin-rate__item\"\n (mouseenter)=\"onItemHover(item)\"\n (mouseleave)=\"onItemHover(null)\"\n [class.sefin-rate__item--interactive]=\"isInteractive()\"\n >\n <ng-container [ngSwitch]=\"icon\">\n <!-- Star icon -->\n <div *ngSwitchCase=\"'star'\" class=\"sefin-rate__icon-wrapper\">\n <ng-container *ngIf=\"allowHalf && isInteractive(); else fullStar\">\n <div class=\"sefin-rate__icon-half\" (click)=\"onHalfClick(item, true)\">\n <svg\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n <div class=\"sefin-rate__icon-half sefin-rate__icon-half--right\" (click)=\"onHalfClick(item, false)\">\n <svg\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </ng-container>\n <ng-template #fullStar>\n <svg\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--half]=\"getIconState(item) === 'half'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </ng-template>\n </div>\n\n <!-- Heart icon -->\n <svg\n *ngSwitchCase=\"'heart'\"\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20.84 4.61C20.3292 4.099 19.7228 3.69364 19.0554 3.41708C18.3879 3.14052 17.6725 2.99817 16.95 2.99817C16.2275 2.99817 15.5121 3.14052 14.8446 3.41708C14.1772 3.69364 13.5708 4.099 13.06 4.61L12 5.67L10.94 4.61C9.9083 3.57831 8.50903 2.99871 7.05 2.99871C5.59096 2.99871 4.19169 3.57831 3.16 4.61C2.1283 5.64169 1.54871 7.04097 1.54871 8.5C1.54871 9.95903 2.1283 11.3583 3.16 12.39L4.22 13.45L12 21.23L19.78 13.45L20.84 12.39C21.351 11.8792 21.7564 11.2728 22.0329 10.6054C22.3095 9.93789 22.4518 9.22248 22.4518 8.5C22.4518 7.77752 22.3095 7.0621 22.0329 6.39464C21.7564 5.72718 21.351 5.12075 20.84 4.61Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n\n <!-- Thumb icon -->\n <svg\n *ngSwitchCase=\"'thumb'\"\n class=\"sefin-rate__icon\"\n [class.sefin-rate__icon--full]=\"getIconState(item) === 'full'\"\n [class.sefin-rate__icon--empty]=\"getIconState(item) === 'empty'\"\n (click)=\"onItemClick(item)\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7 22V11M2 13V20C2 21.1046 2.89543 22 4 22H16.4262C17.907 22 19.1662 20.9197 19.3914 19.4562L20.4683 12.4562C20.7479 10.6388 19.3411 9 17.5032 9H14C13.4477 9 13 8.55228 13 8V4.46584C13 3.10399 11.896 2 10.5342 2C10.2093 2 9.91498 2.1913 9.78306 2.48812L7.26394 8.57899C7.09882 8.95673 6.74568 9.2 6.35471 9.2H4C2.89543 9.2 2 10.0954 2 11.2V13Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </ng-container>\n </div>\n </div>\n \n <span *ngIf=\"showText\" class=\"sefin-rate__text\">\n {{ value }} / {{ max }}\n </span>\n</div>\n\n", styles: [".sefin-rate{display:inline-flex;align-items:center;gap:var(--sefin-spacing-sm, 8px);font-family:var(--sefin-font-family-base)}.sefin-rate__container{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-rate__item{display:inline-flex;align-items:center;justify-content:center;position:relative;line-height:0}.sefin-rate__item--interactive{cursor:pointer}.sefin-rate__icon-wrapper{display:flex;position:relative;width:100%;height:100%}.sefin-rate__icon-half{position:absolute;width:50%;height:100%;overflow:hidden;display:flex;align-items:center;justify-content:flex-start;cursor:pointer}.sefin-rate__icon-half--right{right:0;justify-content:flex-end}.sefin-rate__icon-half svg{width:200%;height:100%}.sefin-rate__icon-half--right svg{transform:translate(-50%)}.sefin-rate__icon{display:block;transition:all .2s ease-in-out;stroke:var(--sefin-color-border);fill:none}.sefin-rate__icon--full{stroke:var(--sefin-color-primary);fill:var(--sefin-color-primary)}.sefin-rate__icon--half{stroke:var(--sefin-color-primary)}.sefin-rate__icon--empty{stroke:var(--sefin-color-border);fill:none}.sefin-rate__item--interactive .sefin-rate__icon{cursor:pointer}.sefin-rate__item--interactive .sefin-rate__icon:hover{stroke:var(--sefin-color-primary);transform:scale(1.1)}.sefin-rate__text{font-size:var(--sefin-font-size-base);color:var(--sefin-color-text-secondary);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal)}.sefin-rate--sm .sefin-rate__icon,.sefin-rate--sm .sefin-rate__icon-wrapper{width:16px;height:16px}.sefin-rate--sm .sefin-rate__text{font-size:var(--sefin-font-size-sm, 14px)}.sefin-rate--md .sefin-rate__icon,.sefin-rate--md .sefin-rate__icon-wrapper{width:20px;height:20px}.sefin-rate--md .sefin-rate__text{font-size:var(--sefin-font-size-base, 16px)}.sefin-rate--lg .sefin-rate__icon,.sefin-rate--lg .sefin-rate__icon-wrapper{width:24px;height:24px}.sefin-rate--lg .sefin-rate__text{font-size:var(--sefin-font-size-lg, 18px)}.sefin-rate--star .sefin-rate__icon--full{color:var(--sefin-color-warning);stroke:var(--sefin-color-warning);fill:var(--sefin-color-warning)}.sefin-rate--star .sefin-rate__icon--half,.sefin-rate--star .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-warning);stroke:var(--sefin-color-warning)}.sefin-rate--heart .sefin-rate__icon--full{color:var(--sefin-color-error);stroke:var(--sefin-color-error);fill:var(--sefin-color-error)}.sefin-rate--heart .sefin-rate__icon--half,.sefin-rate--heart .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-error);stroke:var(--sefin-color-error)}.sefin-rate--thumb .sefin-rate__icon--full{color:var(--sefin-color-success);stroke:var(--sefin-color-success);fill:var(--sefin-color-success)}.sefin-rate--thumb .sefin-rate__icon--half,.sefin-rate--thumb .sefin-rate__item--interactive .sefin-rate__icon:hover{color:var(--sefin-color-success);stroke:var(--sefin-color-success)}.sefin-rate--disabled .sefin-rate__item,.sefin-rate--readonly .sefin-rate__item{cursor:default;pointer-events:none}.sefin-rate--disabled .sefin-rate__icon,.sefin-rate--readonly .sefin-rate__icon{opacity:.6}.sefin-rate .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-primary)}.sefin-rate--star .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-warning)}.sefin-rate--heart .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-error)}.sefin-rate--thumb .sefin-rate__icon-half .sefin-rate__icon--half{fill:var(--sefin-color-success)}\n"] }]
|
|
3129
|
+
}], propDecorators: { value: [{
|
|
3130
|
+
type: Input
|
|
3131
|
+
}], max: [{
|
|
3132
|
+
type: Input
|
|
3133
|
+
}], disabled: [{
|
|
3134
|
+
type: Input
|
|
3135
|
+
}], readonly: [{
|
|
3136
|
+
type: Input
|
|
3137
|
+
}], allowHalf: [{
|
|
3138
|
+
type: Input
|
|
3139
|
+
}], icon: [{
|
|
3140
|
+
type: Input
|
|
3141
|
+
}], size: [{
|
|
3142
|
+
type: Input
|
|
3143
|
+
}], showText: [{
|
|
3144
|
+
type: Input
|
|
3145
|
+
}], class: [{
|
|
3146
|
+
type: Input
|
|
3147
|
+
}], valueChange: [{
|
|
3148
|
+
type: Output
|
|
3149
|
+
}], hoverChange: [{
|
|
3150
|
+
type: Output
|
|
3151
|
+
}] } });
|
|
3152
|
+
|
|
3153
|
+
class SpacerComponent {
|
|
3154
|
+
/** Size of the spacer. Options: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' */
|
|
3155
|
+
size = 'md';
|
|
3156
|
+
/** Orientation of the spacer. Options: 'vertical' | 'horizontal' */
|
|
3157
|
+
orientation = 'vertical';
|
|
3158
|
+
/** Additional CSS classes */
|
|
3159
|
+
class = '';
|
|
3160
|
+
get spacerClasses() {
|
|
3161
|
+
return [
|
|
3162
|
+
'sefin-spacer',
|
|
3163
|
+
`sefin-spacer--${this.orientation}`,
|
|
3164
|
+
`sefin-spacer--${this.size}`,
|
|
3165
|
+
this.class,
|
|
3166
|
+
]
|
|
3167
|
+
.filter(Boolean)
|
|
3168
|
+
.join(' ');
|
|
3169
|
+
}
|
|
3170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SpacerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3171
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: SpacerComponent, isStandalone: true, selector: "sefin-spacer", inputs: { size: "size", orientation: "orientation", class: "class" }, ngImport: i0, template: "<div [class]=\"spacerClasses\" aria-hidden=\"true\"></div>\n\n", styles: [".sefin-spacer{flex-shrink:0}.sefin-spacer--vertical{display:block;width:100%;height:0}.sefin-spacer--horizontal{display:inline-block;width:0;height:100%;vertical-align:middle}.sefin-spacer--xs.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-xs)}.sefin-spacer--xs.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-xs)}.sefin-spacer--sm.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-sm)}.sefin-spacer--sm.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-sm)}.sefin-spacer--md.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-md)}.sefin-spacer--md.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-md)}.sefin-spacer--lg.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-lg)}.sefin-spacer--lg.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-lg)}.sefin-spacer--xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-xl)}.sefin-spacer--xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-xl)}.sefin-spacer--2xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-2xl)}.sefin-spacer--2xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-2xl)}.sefin-spacer--3xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-3xl)}.sefin-spacer--3xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-3xl)}.sefin-spacer--4xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-4xl)}.sefin-spacer--4xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-4xl)}.sefin-spacer--5xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-5xl)}.sefin-spacer--5xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-5xl)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3172
|
+
}
|
|
3173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: SpacerComponent, decorators: [{
|
|
3174
|
+
type: Component,
|
|
3175
|
+
args: [{ selector: 'sefin-spacer', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"spacerClasses\" aria-hidden=\"true\"></div>\n\n", styles: [".sefin-spacer{flex-shrink:0}.sefin-spacer--vertical{display:block;width:100%;height:0}.sefin-spacer--horizontal{display:inline-block;width:0;height:100%;vertical-align:middle}.sefin-spacer--xs.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-xs)}.sefin-spacer--xs.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-xs)}.sefin-spacer--sm.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-sm)}.sefin-spacer--sm.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-sm)}.sefin-spacer--md.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-md)}.sefin-spacer--md.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-md)}.sefin-spacer--lg.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-lg)}.sefin-spacer--lg.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-lg)}.sefin-spacer--xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-xl)}.sefin-spacer--xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-xl)}.sefin-spacer--2xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-2xl)}.sefin-spacer--2xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-2xl)}.sefin-spacer--3xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-3xl)}.sefin-spacer--3xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-3xl)}.sefin-spacer--4xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-4xl)}.sefin-spacer--4xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-4xl)}.sefin-spacer--5xl.sefin-spacer--vertical{margin-bottom:var(--sefin-spacing-5xl)}.sefin-spacer--5xl.sefin-spacer--horizontal{margin-right:var(--sefin-spacing-5xl)}\n"] }]
|
|
3176
|
+
}], propDecorators: { size: [{
|
|
3177
|
+
type: Input
|
|
3178
|
+
}], orientation: [{
|
|
3179
|
+
type: Input
|
|
3180
|
+
}], class: [{
|
|
3181
|
+
type: Input
|
|
3182
|
+
}] } });
|
|
3183
|
+
|
|
2979
3184
|
/**
|
|
2980
3185
|
* Atoms index
|
|
2981
3186
|
*/
|
|
@@ -3311,6 +3516,234 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
3311
3516
|
args: ['document:click', ['$event']]
|
|
3312
3517
|
}] } });
|
|
3313
3518
|
|
|
3519
|
+
class BreadcrumbsComponent {
|
|
3520
|
+
sanitizer;
|
|
3521
|
+
/** Array of breadcrumb items */
|
|
3522
|
+
items = [];
|
|
3523
|
+
/** Separator style. Options: 'slash' | 'chevron' | 'arrow' */
|
|
3524
|
+
separator = 'slash';
|
|
3525
|
+
/** Breadcrumb size. Options: 'sm' | 'md' | 'lg' */
|
|
3526
|
+
size = 'md';
|
|
3527
|
+
/** Additional CSS classes */
|
|
3528
|
+
class = '';
|
|
3529
|
+
constructor(sanitizer) {
|
|
3530
|
+
this.sanitizer = sanitizer;
|
|
3531
|
+
}
|
|
3532
|
+
get breadcrumbsClasses() {
|
|
3533
|
+
return [
|
|
3534
|
+
'sefin-breadcrumbs',
|
|
3535
|
+
`sefin-breadcrumbs--${this.size}`,
|
|
3536
|
+
this.class,
|
|
3537
|
+
]
|
|
3538
|
+
.filter(Boolean)
|
|
3539
|
+
.join(' ');
|
|
3540
|
+
}
|
|
3541
|
+
isLastItem(index) {
|
|
3542
|
+
return index === this.items.length - 1;
|
|
3543
|
+
}
|
|
3544
|
+
getSeparatorIcon() {
|
|
3545
|
+
switch (this.separator) {
|
|
3546
|
+
case 'chevron':
|
|
3547
|
+
return '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 18L15 12L9 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
3548
|
+
case 'arrow':
|
|
3549
|
+
return '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 12H19M19 12L12 5M19 12L12 19" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
3550
|
+
case 'slash':
|
|
3551
|
+
default:
|
|
3552
|
+
return '/';
|
|
3553
|
+
}
|
|
3554
|
+
}
|
|
3555
|
+
sanitizeHtml(html) {
|
|
3556
|
+
if (!html)
|
|
3557
|
+
return '';
|
|
3558
|
+
// For simple text like '/', return as is
|
|
3559
|
+
if (html.length <= 2 && !html.includes('<')) {
|
|
3560
|
+
return html;
|
|
3561
|
+
}
|
|
3562
|
+
// Use sanitize for user-provided HTML (icons from items)
|
|
3563
|
+
// This sanitizes but allows safe SVG elements
|
|
3564
|
+
return this.sanitizer.sanitize(1, html) || '';
|
|
3565
|
+
}
|
|
3566
|
+
getSeparatorIconSafe() {
|
|
3567
|
+
// For separators generated internally, we can trust the HTML
|
|
3568
|
+
const icon = this.getSeparatorIcon();
|
|
3569
|
+
if (icon.length <= 2 && !icon.includes('<')) {
|
|
3570
|
+
return icon;
|
|
3571
|
+
}
|
|
3572
|
+
return this.sanitizer.bypassSecurityTrustHtml(icon);
|
|
3573
|
+
}
|
|
3574
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BreadcrumbsComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
3575
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: BreadcrumbsComponent, isStandalone: true, selector: "sefin-breadcrumbs", inputs: { items: "items", separator: "separator", size: "size", class: "class" }, ngImport: i0, template: "<nav [class]=\"breadcrumbsClasses\" aria-label=\"Breadcrumb\">\n <ol class=\"sefin-breadcrumbs__list\">\n <li\n *ngFor=\"let item of items; let i = index; let isLast = last\"\n class=\"sefin-breadcrumbs__item\"\n >\n <ng-container *ngIf=\"isLastItem(i); else linkTemplate\">\n <span class=\"sefin-breadcrumbs__current\" [attr.aria-current]=\"'page'\">\n <span *ngIf=\"item.icon\" class=\"sefin-breadcrumbs__icon\" [innerHTML]=\"sanitizeHtml(item.icon)\"></span>\n {{ item.label }}\n </span>\n </ng-container>\n <ng-template #linkTemplate>\n <sefin-link\n [href]=\"item.href || '#'\"\n variant=\"default\"\n [size]=\"size\"\n class=\"sefin-breadcrumbs__link\"\n >\n <span *ngIf=\"item.icon\" class=\"sefin-breadcrumbs__icon\" [innerHTML]=\"sanitizeHtml(item.icon)\"></span>\n {{ item.label }}\n </sefin-link>\n </ng-template>\n <span\n *ngIf=\"!isLast\"\n class=\"sefin-breadcrumbs__separator\"\n [attr.aria-hidden]=\"true\"\n [innerHTML]=\"getSeparatorIconSafe()\"\n ></span>\n </li>\n </ol>\n</nav>\n\n", styles: [".sefin-breadcrumbs{display:flex;align-items:center;font-family:var(--sefin-font-family-base)}.sefin-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;list-style:none;margin:0;padding:0;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__link{color:var(--sefin-color-text-secondary);text-decoration:none;transition:color .2s ease-in-out}.sefin-breadcrumbs__link:hover{color:var(--sefin-color-primary)}.sefin-breadcrumbs__link:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px;border-radius:var(--sefin-radius-sm)}.sefin-breadcrumbs__current{color:var(--sefin-color-text);font-weight:var(--sefin-font-weight-medium);display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__separator{display:inline-flex;align-items:center;justify-content:center;color:var(--sefin-color-text-disabled);margin:0 var(--sefin-spacing-xs, 4px);-webkit-user-select:none;user-select:none;flex-shrink:0}.sefin-breadcrumbs__separator svg{display:block;width:12px;height:12px}.sefin-breadcrumbs__icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sefin-breadcrumbs__icon svg{display:block;width:14px;height:14px}.sefin-breadcrumbs--sm{font-size:var(--sefin-font-size-sm, 14px)}.sefin-breadcrumbs--sm .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs--sm .sefin-breadcrumbs__separator svg{width:10px;height:10px}.sefin-breadcrumbs--sm .sefin-breadcrumbs__icon svg{width:12px;height:12px}.sefin-breadcrumbs--md{font-size:var(--sefin-font-size-base, 16px)}.sefin-breadcrumbs--md .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-sm, 8px)}.sefin-breadcrumbs--md .sefin-breadcrumbs__separator svg{width:12px;height:12px}.sefin-breadcrumbs--md .sefin-breadcrumbs__icon svg{width:14px;height:14px}.sefin-breadcrumbs--lg{font-size:var(--sefin-font-size-lg, 18px)}.sefin-breadcrumbs--lg .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-sm, 8px)}.sefin-breadcrumbs--lg .sefin-breadcrumbs__separator svg{width:14px;height:14px}.sefin-breadcrumbs--lg .sefin-breadcrumbs__icon svg{width:16px;height:16px}\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: "component", type: LinkComponent, selector: "sefin-link", inputs: ["variant", "size", "disabled", "href", "target", "rel", "class", "underline"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3576
|
+
}
|
|
3577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BreadcrumbsComponent, decorators: [{
|
|
3578
|
+
type: Component,
|
|
3579
|
+
args: [{ selector: 'sefin-breadcrumbs', standalone: true, imports: [CommonModule, LinkComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav [class]=\"breadcrumbsClasses\" aria-label=\"Breadcrumb\">\n <ol class=\"sefin-breadcrumbs__list\">\n <li\n *ngFor=\"let item of items; let i = index; let isLast = last\"\n class=\"sefin-breadcrumbs__item\"\n >\n <ng-container *ngIf=\"isLastItem(i); else linkTemplate\">\n <span class=\"sefin-breadcrumbs__current\" [attr.aria-current]=\"'page'\">\n <span *ngIf=\"item.icon\" class=\"sefin-breadcrumbs__icon\" [innerHTML]=\"sanitizeHtml(item.icon)\"></span>\n {{ item.label }}\n </span>\n </ng-container>\n <ng-template #linkTemplate>\n <sefin-link\n [href]=\"item.href || '#'\"\n variant=\"default\"\n [size]=\"size\"\n class=\"sefin-breadcrumbs__link\"\n >\n <span *ngIf=\"item.icon\" class=\"sefin-breadcrumbs__icon\" [innerHTML]=\"sanitizeHtml(item.icon)\"></span>\n {{ item.label }}\n </sefin-link>\n </ng-template>\n <span\n *ngIf=\"!isLast\"\n class=\"sefin-breadcrumbs__separator\"\n [attr.aria-hidden]=\"true\"\n [innerHTML]=\"getSeparatorIconSafe()\"\n ></span>\n </li>\n </ol>\n</nav>\n\n", styles: [".sefin-breadcrumbs{display:flex;align-items:center;font-family:var(--sefin-font-family-base)}.sefin-breadcrumbs__list{display:flex;flex-wrap:wrap;align-items:center;list-style:none;margin:0;padding:0;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__item{display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__link{color:var(--sefin-color-text-secondary);text-decoration:none;transition:color .2s ease-in-out}.sefin-breadcrumbs__link:hover{color:var(--sefin-color-primary)}.sefin-breadcrumbs__link:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px;border-radius:var(--sefin-radius-sm)}.sefin-breadcrumbs__current{color:var(--sefin-color-text);font-weight:var(--sefin-font-weight-medium);display:inline-flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs__separator{display:inline-flex;align-items:center;justify-content:center;color:var(--sefin-color-text-disabled);margin:0 var(--sefin-spacing-xs, 4px);-webkit-user-select:none;user-select:none;flex-shrink:0}.sefin-breadcrumbs__separator svg{display:block;width:12px;height:12px}.sefin-breadcrumbs__icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.sefin-breadcrumbs__icon svg{display:block;width:14px;height:14px}.sefin-breadcrumbs--sm{font-size:var(--sefin-font-size-sm, 14px)}.sefin-breadcrumbs--sm .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-xs, 4px)}.sefin-breadcrumbs--sm .sefin-breadcrumbs__separator svg{width:10px;height:10px}.sefin-breadcrumbs--sm .sefin-breadcrumbs__icon svg{width:12px;height:12px}.sefin-breadcrumbs--md{font-size:var(--sefin-font-size-base, 16px)}.sefin-breadcrumbs--md .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-sm, 8px)}.sefin-breadcrumbs--md .sefin-breadcrumbs__separator svg{width:12px;height:12px}.sefin-breadcrumbs--md .sefin-breadcrumbs__icon svg{width:14px;height:14px}.sefin-breadcrumbs--lg{font-size:var(--sefin-font-size-lg, 18px)}.sefin-breadcrumbs--lg .sefin-breadcrumbs__separator{margin:0 var(--sefin-spacing-sm, 8px)}.sefin-breadcrumbs--lg .sefin-breadcrumbs__separator svg{width:14px;height:14px}.sefin-breadcrumbs--lg .sefin-breadcrumbs__icon svg{width:16px;height:16px}\n"] }]
|
|
3580
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { items: [{
|
|
3581
|
+
type: Input
|
|
3582
|
+
}], separator: [{
|
|
3583
|
+
type: Input
|
|
3584
|
+
}], size: [{
|
|
3585
|
+
type: Input
|
|
3586
|
+
}], class: [{
|
|
3587
|
+
type: Input
|
|
3588
|
+
}] } });
|
|
3589
|
+
|
|
3590
|
+
class ButtonGroupComponent {
|
|
3591
|
+
sanitizer;
|
|
3592
|
+
constructor(sanitizer) {
|
|
3593
|
+
this.sanitizer = sanitizer;
|
|
3594
|
+
}
|
|
3595
|
+
/** Array of button options */
|
|
3596
|
+
options = [];
|
|
3597
|
+
/** Selected value (for segmented variant) */
|
|
3598
|
+
value = null;
|
|
3599
|
+
/** Whether multiple selection is allowed (for default variant) */
|
|
3600
|
+
multiple = false;
|
|
3601
|
+
/** Selected values (for multiple selection) */
|
|
3602
|
+
selectedValues = [];
|
|
3603
|
+
/** Button variant style. Options: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' */
|
|
3604
|
+
variant = 'primary';
|
|
3605
|
+
/** Button size. Options: 'sm' | 'md' | 'lg' */
|
|
3606
|
+
size = 'md';
|
|
3607
|
+
/** Button group variant. Options: 'default' | 'segmented' */
|
|
3608
|
+
groupVariant = 'default';
|
|
3609
|
+
/** Whether the button group is disabled */
|
|
3610
|
+
disabled = false;
|
|
3611
|
+
/** Whether buttons should take full width of the container */
|
|
3612
|
+
fullWidth = false;
|
|
3613
|
+
/** Additional CSS classes */
|
|
3614
|
+
class = '';
|
|
3615
|
+
/** Event emitted when value changes (for segmented variant) */
|
|
3616
|
+
valueChange = new EventEmitter();
|
|
3617
|
+
/** Event emitted when selected values change (for multiple selection) */
|
|
3618
|
+
selectedValuesChange = new EventEmitter();
|
|
3619
|
+
/** Event emitted when a button is clicked */
|
|
3620
|
+
buttonClick = new EventEmitter();
|
|
3621
|
+
get buttonGroupClasses() {
|
|
3622
|
+
return [
|
|
3623
|
+
'sefin-button-group',
|
|
3624
|
+
`sefin-button-group--${this.groupVariant}`,
|
|
3625
|
+
`sefin-button-group--${this.size}`,
|
|
3626
|
+
this.groupVariant === 'default' ? `sefin-button-group--${this.variant}` : '',
|
|
3627
|
+
this.fullWidth ? 'sefin-button-group--full-width' : '',
|
|
3628
|
+
this.disabled ? 'sefin-button-group--disabled' : '',
|
|
3629
|
+
this.class,
|
|
3630
|
+
]
|
|
3631
|
+
.filter(Boolean)
|
|
3632
|
+
.join(' ');
|
|
3633
|
+
}
|
|
3634
|
+
isSelected(option) {
|
|
3635
|
+
if (this.groupVariant === 'segmented') {
|
|
3636
|
+
return this.value === option.value;
|
|
3637
|
+
}
|
|
3638
|
+
return this.selectedValues.includes(option.value);
|
|
3639
|
+
}
|
|
3640
|
+
onButtonClick(option) {
|
|
3641
|
+
if (this.disabled || option.disabled) {
|
|
3642
|
+
return;
|
|
3643
|
+
}
|
|
3644
|
+
this.buttonClick.emit(option);
|
|
3645
|
+
if (this.groupVariant === 'segmented') {
|
|
3646
|
+
// Toggle selection for segmented
|
|
3647
|
+
const newValue = this.value === option.value ? null : option.value;
|
|
3648
|
+
this.value = newValue;
|
|
3649
|
+
this.valueChange.emit(newValue);
|
|
3650
|
+
}
|
|
3651
|
+
else {
|
|
3652
|
+
// Multiple selection logic
|
|
3653
|
+
const index = this.selectedValues.indexOf(option.value);
|
|
3654
|
+
if (this.multiple) {
|
|
3655
|
+
if (index >= 0) {
|
|
3656
|
+
// Deselect
|
|
3657
|
+
this.selectedValues = this.selectedValues.filter((v) => v !== option.value);
|
|
3658
|
+
}
|
|
3659
|
+
else {
|
|
3660
|
+
// Select
|
|
3661
|
+
this.selectedValues = [...this.selectedValues, option.value];
|
|
3662
|
+
}
|
|
3663
|
+
this.selectedValuesChange.emit([...this.selectedValues]);
|
|
3664
|
+
}
|
|
3665
|
+
else {
|
|
3666
|
+
// Single selection (even in default variant)
|
|
3667
|
+
if (index >= 0) {
|
|
3668
|
+
// Deselect if already selected
|
|
3669
|
+
this.selectedValues = [];
|
|
3670
|
+
}
|
|
3671
|
+
else {
|
|
3672
|
+
// Select only this one
|
|
3673
|
+
this.selectedValues = [option.value];
|
|
3674
|
+
}
|
|
3675
|
+
this.selectedValuesChange.emit([...this.selectedValues]);
|
|
3676
|
+
}
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
getButtonClasses(option) {
|
|
3680
|
+
const classes = ['sefin-button-group__button-item'];
|
|
3681
|
+
// Size class
|
|
3682
|
+
classes.push(`sefin-button-group__button-item--${this.size}`);
|
|
3683
|
+
// Selected state
|
|
3684
|
+
if (this.isSelected(option)) {
|
|
3685
|
+
classes.push('sefin-button-group__button-item--selected');
|
|
3686
|
+
}
|
|
3687
|
+
// Variant classes
|
|
3688
|
+
if (this.groupVariant === 'default') {
|
|
3689
|
+
classes.push('sefin-button-group__button-item--default');
|
|
3690
|
+
// In default variant, all buttons use the variant style
|
|
3691
|
+
classes.push(`sefin-button-group__button-item--${this.variant}`);
|
|
3692
|
+
}
|
|
3693
|
+
else {
|
|
3694
|
+
// Segmented variant
|
|
3695
|
+
classes.push('sefin-button-group__button-item--segmented');
|
|
3696
|
+
if (this.isSelected(option)) {
|
|
3697
|
+
// Selected buttons use the variant style
|
|
3698
|
+
classes.push(`sefin-button-group__button-item--${this.variant}`);
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
return classes.join(' ');
|
|
3702
|
+
}
|
|
3703
|
+
sanitizeHtml(html) {
|
|
3704
|
+
if (!html)
|
|
3705
|
+
return '';
|
|
3706
|
+
// For simple text, return as is
|
|
3707
|
+
if (html.length <= 2 && !html.includes('<')) {
|
|
3708
|
+
return html;
|
|
3709
|
+
}
|
|
3710
|
+
// Use sanitize for user-provided HTML (icons)
|
|
3711
|
+
return this.sanitizer.sanitize(1, html) || '';
|
|
3712
|
+
}
|
|
3713
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonGroupComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
3714
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: ButtonGroupComponent, isStandalone: true, selector: "sefin-button-group", inputs: { options: "options", value: "value", multiple: "multiple", selectedValues: "selectedValues", variant: "variant", size: "size", groupVariant: "groupVariant", disabled: "disabled", fullWidth: "fullWidth", class: "class" }, outputs: { valueChange: "valueChange", selectedValuesChange: "selectedValuesChange", buttonClick: "buttonClick" }, ngImport: i0, template: "<div\n [class]=\"buttonGroupClasses\"\n role=\"group\"\n [attr.aria-label]=\"'Button group'\"\n>\n <button\n *ngFor=\"let option of options\"\n type=\"button\"\n [class]=\"getButtonClasses(option)\"\n [disabled]=\"disabled || option.disabled\"\n (click)=\"onButtonClick(option)\"\n [attr.aria-pressed]=\"isSelected(option)\"\n [attr.aria-label]=\"option.label\"\n >\n <span\n *ngIf=\"option.icon\"\n class=\"sefin-button-group__icon\"\n [innerHTML]=\"sanitizeHtml(option.icon)\"\n ></span>\n <span class=\"sefin-button-group__label\">{{ option.label }}</span>\n </button>\n</div>\n", styles: [".sefin-button-group{display:inline-flex;align-items:stretch;gap:0;font-family:var(--sefin-font-family-base);position:relative;border-radius:var(--sefin-radius-md);overflow:hidden;box-shadow:var(--sefin-shadow-sm);background-color:transparent;flex-wrap:nowrap}.sefin-button-group--full-width{display:flex;width:100%}.sefin-button-group--full-width .sefin-button-group__button-item{flex:1 1 0;min-width:0;width:0}.sefin-button-group__button-item{position:relative;border-radius:0;margin:0;flex:0 1 auto;min-width:fit-content;text-align:center;white-space:nowrap;border:none;cursor:pointer;outline:none;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);transition:all .2s ease-in-out;display:flex;align-items:center;justify-content:center;box-shadow:none;-webkit-user-select:none;user-select:none}.sefin-button-group__button-item:first-child,.sefin-button-group__button-item:last-child{border-radius:0}.sefin-button-group__button-item:hover:not(:disabled){z-index:1}.sefin-button-group__button-item:focus-visible{z-index:2;outline:2px solid var(--sefin-color-border-focus);outline-offset:-2px}.sefin-button-group__button-item:active:not(:disabled){transform:translateY(1px)}.sefin-button-group__button-item:disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-button-group__button-item--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);min-height:32px}.sefin-button-group__button-item--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);min-height:40px}.sefin-button-group__button-item--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);min-height:48px}.sefin-button-group__label{display:inline-block;font-family:inherit}.sefin-button-group__icon{display:inline-flex;align-items:center;justify-content:center;margin-right:var(--sefin-spacing-xs);flex-shrink:0;font-family:inherit}.sefin-button-group__icon svg{display:block;width:16px;height:16px}.sefin-button-group--segmented{background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);padding:var(--sefin-spacing-xs);gap:var(--sefin-spacing-xs);overflow:visible;box-shadow:var(--sefin-shadow-sm);border-radius:var(--sefin-radius-md)}.sefin-button-group--segmented .sefin-button-group__button-item{border:1px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-radius:var(--sefin-radius-sm);margin:0;transition:all .2s ease-in-out}.sefin-button-group--segmented .sefin-button-group__button-item:first-child,.sefin-button-group--segmented .sefin-button-group__button-item:last-child{border-radius:var(--sefin-radius-sm)}.sefin-button-group--segmented .sefin-button-group__button-item--selected{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-sm)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--primary{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--secondary{background-color:var(--sefin-color-secondary);color:#fff;border-color:var(--sefin-color-secondary)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--outline{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected){background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-color:var(--sefin-color-border)}.sefin-button-group--segmented .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected):hover:not(:disabled){background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-primary);color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item:hover:not(:disabled).sefin-button-group__button-item--selected.sefin-button-group__button-item--primary{background-color:var(--sefin-color-primary-dark);border-color:var(--sefin-color-primary-dark)}.sefin-button-group--segmented .sefin-button-group__button-item:hover:not(:disabled).sefin-button-group__button-item--selected.sefin-button-group__button-item--secondary{background-color:var(--sefin-color-secondary-dark);border-color:var(--sefin-color-secondary-dark)}.sefin-button-group--default{background-color:var(--sefin-color-primary);border:1px solid var(--sefin-color-primary);box-shadow:var(--sefin-shadow-sm);padding:0}.sefin-button-group--default .sefin-button-group__button-item{border:none;border-radius:0;background-color:transparent;color:#fff;margin:0;box-shadow:none}.sefin-button-group--default .sefin-button-group__button-item--selected,.sefin-button-group--default .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected){background-color:transparent;color:#fff}.sefin-button-group--default .sefin-button-group__button-item:hover:not(:disabled){background-color:#ffffff26}.sefin-button-group--default .sefin-button-group__button-item:active:not(:disabled){background-color:#fff3;transform:translateY(0)}.sefin-button-group--default .sefin-button-group__button-item:not(:last-child):after{content:\"\";position:absolute;right:0;top:20%;bottom:20%;width:1px;background-color:#ffffff4d;pointer-events:none}.sefin-button-group--default .sefin-button-group__button-item--primary,.sefin-button-group--default .sefin-button-group__button-item--secondary,.sefin-button-group--default .sefin-button-group__button-item--outline{background-color:transparent}.sefin-button-group--default.sefin-button-group--secondary{background-color:var(--sefin-color-secondary);border-color:var(--sefin-color-secondary)}.sefin-button-group--sm .sefin-button-group__icon svg{width:14px;height:14px}.sefin-button-group--md .sefin-button-group__icon svg{width:16px;height:16px}.sefin-button-group--lg .sefin-button-group__icon svg{width:18px;height:18px}.sefin-button-group--disabled{opacity:.6;pointer-events:none;cursor:not-allowed}.sefin-button-group--disabled .sefin-button-group__button-item{cursor:not-allowed}\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"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
3715
|
+
}
|
|
3716
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: ButtonGroupComponent, decorators: [{
|
|
3717
|
+
type: Component,
|
|
3718
|
+
args: [{ selector: 'sefin-button-group', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.Default, template: "<div\n [class]=\"buttonGroupClasses\"\n role=\"group\"\n [attr.aria-label]=\"'Button group'\"\n>\n <button\n *ngFor=\"let option of options\"\n type=\"button\"\n [class]=\"getButtonClasses(option)\"\n [disabled]=\"disabled || option.disabled\"\n (click)=\"onButtonClick(option)\"\n [attr.aria-pressed]=\"isSelected(option)\"\n [attr.aria-label]=\"option.label\"\n >\n <span\n *ngIf=\"option.icon\"\n class=\"sefin-button-group__icon\"\n [innerHTML]=\"sanitizeHtml(option.icon)\"\n ></span>\n <span class=\"sefin-button-group__label\">{{ option.label }}</span>\n </button>\n</div>\n", styles: [".sefin-button-group{display:inline-flex;align-items:stretch;gap:0;font-family:var(--sefin-font-family-base);position:relative;border-radius:var(--sefin-radius-md);overflow:hidden;box-shadow:var(--sefin-shadow-sm);background-color:transparent;flex-wrap:nowrap}.sefin-button-group--full-width{display:flex;width:100%}.sefin-button-group--full-width .sefin-button-group__button-item{flex:1 1 0;min-width:0;width:0}.sefin-button-group__button-item{position:relative;border-radius:0;margin:0;flex:0 1 auto;min-width:fit-content;text-align:center;white-space:nowrap;border:none;cursor:pointer;outline:none;font-family:var(--sefin-font-family-base);font-weight:var(--sefin-font-weight-medium);line-height:var(--sefin-line-height-normal);transition:all .2s ease-in-out;display:flex;align-items:center;justify-content:center;box-shadow:none;-webkit-user-select:none;user-select:none}.sefin-button-group__button-item:first-child,.sefin-button-group__button-item:last-child{border-radius:0}.sefin-button-group__button-item:hover:not(:disabled){z-index:1}.sefin-button-group__button-item:focus-visible{z-index:2;outline:2px solid var(--sefin-color-border-focus);outline-offset:-2px}.sefin-button-group__button-item:active:not(:disabled){transform:translateY(1px)}.sefin-button-group__button-item:disabled{opacity:.6;cursor:not-allowed;pointer-events:none}.sefin-button-group__button-item--sm{padding:var(--sefin-spacing-sm) var(--sefin-spacing-md);font-size:var(--sefin-font-size-sm);min-height:32px}.sefin-button-group__button-item--md{padding:var(--sefin-spacing-md) var(--sefin-spacing-lg);font-size:var(--sefin-font-size-base);min-height:40px}.sefin-button-group__button-item--lg{padding:var(--sefin-spacing-lg) var(--sefin-spacing-xl);font-size:var(--sefin-font-size-lg);min-height:48px}.sefin-button-group__label{display:inline-block;font-family:inherit}.sefin-button-group__icon{display:inline-flex;align-items:center;justify-content:center;margin-right:var(--sefin-spacing-xs);flex-shrink:0;font-family:inherit}.sefin-button-group__icon svg{display:block;width:16px;height:16px}.sefin-button-group--segmented{background-color:var(--sefin-color-surface);border:1px solid var(--sefin-color-border);padding:var(--sefin-spacing-xs);gap:var(--sefin-spacing-xs);overflow:visible;box-shadow:var(--sefin-shadow-sm);border-radius:var(--sefin-radius-md)}.sefin-button-group--segmented .sefin-button-group__button-item{border:1px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-radius:var(--sefin-radius-sm);margin:0;transition:all .2s ease-in-out}.sefin-button-group--segmented .sefin-button-group__button-item:first-child,.sefin-button-group--segmented .sefin-button-group__button-item:last-child{border-radius:var(--sefin-radius-sm)}.sefin-button-group--segmented .sefin-button-group__button-item--selected{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary);box-shadow:var(--sefin-shadow-sm)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--primary{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--secondary{background-color:var(--sefin-color-secondary);color:#fff;border-color:var(--sefin-color-secondary)}.sefin-button-group--segmented .sefin-button-group__button-item--selected.sefin-button-group__button-item--outline{background-color:var(--sefin-color-primary);color:#fff;border-color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected){background-color:var(--sefin-color-surface);color:var(--sefin-color-text);border-color:var(--sefin-color-border)}.sefin-button-group--segmented .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected):hover:not(:disabled){background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-primary);color:var(--sefin-color-primary)}.sefin-button-group--segmented .sefin-button-group__button-item:hover:not(:disabled).sefin-button-group__button-item--selected.sefin-button-group__button-item--primary{background-color:var(--sefin-color-primary-dark);border-color:var(--sefin-color-primary-dark)}.sefin-button-group--segmented .sefin-button-group__button-item:hover:not(:disabled).sefin-button-group__button-item--selected.sefin-button-group__button-item--secondary{background-color:var(--sefin-color-secondary-dark);border-color:var(--sefin-color-secondary-dark)}.sefin-button-group--default{background-color:var(--sefin-color-primary);border:1px solid var(--sefin-color-primary);box-shadow:var(--sefin-shadow-sm);padding:0}.sefin-button-group--default .sefin-button-group__button-item{border:none;border-radius:0;background-color:transparent;color:#fff;margin:0;box-shadow:none}.sefin-button-group--default .sefin-button-group__button-item--selected,.sefin-button-group--default .sefin-button-group__button-item:not(.sefin-button-group__button-item--selected){background-color:transparent;color:#fff}.sefin-button-group--default .sefin-button-group__button-item:hover:not(:disabled){background-color:#ffffff26}.sefin-button-group--default .sefin-button-group__button-item:active:not(:disabled){background-color:#fff3;transform:translateY(0)}.sefin-button-group--default .sefin-button-group__button-item:not(:last-child):after{content:\"\";position:absolute;right:0;top:20%;bottom:20%;width:1px;background-color:#ffffff4d;pointer-events:none}.sefin-button-group--default .sefin-button-group__button-item--primary,.sefin-button-group--default .sefin-button-group__button-item--secondary,.sefin-button-group--default .sefin-button-group__button-item--outline{background-color:transparent}.sefin-button-group--default.sefin-button-group--secondary{background-color:var(--sefin-color-secondary);border-color:var(--sefin-color-secondary)}.sefin-button-group--sm .sefin-button-group__icon svg{width:14px;height:14px}.sefin-button-group--md .sefin-button-group__icon svg{width:16px;height:16px}.sefin-button-group--lg .sefin-button-group__icon svg{width:18px;height:18px}.sefin-button-group--disabled{opacity:.6;pointer-events:none;cursor:not-allowed}.sefin-button-group--disabled .sefin-button-group__button-item{cursor:not-allowed}\n"] }]
|
|
3719
|
+
}], ctorParameters: () => [{ type: i1$1.DomSanitizer }], propDecorators: { options: [{
|
|
3720
|
+
type: Input
|
|
3721
|
+
}], value: [{
|
|
3722
|
+
type: Input
|
|
3723
|
+
}], multiple: [{
|
|
3724
|
+
type: Input
|
|
3725
|
+
}], selectedValues: [{
|
|
3726
|
+
type: Input
|
|
3727
|
+
}], variant: [{
|
|
3728
|
+
type: Input
|
|
3729
|
+
}], size: [{
|
|
3730
|
+
type: Input
|
|
3731
|
+
}], groupVariant: [{
|
|
3732
|
+
type: Input
|
|
3733
|
+
}], disabled: [{
|
|
3734
|
+
type: Input
|
|
3735
|
+
}], fullWidth: [{
|
|
3736
|
+
type: Input
|
|
3737
|
+
}], class: [{
|
|
3738
|
+
type: Input
|
|
3739
|
+
}], valueChange: [{
|
|
3740
|
+
type: Output
|
|
3741
|
+
}], selectedValuesChange: [{
|
|
3742
|
+
type: Output
|
|
3743
|
+
}], buttonClick: [{
|
|
3744
|
+
type: Output
|
|
3745
|
+
}] } });
|
|
3746
|
+
|
|
3314
3747
|
class CardComponent {
|
|
3315
3748
|
/** Card variant style. Options: 'default' | 'elevated' | 'outlined' */
|
|
3316
3749
|
variant = 'default';
|
|
@@ -3972,15 +4405,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
3972
4405
|
args: ['document:keydown', ['$event']]
|
|
3973
4406
|
}] } });
|
|
3974
4407
|
|
|
3975
|
-
class
|
|
3976
|
-
|
|
3977
|
-
|
|
4408
|
+
class FormFieldComponent {
|
|
4409
|
+
cdr;
|
|
4410
|
+
inputRef;
|
|
4411
|
+
/** Label text for the field */
|
|
4412
|
+
label = '';
|
|
4413
|
+
/** FormField variant style. Options: 'outlined' | 'filled' | 'standard' */
|
|
3978
4414
|
variant = 'outlined';
|
|
3979
|
-
/**
|
|
4415
|
+
/** FormField size. Options: 'sm' | 'md' | 'lg' */
|
|
3980
4416
|
size = 'md';
|
|
4417
|
+
/** Input type. Options: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' */
|
|
4418
|
+
type = 'text';
|
|
3981
4419
|
/** Placeholder text */
|
|
3982
4420
|
placeholder = '';
|
|
3983
|
-
/** Helper text shown below the
|
|
4421
|
+
/** Helper text shown below the input */
|
|
3984
4422
|
hint = '';
|
|
3985
4423
|
/** Error message to display */
|
|
3986
4424
|
errorMessage = '';
|
|
@@ -3996,63 +4434,640 @@ class TextareaComponent {
|
|
|
3996
4434
|
minLength;
|
|
3997
4435
|
/** Pattern for validation (regex string) */
|
|
3998
4436
|
pattern;
|
|
3999
|
-
/**
|
|
4000
|
-
|
|
4001
|
-
/**
|
|
4002
|
-
|
|
4003
|
-
/** Whether to auto-resize based on content */
|
|
4004
|
-
autoResize = false;
|
|
4005
|
-
/** Minimum height when auto-resize is enabled */
|
|
4006
|
-
minHeight;
|
|
4007
|
-
/** Maximum height when auto-resize is enabled */
|
|
4008
|
-
maxHeight;
|
|
4437
|
+
/** Leading icon name */
|
|
4438
|
+
leadingIcon;
|
|
4439
|
+
/** Trailing icon name */
|
|
4440
|
+
trailingIcon;
|
|
4009
4441
|
/** Whether to show character counter */
|
|
4010
4442
|
showCounter = false;
|
|
4011
4443
|
/** Autocomplete attribute */
|
|
4012
4444
|
autocomplete;
|
|
4013
|
-
/**
|
|
4445
|
+
/** Input name attribute */
|
|
4014
4446
|
name = '';
|
|
4015
|
-
/**
|
|
4447
|
+
/** Input id attribute */
|
|
4016
4448
|
id = '';
|
|
4017
4449
|
/** Additional CSS classes */
|
|
4018
4450
|
class = '';
|
|
4019
4451
|
/** Custom validation function */
|
|
4020
4452
|
customValidator;
|
|
4021
|
-
/** Initial value for the textarea (for non-reactive forms) */
|
|
4022
|
-
set value(val) {
|
|
4023
|
-
this._value = val || '';
|
|
4024
|
-
if (this.textareaRef?.nativeElement) {
|
|
4025
|
-
this.textareaRef.nativeElement.value = this._value;
|
|
4026
|
-
if (this.autoResize) {
|
|
4027
|
-
setTimeout(() => this.adjustHeight(), 0);
|
|
4028
|
-
}
|
|
4029
|
-
}
|
|
4030
|
-
this.validateField();
|
|
4031
|
-
}
|
|
4032
|
-
get value() {
|
|
4033
|
-
return this._value;
|
|
4034
|
-
}
|
|
4035
4453
|
/** Event emitted when the value changes */
|
|
4036
4454
|
valueChange = new EventEmitter();
|
|
4037
|
-
/** Event emitted when the
|
|
4455
|
+
/** Event emitted when the input is focused */
|
|
4038
4456
|
focused = new EventEmitter();
|
|
4039
|
-
/** Event emitted when the
|
|
4457
|
+
/** Event emitted when the input is blurred */
|
|
4040
4458
|
blurred = new EventEmitter();
|
|
4041
|
-
|
|
4459
|
+
/** Event emitted when trailing icon is clicked */
|
|
4460
|
+
trailingIconClick = new EventEmitter();
|
|
4461
|
+
value = '';
|
|
4042
4462
|
isFocused = false;
|
|
4043
4463
|
hasError = false;
|
|
4044
4464
|
internalErrorMessage = '';
|
|
4045
|
-
|
|
4465
|
+
internalId = '';
|
|
4046
4466
|
onChange = (value) => { };
|
|
4047
4467
|
onTouched = () => { };
|
|
4048
4468
|
destroy$ = new Subject();
|
|
4049
4469
|
control;
|
|
4470
|
+
constructor(cdr) {
|
|
4471
|
+
this.cdr = cdr;
|
|
4472
|
+
}
|
|
4050
4473
|
ngOnInit() {
|
|
4051
4474
|
this.generateIdIfNeeded();
|
|
4052
4475
|
}
|
|
4053
4476
|
ngAfterViewInit() {
|
|
4054
|
-
if (this.
|
|
4055
|
-
|
|
4477
|
+
if (this.inputRef?.nativeElement) {
|
|
4478
|
+
const inputElement = this.inputRef.nativeElement;
|
|
4479
|
+
// Verificar si el input tiene un valor que no está sincronizado con el componente
|
|
4480
|
+
const inputValue = inputElement.value || '';
|
|
4481
|
+
if (inputValue && (!this.value || this.value !== inputValue)) {
|
|
4482
|
+
this.value = inputValue;
|
|
4483
|
+
}
|
|
4484
|
+
// Sincronizar el valor del componente con el input
|
|
4485
|
+
if (this.value) {
|
|
4486
|
+
inputElement.value = this.value;
|
|
4487
|
+
}
|
|
4488
|
+
if (this.type === 'password') {
|
|
4489
|
+
inputElement.style.setProperty('-webkit-appearance', 'none', 'important');
|
|
4490
|
+
inputElement.setAttribute('data-password-field', 'true');
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
}
|
|
4494
|
+
ngOnDestroy() {
|
|
4495
|
+
this.destroy$.next();
|
|
4496
|
+
this.destroy$.complete();
|
|
4497
|
+
}
|
|
4498
|
+
generateIdIfNeeded() {
|
|
4499
|
+
if (!this.id) {
|
|
4500
|
+
this.internalId = `sefin-form-field-${Math.random()
|
|
4501
|
+
.toString(36)
|
|
4502
|
+
.substr(2, 9)}`;
|
|
4503
|
+
}
|
|
4504
|
+
else {
|
|
4505
|
+
this.internalId = this.id;
|
|
4506
|
+
}
|
|
4507
|
+
}
|
|
4508
|
+
get fieldId() {
|
|
4509
|
+
return this.internalId;
|
|
4510
|
+
}
|
|
4511
|
+
get labelId() {
|
|
4512
|
+
return `${this.fieldId}-label`;
|
|
4513
|
+
}
|
|
4514
|
+
get inputId() {
|
|
4515
|
+
return `${this.fieldId}-input`;
|
|
4516
|
+
}
|
|
4517
|
+
get hintId() {
|
|
4518
|
+
return `${this.fieldId}-hint`;
|
|
4519
|
+
}
|
|
4520
|
+
onInput(event) {
|
|
4521
|
+
const target = event.target;
|
|
4522
|
+
const newValue = target.value || '';
|
|
4523
|
+
if (this.value !== newValue) {
|
|
4524
|
+
this.value = newValue;
|
|
4525
|
+
this.onChange(this.value);
|
|
4526
|
+
this.valueChange.emit(this.value);
|
|
4527
|
+
this.validateField();
|
|
4528
|
+
}
|
|
4529
|
+
}
|
|
4530
|
+
onFocus(event) {
|
|
4531
|
+
this.isFocused = true;
|
|
4532
|
+
this.focused.emit(event);
|
|
4533
|
+
this.cdr.detectChanges();
|
|
4534
|
+
}
|
|
4535
|
+
onBlur(event) {
|
|
4536
|
+
this.isFocused = false;
|
|
4537
|
+
this.onTouched();
|
|
4538
|
+
this.blurred.emit(event);
|
|
4539
|
+
this.validateField();
|
|
4540
|
+
this.cdr.detectChanges();
|
|
4541
|
+
}
|
|
4542
|
+
onTrailingIconClick(event) {
|
|
4543
|
+
event.stopPropagation();
|
|
4544
|
+
if (!this.disabled) {
|
|
4545
|
+
this.trailingIconClick.emit(event);
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
validateField() {
|
|
4549
|
+
this.hasError = false;
|
|
4550
|
+
this.internalErrorMessage = '';
|
|
4551
|
+
if (this.disabled || this.readonly) {
|
|
4552
|
+
return;
|
|
4553
|
+
}
|
|
4554
|
+
const value = this.value || '';
|
|
4555
|
+
// Required validation
|
|
4556
|
+
if (this.required && !value.trim()) {
|
|
4557
|
+
this.hasError = true;
|
|
4558
|
+
this.internalErrorMessage = 'Este campo es requerido';
|
|
4559
|
+
return;
|
|
4560
|
+
}
|
|
4561
|
+
// Skip other validations if field is empty and not required
|
|
4562
|
+
if (!value.trim()) {
|
|
4563
|
+
return;
|
|
4564
|
+
}
|
|
4565
|
+
// Min length validation
|
|
4566
|
+
if (this.minLength && value.length < this.minLength) {
|
|
4567
|
+
this.hasError = true;
|
|
4568
|
+
this.internalErrorMessage = `Mínimo ${this.minLength} caracteres`;
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4571
|
+
// Max length validation
|
|
4572
|
+
if (this.maxLength && value.length > this.maxLength) {
|
|
4573
|
+
this.hasError = true;
|
|
4574
|
+
this.internalErrorMessage = `Máximo ${this.maxLength} caracteres`;
|
|
4575
|
+
return;
|
|
4576
|
+
}
|
|
4577
|
+
// Pattern validation
|
|
4578
|
+
if (this.pattern) {
|
|
4579
|
+
try {
|
|
4580
|
+
const regex = new RegExp(this.pattern);
|
|
4581
|
+
if (!regex.test(value)) {
|
|
4582
|
+
this.hasError = true;
|
|
4583
|
+
this.internalErrorMessage = 'El formato no es válido';
|
|
4584
|
+
return;
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
catch (e) {
|
|
4588
|
+
console.warn('Invalid pattern:', this.pattern);
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
// Type-specific validation
|
|
4592
|
+
if (this.type === 'email' && value) {
|
|
4593
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
4594
|
+
if (!emailRegex.test(value)) {
|
|
4595
|
+
this.hasError = true;
|
|
4596
|
+
this.internalErrorMessage = 'Ingresa un email válido';
|
|
4597
|
+
return;
|
|
4598
|
+
}
|
|
4599
|
+
}
|
|
4600
|
+
if (this.type === 'url' && value) {
|
|
4601
|
+
try {
|
|
4602
|
+
new URL(value);
|
|
4603
|
+
}
|
|
4604
|
+
catch {
|
|
4605
|
+
this.hasError = true;
|
|
4606
|
+
this.internalErrorMessage = 'Ingresa una URL válida';
|
|
4607
|
+
return;
|
|
4608
|
+
}
|
|
4609
|
+
}
|
|
4610
|
+
// Custom validator
|
|
4611
|
+
if (this.customValidator) {
|
|
4612
|
+
const customError = this.customValidator(value);
|
|
4613
|
+
if (customError) {
|
|
4614
|
+
this.hasError = true;
|
|
4615
|
+
this.internalErrorMessage = customError;
|
|
4616
|
+
return;
|
|
4617
|
+
}
|
|
4618
|
+
}
|
|
4619
|
+
}
|
|
4620
|
+
get displayError() {
|
|
4621
|
+
return this.hasError && (!!this.errorMessage || !!this.internalErrorMessage);
|
|
4622
|
+
}
|
|
4623
|
+
get displayErrorMessage() {
|
|
4624
|
+
return this.errorMessage || this.internalErrorMessage;
|
|
4625
|
+
}
|
|
4626
|
+
get characterCount() {
|
|
4627
|
+
return this.value?.length || 0;
|
|
4628
|
+
}
|
|
4629
|
+
get formFieldClasses() {
|
|
4630
|
+
return [
|
|
4631
|
+
'sefin-form-field',
|
|
4632
|
+
`sefin-form-field--${this.variant}`,
|
|
4633
|
+
`sefin-form-field--${this.size}`,
|
|
4634
|
+
this.isFocused ? 'sefin-form-field--focused' : '',
|
|
4635
|
+
this.hasError ? 'sefin-form-field--error' : '',
|
|
4636
|
+
this.disabled ? 'sefin-form-field--disabled' : '',
|
|
4637
|
+
this.readonly ? 'sefin-form-field--readonly' : '',
|
|
4638
|
+
this.leadingIcon ? 'sefin-form-field--with-leading-icon' : '',
|
|
4639
|
+
this.trailingIcon ? 'sefin-form-field--with-trailing-icon' : '',
|
|
4640
|
+
this.required ? 'sefin-form-field--required' : '',
|
|
4641
|
+
this.class,
|
|
4642
|
+
]
|
|
4643
|
+
.filter(Boolean)
|
|
4644
|
+
.join(' ');
|
|
4645
|
+
}
|
|
4646
|
+
// ControlValueAccessor implementation
|
|
4647
|
+
writeValue(value) {
|
|
4648
|
+
const newValue = value || '';
|
|
4649
|
+
if (this.value !== newValue) {
|
|
4650
|
+
this.value = newValue;
|
|
4651
|
+
if (this.inputRef?.nativeElement) {
|
|
4652
|
+
this.inputRef.nativeElement.value = this.value;
|
|
4653
|
+
}
|
|
4654
|
+
this.validateField();
|
|
4655
|
+
this.cdr.markForCheck();
|
|
4656
|
+
this.cdr.detectChanges();
|
|
4657
|
+
}
|
|
4658
|
+
else if (this.inputRef?.nativeElement && this.inputRef.nativeElement.value !== newValue) {
|
|
4659
|
+
// Asegurar que el input esté sincronizado incluso si el valor del componente no cambió
|
|
4660
|
+
this.inputRef.nativeElement.value = newValue;
|
|
4661
|
+
this.cdr.markForCheck();
|
|
4662
|
+
}
|
|
4663
|
+
}
|
|
4664
|
+
registerOnChange(fn) {
|
|
4665
|
+
this.onChange = fn;
|
|
4666
|
+
}
|
|
4667
|
+
registerOnTouched(fn) {
|
|
4668
|
+
this.onTouched = fn;
|
|
4669
|
+
}
|
|
4670
|
+
setDisabledState(isDisabled) {
|
|
4671
|
+
this.disabled = isDisabled;
|
|
4672
|
+
}
|
|
4673
|
+
// Validator implementation
|
|
4674
|
+
validate(control) {
|
|
4675
|
+
this.control = control;
|
|
4676
|
+
const value = control.value || '';
|
|
4677
|
+
if (this.disabled || this.readonly) {
|
|
4678
|
+
return null;
|
|
4679
|
+
}
|
|
4680
|
+
// Required validation
|
|
4681
|
+
if (this.required && !value.trim()) {
|
|
4682
|
+
return { required: true };
|
|
4683
|
+
}
|
|
4684
|
+
// Skip other validations if field is empty and not required
|
|
4685
|
+
if (!value.trim()) {
|
|
4686
|
+
return null;
|
|
4687
|
+
}
|
|
4688
|
+
const errors = {};
|
|
4689
|
+
// Min length validation
|
|
4690
|
+
if (this.minLength && value.length < this.minLength) {
|
|
4691
|
+
errors['minlength'] = {
|
|
4692
|
+
requiredLength: this.minLength,
|
|
4693
|
+
actualLength: value.length,
|
|
4694
|
+
};
|
|
4695
|
+
}
|
|
4696
|
+
// Max length validation
|
|
4697
|
+
if (this.maxLength && value.length > this.maxLength) {
|
|
4698
|
+
errors['maxlength'] = {
|
|
4699
|
+
requiredLength: this.maxLength,
|
|
4700
|
+
actualLength: value.length,
|
|
4701
|
+
};
|
|
4702
|
+
}
|
|
4703
|
+
// Pattern validation
|
|
4704
|
+
if (this.pattern) {
|
|
4705
|
+
try {
|
|
4706
|
+
const regex = new RegExp(this.pattern);
|
|
4707
|
+
if (!regex.test(value)) {
|
|
4708
|
+
errors['pattern'] = {
|
|
4709
|
+
requiredPattern: this.pattern,
|
|
4710
|
+
actualValue: value,
|
|
4711
|
+
};
|
|
4712
|
+
}
|
|
4713
|
+
}
|
|
4714
|
+
catch (e) {
|
|
4715
|
+
console.warn('Invalid pattern:', this.pattern);
|
|
4716
|
+
}
|
|
4717
|
+
}
|
|
4718
|
+
// Type-specific validation
|
|
4719
|
+
if (this.type === 'email' && value) {
|
|
4720
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
4721
|
+
if (!emailRegex.test(value)) {
|
|
4722
|
+
errors['email'] = true;
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4725
|
+
if (this.type === 'url' && value) {
|
|
4726
|
+
try {
|
|
4727
|
+
new URL(value);
|
|
4728
|
+
}
|
|
4729
|
+
catch {
|
|
4730
|
+
errors['url'] = true;
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4733
|
+
// Custom validator
|
|
4734
|
+
if (this.customValidator) {
|
|
4735
|
+
const customError = this.customValidator(value);
|
|
4736
|
+
if (customError) {
|
|
4737
|
+
errors['custom'] = { message: customError };
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
return Object.keys(errors).length > 0 ? errors : null;
|
|
4741
|
+
}
|
|
4742
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4743
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: FormFieldComponent, isStandalone: true, selector: "sefin-form-field", inputs: { label: "label", variant: "variant", size: "size", type: "type", placeholder: "placeholder", hint: "hint", errorMessage: "errorMessage", required: "required", disabled: "disabled", readonly: "readonly", maxLength: "maxLength", minLength: "minLength", pattern: "pattern", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", showCounter: "showCounter", autocomplete: "autocomplete", name: "name", id: "id", class: "class", customValidator: "customValidator" }, outputs: { valueChange: "valueChange", focused: "focused", blurred: "blurred", trailingIconClick: "trailingIconClick" }, providers: [
|
|
4744
|
+
{
|
|
4745
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4746
|
+
useExisting: forwardRef(() => FormFieldComponent),
|
|
4747
|
+
multi: true,
|
|
4748
|
+
},
|
|
4749
|
+
{
|
|
4750
|
+
provide: NG_VALIDATORS,
|
|
4751
|
+
useExisting: forwardRef(() => FormFieldComponent),
|
|
4752
|
+
multi: true,
|
|
4753
|
+
},
|
|
4754
|
+
], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }], ngImport: i0, template: "<div [class]=\"formFieldClasses\">\n <!-- Label -->\n <label\n *ngIf=\"label\"\n [id]=\"labelId\"\n [for]=\"inputId\"\n class=\"sefin-form-field__label\"\n [class.sefin-form-field__label--required]=\"required\"\n >\n {{ label }}\n </label>\n\n <!-- Input Container -->\n <div class=\"sefin-form-field__input-container\">\n <!-- Leading Icon -->\n <div *ngIf=\"leadingIcon\" class=\"sefin-form-field__leading-icon\">\n <sefin-icon\n [name]=\"leadingIcon\"\n [size]=\"size === 'sm' ? 'sm' : 'md'\"\n ></sefin-icon>\n </div>\n\n <!-- Input Wrapper -->\n <div class=\"sefin-form-field__input-wrapper\">\n <!-- Input -->\n <input\n #inputRef\n [id]=\"inputId\"\n [name]=\"name\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.maxlength]=\"maxLength\"\n [attr.minlength]=\"minLength\"\n [pattern]=\"pattern\"\n [autocomplete]=\"autocomplete\"\n [attr.aria-label]=\"label || placeholder\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"hasError\"\n [attr.aria-describedby]=\"\n displayError || hint || showCounter ? hintId : null\n \"\n [attr.aria-labelledby]=\"label ? labelId : null\"\n [attr.data-form-type]=\"type === 'password' ? 'password' : null\"\n class=\"sefin-form-field__input\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n </div>\n\n <!-- Trailing Icon -->\n <div\n *ngIf=\"trailingIcon\"\n class=\"sefin-form-field__trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n [attr.aria-label]=\"'Trailing icon'\"\n role=\"button\"\n tabindex=\"0\"\n >\n <sefin-icon\n [name]=\"trailingIcon\"\n [size]=\"size === 'sm' ? 'sm' : 'md'\"\n ></sefin-icon>\n </div>\n\n <!-- Outline/Filled border -->\n <div class=\"sefin-form-field__border\"></div>\n </div>\n\n <!-- Helper Text / Error Message -->\n <div\n *ngIf=\"displayError || hint || showCounter\"\n [id]=\"hintId\"\n class=\"sefin-form-field__helper\"\n [class.sefin-form-field__helper--error]=\"displayError\"\n >\n <span *ngIf=\"displayError\" class=\"sefin-form-field__error-message\">\n {{ displayErrorMessage }}\n </span>\n <span *ngIf=\"!displayError && hint\" class=\"sefin-form-field__hint\">\n {{ hint }}\n </span>\n <span\n *ngIf=\"showCounter && !displayError\"\n class=\"sefin-form-field__counter\"\n [class.sefin-form-field__counter--warning]=\"\n maxLength && characterCount > maxLength * 0.8\n \"\n >\n {{ characterCount }}{{ maxLength ? \" / \" + maxLength : \"\" }}\n </span>\n </div>\n</div>\n", styles: [".sefin-form-field{position:relative;display:flex;flex-direction:column;width:100%;font-family:var(--sefin-font-family-base, sans-serif)}.sefin-form-field__input-container{position:relative;display:flex;align-items:center;width:100%;min-height:56px;overflow:visible;z-index:0}.sefin-form-field__input-wrapper{position:relative;flex:1;display:flex;align-items:center;height:100%;min-height:0;overflow:visible;z-index:1}.sefin-form-field__label{display:block;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-sm, 14px);font-weight:var(--sefin-font-weight-medium, 500);line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #1a1a1a);margin-bottom:var(--sefin-spacing-xs, 4px);cursor:pointer}.sefin-form-field__label--required:after{content:\" *\";color:var(--sefin-color-error, #f44336);margin-left:2px}.sefin-form-field__input{width:100%;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-base, 16px);font-weight:var(--sefin-font-weight-normal, 400);line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #1a1a1a);background-color:transparent;border:none;outline:none;padding:0;margin:0;box-sizing:border-box;line-height:1.5;position:relative;z-index:1}.sefin-form-field__input::placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1;transition:opacity .2s ease-in-out}.sefin-form-field__input::-webkit-input-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input::-moz-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input:-ms-input-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input:disabled,.sefin-form-field__input:read-only{cursor:not-allowed;color:var(--sefin-color-text-disabled, #999)}.sefin-form-field__input[type=password]::-webkit-credentials-auto-fill-button,.sefin-form-field__input[data-password-field=true]::-webkit-credentials-auto-fill-button{display:none!important;visibility:hidden!important;pointer-events:none!important;position:absolute!important;right:0!important;width:0!important;height:0!important;opacity:0!important;margin:0!important;padding:0!important}.sefin-form-field__input[type=password]::-ms-reveal,.sefin-form-field__input[type=password]::-ms-clear,.sefin-form-field__input[data-password-field=true]::-ms-reveal,.sefin-form-field__input[data-password-field=true]::-ms-clear{display:none!important;visibility:hidden!important;width:0!important;height:0!important;opacity:0!important;margin:0!important;padding:0!important}.sefin-form-field__input[type=password]::-moz-focus-inner,.sefin-form-field__input[data-password-field=true]::-moz-focus-inner{border:0;padding:0}.sefin-form-field__border{position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--sefin-color-border, #e0e0e0);transition:background-color .2s ease-in-out,height .2s ease-in-out;pointer-events:none;z-index:0}.sefin-form-field__leading-icon{display:flex;align-items:center;justify-content:center;padding-left:var(--sefin-spacing-md, 16px);color:var(--sefin-color-text-secondary, #666);flex-shrink:0;z-index:1;height:100%}.sefin-form-field__trailing-icon{display:flex;align-items:center;justify-content:center;padding-right:var(--sefin-spacing-md, 16px);color:var(--sefin-color-text-secondary, #666);cursor:pointer;flex-shrink:0;transition:color .2s ease-in-out;border-radius:var(--sefin-border-radius-sm, 4px);margin:var(--sefin-spacing-xs, 4px);z-index:1;height:100%;background-color:transparent}.sefin-form-field__trailing-icon:hover:not(:disabled){color:var(--sefin-color-text, #1a1a1a);background-color:transparent}.sefin-form-field__trailing-icon:active:not(:disabled){color:var(--sefin-color-text, #1a1a1a);background-color:transparent}.sefin-form-field__trailing-icon:focus-visible{outline:2px solid var(--sefin-color-primary, #1976d2);outline-offset:2px;background-color:transparent}.sefin-form-field__helper{display:flex;align-items:center;justify-content:space-between;margin-top:var(--sefin-spacing-xs, 4px);min-height:20px;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-xs, 12px);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-form-field__hint{color:var(--sefin-color-text-secondary, #666)}.sefin-form-field__error-message{color:var(--sefin-color-error, #f44336);display:flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-form-field__counter{color:var(--sefin-color-text-secondary, #666);margin-left:auto}.sefin-form-field__counter--warning{color:var(--sefin-color-warning, #ff9800)}.sefin-form-field--outlined .sefin-form-field__input-container{border:.5px solid var(--sefin-color-border, #e0e0e0);border-radius:var(--sefin-border-radius-md, 8px);background-color:var(--sefin-color-surface, #ffffff);transition:border-color .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0;margin:0}.sefin-form-field--outlined.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px)}.sefin-form-field--outlined.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:0}.sefin-form-field--outlined .sefin-form-field__border{display:none}.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__input-container{border-color:var(--sefin-color-primary, #1976d2);border-width:.5px;box-shadow:0 0 0 1px var(--sefin-color-primary-light, rgba(25, 118, 210, .1))}.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__input-container{border-color:var(--sefin-color-error, #f44336);border-width:.5px}.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--outlined.sefin-form-field--disabled .sefin-form-field__input-container{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--filled .sefin-form-field__input-container{border:none;border-bottom:.5px solid var(--sefin-color-border, #e0e0e0);border-radius:var(--sefin-border-radius-md, 8px) var(--sefin-border-radius-md, 8px) 0 0;background-color:var(--sefin-color-surface-hover, #f5f5f5);transition:background-color .2s ease-in-out,border-color .2s ease-in-out}.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0;margin:0}.sefin-form-field--filled.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px)}.sefin-form-field--filled.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:0}.sefin-form-field--filled .sefin-form-field__border{display:none}.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__input-container{background-color:var(--sefin-color-surface, #ffffff);border-bottom-color:var(--sefin-color-primary, #1976d2);border-bottom-width:.5px}.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__input-container{border-bottom-color:var(--sefin-color-error, #f44336);border-bottom-width:.5px}.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--filled.sefin-form-field--disabled .sefin-form-field__input-container{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-bottom-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--standard .sefin-form-field__input-container{border:none;background-color:transparent;transition:border-color .2s ease-in-out}.sefin-form-field--standard .sefin-form-field__input-wrapper{padding-left:0;padding-right:0}.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0 var(--sefin-spacing-sm, 8px) 0;margin:0}.sefin-form-field--standard.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper,.sefin-form-field--standard.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:var(--sefin-spacing-md, 16px)}.sefin-form-field--standard .sefin-form-field__border{height:1px}.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__border{height:1px;background-color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__border{height:1px;background-color:var(--sefin-color-error, #f44336)}.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--standard.sefin-form-field--disabled .sefin-form-field__input-container{border-bottom-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--sm .sefin-form-field__input-container{min-height:40px}.sefin-form-field--sm .sefin-form-field__input,.sefin-form-field--sm .sefin-form-field__label{font-size:var(--sefin-font-size-sm, 14px)}.sefin-form-field--sm.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-form-field--sm.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--sm.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-form-field--sm.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--sm.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0 var(--sefin-spacing-xs, 4px) 0}.sefin-form-field--md .sefin-form-field__input-container{min-height:56px}.sefin-form-field--lg .sefin-form-field__input-container{min-height:64px}.sefin-form-field--lg .sefin-form-field__input,.sefin-form-field--lg .sefin-form-field__label{font-size:var(--sefin-font-size-lg, 18px)}.sefin-form-field--lg.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--lg.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0}.sefin-form-field--lg.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--lg.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0}.sefin-form-field--lg.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0 var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--disabled{cursor:not-allowed;opacity:.6}.sefin-form-field--disabled .sefin-form-field__label{cursor:not-allowed;color:var(--sefin-color-text-disabled, #999)}.sefin-form-field--readonly .sefin-form-field__input{cursor:default}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: IconComponent, selector: "sefin-icon", inputs: ["name", "size", "color", "rotate", "flipH", "flipV", "class"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
4755
|
+
}
|
|
4756
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: FormFieldComponent, decorators: [{
|
|
4757
|
+
type: Component,
|
|
4758
|
+
args: [{ selector: 'sefin-form-field', standalone: true, imports: [CommonModule, FormsModule, IconComponent], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
4759
|
+
{
|
|
4760
|
+
provide: NG_VALUE_ACCESSOR,
|
|
4761
|
+
useExisting: forwardRef(() => FormFieldComponent),
|
|
4762
|
+
multi: true,
|
|
4763
|
+
},
|
|
4764
|
+
{
|
|
4765
|
+
provide: NG_VALIDATORS,
|
|
4766
|
+
useExisting: forwardRef(() => FormFieldComponent),
|
|
4767
|
+
multi: true,
|
|
4768
|
+
},
|
|
4769
|
+
], template: "<div [class]=\"formFieldClasses\">\n <!-- Label -->\n <label\n *ngIf=\"label\"\n [id]=\"labelId\"\n [for]=\"inputId\"\n class=\"sefin-form-field__label\"\n [class.sefin-form-field__label--required]=\"required\"\n >\n {{ label }}\n </label>\n\n <!-- Input Container -->\n <div class=\"sefin-form-field__input-container\">\n <!-- Leading Icon -->\n <div *ngIf=\"leadingIcon\" class=\"sefin-form-field__leading-icon\">\n <sefin-icon\n [name]=\"leadingIcon\"\n [size]=\"size === 'sm' ? 'sm' : 'md'\"\n ></sefin-icon>\n </div>\n\n <!-- Input Wrapper -->\n <div class=\"sefin-form-field__input-wrapper\">\n <!-- Input -->\n <input\n #inputRef\n [id]=\"inputId\"\n [name]=\"name\"\n [type]=\"type\"\n [value]=\"value\"\n [placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.maxlength]=\"maxLength\"\n [attr.minlength]=\"minLength\"\n [pattern]=\"pattern\"\n [autocomplete]=\"autocomplete\"\n [attr.aria-label]=\"label || placeholder\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"hasError\"\n [attr.aria-describedby]=\"\n displayError || hint || showCounter ? hintId : null\n \"\n [attr.aria-labelledby]=\"label ? labelId : null\"\n [attr.data-form-type]=\"type === 'password' ? 'password' : null\"\n class=\"sefin-form-field__input\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n </div>\n\n <!-- Trailing Icon -->\n <div\n *ngIf=\"trailingIcon\"\n class=\"sefin-form-field__trailing-icon\"\n (click)=\"onTrailingIconClick($event)\"\n [attr.aria-label]=\"'Trailing icon'\"\n role=\"button\"\n tabindex=\"0\"\n >\n <sefin-icon\n [name]=\"trailingIcon\"\n [size]=\"size === 'sm' ? 'sm' : 'md'\"\n ></sefin-icon>\n </div>\n\n <!-- Outline/Filled border -->\n <div class=\"sefin-form-field__border\"></div>\n </div>\n\n <!-- Helper Text / Error Message -->\n <div\n *ngIf=\"displayError || hint || showCounter\"\n [id]=\"hintId\"\n class=\"sefin-form-field__helper\"\n [class.sefin-form-field__helper--error]=\"displayError\"\n >\n <span *ngIf=\"displayError\" class=\"sefin-form-field__error-message\">\n {{ displayErrorMessage }}\n </span>\n <span *ngIf=\"!displayError && hint\" class=\"sefin-form-field__hint\">\n {{ hint }}\n </span>\n <span\n *ngIf=\"showCounter && !displayError\"\n class=\"sefin-form-field__counter\"\n [class.sefin-form-field__counter--warning]=\"\n maxLength && characterCount > maxLength * 0.8\n \"\n >\n {{ characterCount }}{{ maxLength ? \" / \" + maxLength : \"\" }}\n </span>\n </div>\n</div>\n", styles: [".sefin-form-field{position:relative;display:flex;flex-direction:column;width:100%;font-family:var(--sefin-font-family-base, sans-serif)}.sefin-form-field__input-container{position:relative;display:flex;align-items:center;width:100%;min-height:56px;overflow:visible;z-index:0}.sefin-form-field__input-wrapper{position:relative;flex:1;display:flex;align-items:center;height:100%;min-height:0;overflow:visible;z-index:1}.sefin-form-field__label{display:block;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-sm, 14px);font-weight:var(--sefin-font-weight-medium, 500);line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #1a1a1a);margin-bottom:var(--sefin-spacing-xs, 4px);cursor:pointer}.sefin-form-field__label--required:after{content:\" *\";color:var(--sefin-color-error, #f44336);margin-left:2px}.sefin-form-field__input{width:100%;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-base, 16px);font-weight:var(--sefin-font-weight-normal, 400);line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #1a1a1a);background-color:transparent;border:none;outline:none;padding:0;margin:0;box-sizing:border-box;line-height:1.5;position:relative;z-index:1}.sefin-form-field__input::placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1;transition:opacity .2s ease-in-out}.sefin-form-field__input::-webkit-input-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input::-moz-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input:-ms-input-placeholder{color:var(--sefin-color-text-secondary, #999);opacity:1}.sefin-form-field__input:disabled,.sefin-form-field__input:read-only{cursor:not-allowed;color:var(--sefin-color-text-disabled, #999)}.sefin-form-field__input[type=password]::-webkit-credentials-auto-fill-button,.sefin-form-field__input[data-password-field=true]::-webkit-credentials-auto-fill-button{display:none!important;visibility:hidden!important;pointer-events:none!important;position:absolute!important;right:0!important;width:0!important;height:0!important;opacity:0!important;margin:0!important;padding:0!important}.sefin-form-field__input[type=password]::-ms-reveal,.sefin-form-field__input[type=password]::-ms-clear,.sefin-form-field__input[data-password-field=true]::-ms-reveal,.sefin-form-field__input[data-password-field=true]::-ms-clear{display:none!important;visibility:hidden!important;width:0!important;height:0!important;opacity:0!important;margin:0!important;padding:0!important}.sefin-form-field__input[type=password]::-moz-focus-inner,.sefin-form-field__input[data-password-field=true]::-moz-focus-inner{border:0;padding:0}.sefin-form-field__border{position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--sefin-color-border, #e0e0e0);transition:background-color .2s ease-in-out,height .2s ease-in-out;pointer-events:none;z-index:0}.sefin-form-field__leading-icon{display:flex;align-items:center;justify-content:center;padding-left:var(--sefin-spacing-md, 16px);color:var(--sefin-color-text-secondary, #666);flex-shrink:0;z-index:1;height:100%}.sefin-form-field__trailing-icon{display:flex;align-items:center;justify-content:center;padding-right:var(--sefin-spacing-md, 16px);color:var(--sefin-color-text-secondary, #666);cursor:pointer;flex-shrink:0;transition:color .2s ease-in-out;border-radius:var(--sefin-border-radius-sm, 4px);margin:var(--sefin-spacing-xs, 4px);z-index:1;height:100%;background-color:transparent}.sefin-form-field__trailing-icon:hover:not(:disabled){color:var(--sefin-color-text, #1a1a1a);background-color:transparent}.sefin-form-field__trailing-icon:active:not(:disabled){color:var(--sefin-color-text, #1a1a1a);background-color:transparent}.sefin-form-field__trailing-icon:focus-visible{outline:2px solid var(--sefin-color-primary, #1976d2);outline-offset:2px;background-color:transparent}.sefin-form-field__helper{display:flex;align-items:center;justify-content:space-between;margin-top:var(--sefin-spacing-xs, 4px);min-height:20px;font-family:var(--sefin-font-family-base, sans-serif);font-size:var(--sefin-font-size-xs, 12px);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-form-field__hint{color:var(--sefin-color-text-secondary, #666)}.sefin-form-field__error-message{color:var(--sefin-color-error, #f44336);display:flex;align-items:center;gap:var(--sefin-spacing-xs, 4px)}.sefin-form-field__counter{color:var(--sefin-color-text-secondary, #666);margin-left:auto}.sefin-form-field__counter--warning{color:var(--sefin-color-warning, #ff9800)}.sefin-form-field--outlined .sefin-form-field__input-container{border:.5px solid var(--sefin-color-border, #e0e0e0);border-radius:var(--sefin-border-radius-md, 8px);background-color:var(--sefin-color-surface, #ffffff);transition:border-color .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0;margin:0}.sefin-form-field--outlined.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px)}.sefin-form-field--outlined.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:0}.sefin-form-field--outlined .sefin-form-field__border{display:none}.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__input-container{border-color:var(--sefin-color-primary, #1976d2);border-width:.5px;box-shadow:0 0 0 1px var(--sefin-color-primary-light, rgba(25, 118, 210, .1))}.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--outlined.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__input-container{border-color:var(--sefin-color-error, #f44336);border-width:.5px}.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--outlined.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--outlined.sefin-form-field--disabled .sefin-form-field__input-container{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--filled .sefin-form-field__input-container{border:none;border-bottom:.5px solid var(--sefin-color-border, #e0e0e0);border-radius:var(--sefin-border-radius-md, 8px) var(--sefin-border-radius-md, 8px) 0 0;background-color:var(--sefin-color-surface-hover, #f5f5f5);transition:background-color .2s ease-in-out,border-color .2s ease-in-out}.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0;margin:0}.sefin-form-field--filled.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px)}.sefin-form-field--filled.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:0}.sefin-form-field--filled .sefin-form-field__border{display:none}.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__input-container{background-color:var(--sefin-color-surface, #ffffff);border-bottom-color:var(--sefin-color-primary, #1976d2);border-bottom-width:.5px}.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--filled.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__input-container{border-bottom-color:var(--sefin-color-error, #f44336);border-bottom-width:.5px}.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--filled.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--filled.sefin-form-field--disabled .sefin-form-field__input-container{background-color:var(--sefin-color-surface-hover, #f5f5f5);border-bottom-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--standard .sefin-form-field__input-container{border:none;background-color:transparent;transition:border-color .2s ease-in-out}.sefin-form-field--standard .sefin-form-field__input-wrapper{padding-left:0;padding-right:0}.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0 var(--sefin-spacing-sm, 8px) 0;margin:0}.sefin-form-field--standard.sefin-form-field--with-leading-icon .sefin-form-field__input-wrapper,.sefin-form-field--standard.sefin-form-field--with-leading-icon .sefin-form-field__input{padding-left:var(--sefin-spacing-md, 16px)}.sefin-form-field--standard .sefin-form-field__border{height:1px}.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__border{height:1px;background-color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__border{height:1px;background-color:var(--sefin-color-error, #f44336)}.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__label,.sefin-form-field--standard.sefin-form-field--focused .sefin-form-field__leading-icon{color:var(--sefin-color-primary, #1976d2)}.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__label,.sefin-form-field--standard.sefin-form-field--error .sefin-form-field__leading-icon{color:var(--sefin-color-error, #f44336)}.sefin-form-field--standard.sefin-form-field--disabled .sefin-form-field__input-container{border-bottom-color:var(--sefin-color-border, #e0e0e0);opacity:.6}.sefin-form-field--sm .sefin-form-field__input-container{min-height:40px}.sefin-form-field--sm .sefin-form-field__input,.sefin-form-field--sm .sefin-form-field__label{font-size:var(--sefin-font-size-sm, 14px)}.sefin-form-field--sm.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-form-field--sm.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--sm.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-form-field--sm.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--sm.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-sm, 8px) 0 var(--sefin-spacing-xs, 4px) 0}.sefin-form-field--md .sefin-form-field__input-container{min-height:56px}.sefin-form-field--lg .sefin-form-field__input-container{min-height:64px}.sefin-form-field--lg .sefin-form-field__input,.sefin-form-field--lg .sefin-form-field__label{font-size:var(--sefin-font-size-lg, 18px)}.sefin-form-field--lg.sefin-form-field--outlined .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--lg.sefin-form-field--outlined .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0}.sefin-form-field--lg.sefin-form-field--filled .sefin-form-field__input-wrapper{padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-md, 16px)}.sefin-form-field--lg.sefin-form-field--filled .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0}.sefin-form-field--lg.sefin-form-field--standard .sefin-form-field__input{padding:var(--sefin-spacing-md, 16px) 0 var(--sefin-spacing-sm, 8px) 0}.sefin-form-field--disabled{cursor:not-allowed;opacity:.6}.sefin-form-field--disabled .sefin-form-field__label{cursor:not-allowed;color:var(--sefin-color-text-disabled, #999)}.sefin-form-field--readonly .sefin-form-field__input{cursor:default}\n"] }]
|
|
4770
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { inputRef: [{
|
|
4771
|
+
type: ViewChild,
|
|
4772
|
+
args: ['inputRef', { static: false }]
|
|
4773
|
+
}], label: [{
|
|
4774
|
+
type: Input
|
|
4775
|
+
}], variant: [{
|
|
4776
|
+
type: Input
|
|
4777
|
+
}], size: [{
|
|
4778
|
+
type: Input
|
|
4779
|
+
}], type: [{
|
|
4780
|
+
type: Input
|
|
4781
|
+
}], placeholder: [{
|
|
4782
|
+
type: Input
|
|
4783
|
+
}], hint: [{
|
|
4784
|
+
type: Input
|
|
4785
|
+
}], errorMessage: [{
|
|
4786
|
+
type: Input
|
|
4787
|
+
}], required: [{
|
|
4788
|
+
type: Input
|
|
4789
|
+
}], disabled: [{
|
|
4790
|
+
type: Input
|
|
4791
|
+
}], readonly: [{
|
|
4792
|
+
type: Input
|
|
4793
|
+
}], maxLength: [{
|
|
4794
|
+
type: Input
|
|
4795
|
+
}], minLength: [{
|
|
4796
|
+
type: Input
|
|
4797
|
+
}], pattern: [{
|
|
4798
|
+
type: Input
|
|
4799
|
+
}], leadingIcon: [{
|
|
4800
|
+
type: Input
|
|
4801
|
+
}], trailingIcon: [{
|
|
4802
|
+
type: Input
|
|
4803
|
+
}], showCounter: [{
|
|
4804
|
+
type: Input
|
|
4805
|
+
}], autocomplete: [{
|
|
4806
|
+
type: Input
|
|
4807
|
+
}], name: [{
|
|
4808
|
+
type: Input
|
|
4809
|
+
}], id: [{
|
|
4810
|
+
type: Input
|
|
4811
|
+
}], class: [{
|
|
4812
|
+
type: Input
|
|
4813
|
+
}], customValidator: [{
|
|
4814
|
+
type: Input
|
|
4815
|
+
}], valueChange: [{
|
|
4816
|
+
type: Output
|
|
4817
|
+
}], focused: [{
|
|
4818
|
+
type: Output
|
|
4819
|
+
}], blurred: [{
|
|
4820
|
+
type: Output
|
|
4821
|
+
}], trailingIconClick: [{
|
|
4822
|
+
type: Output
|
|
4823
|
+
}] } });
|
|
4824
|
+
|
|
4825
|
+
class PaginationComponent {
|
|
4826
|
+
/** Current page (1-based) */
|
|
4827
|
+
set currentPage(value) {
|
|
4828
|
+
this._currentPage.set(Math.max(1, value));
|
|
4829
|
+
}
|
|
4830
|
+
get currentPage() {
|
|
4831
|
+
return this._currentPage();
|
|
4832
|
+
}
|
|
4833
|
+
_currentPage = signal(1, ...(ngDevMode ? [{ debugName: "_currentPage" }] : []));
|
|
4834
|
+
/** Total number of pages */
|
|
4835
|
+
set totalPages(value) {
|
|
4836
|
+
this._totalPages.set(Math.max(1, value));
|
|
4837
|
+
}
|
|
4838
|
+
get totalPages() {
|
|
4839
|
+
return this._totalPages();
|
|
4840
|
+
}
|
|
4841
|
+
_totalPages = signal(1, ...(ngDevMode ? [{ debugName: "_totalPages" }] : []));
|
|
4842
|
+
/** Total number of items (alternative to totalPages) */
|
|
4843
|
+
set totalItems(value) {
|
|
4844
|
+
if (value !== undefined) {
|
|
4845
|
+
this._totalItems.set(value);
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4848
|
+
get totalItems() {
|
|
4849
|
+
return this._totalItems();
|
|
4850
|
+
}
|
|
4851
|
+
_totalItems = signal(undefined, ...(ngDevMode ? [{ debugName: "_totalItems" }] : []));
|
|
4852
|
+
/** Items per page (used when totalItems is provided) */
|
|
4853
|
+
itemsPerPage = 10;
|
|
4854
|
+
/** Number of page buttons to show on each side of current page */
|
|
4855
|
+
siblingCount = 1;
|
|
4856
|
+
/** Show first and last page buttons */
|
|
4857
|
+
showFirstLast = true;
|
|
4858
|
+
/** Show previous and next buttons */
|
|
4859
|
+
showPrevNext = true;
|
|
4860
|
+
/** Pagination size. Options: 'sm' | 'md' | 'lg' */
|
|
4861
|
+
size = 'md';
|
|
4862
|
+
/** Pagination variant. Options: 'default' | 'compact' */
|
|
4863
|
+
variant = 'default';
|
|
4864
|
+
/** Additional CSS classes */
|
|
4865
|
+
class = '';
|
|
4866
|
+
/** Event emitted when page changes */
|
|
4867
|
+
pageChange = new EventEmitter();
|
|
4868
|
+
/** Computed total pages (from totalItems or direct input) */
|
|
4869
|
+
computedTotalPages = computed(() => {
|
|
4870
|
+
const total = this._totalItems();
|
|
4871
|
+
if (total !== undefined) {
|
|
4872
|
+
return Math.max(1, Math.ceil(total / this.itemsPerPage));
|
|
4873
|
+
}
|
|
4874
|
+
return this._totalPages();
|
|
4875
|
+
}, ...(ngDevMode ? [{ debugName: "computedTotalPages" }] : []));
|
|
4876
|
+
/** Computed page numbers to display */
|
|
4877
|
+
pageNumbers = computed(() => {
|
|
4878
|
+
const current = this._currentPage();
|
|
4879
|
+
const total = this.computedTotalPages();
|
|
4880
|
+
const sibling = this.siblingCount;
|
|
4881
|
+
const pages = [];
|
|
4882
|
+
// Always show first page if not already included
|
|
4883
|
+
if (this.showFirstLast && current > sibling + 2) {
|
|
4884
|
+
pages.push(1);
|
|
4885
|
+
if (current > sibling + 3) {
|
|
4886
|
+
pages.push('ellipsis-start');
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
// Calculate start and end of page range
|
|
4890
|
+
const start = Math.max(1, current - sibling);
|
|
4891
|
+
const end = Math.min(total, current + sibling);
|
|
4892
|
+
// Add page numbers in range
|
|
4893
|
+
for (let i = start; i <= end; i++) {
|
|
4894
|
+
pages.push(i);
|
|
4895
|
+
}
|
|
4896
|
+
// Always show last page if not already included
|
|
4897
|
+
if (this.showFirstLast && current < total - sibling - 1) {
|
|
4898
|
+
if (current < total - sibling - 2) {
|
|
4899
|
+
pages.push('ellipsis-end');
|
|
4900
|
+
}
|
|
4901
|
+
pages.push(total);
|
|
4902
|
+
}
|
|
4903
|
+
return pages;
|
|
4904
|
+
}, ...(ngDevMode ? [{ debugName: "pageNumbers" }] : []));
|
|
4905
|
+
get paginationClasses() {
|
|
4906
|
+
return [
|
|
4907
|
+
'sefin-pagination',
|
|
4908
|
+
`sefin-pagination--${this.size}`,
|
|
4909
|
+
`sefin-pagination--${this.variant}`,
|
|
4910
|
+
this.class,
|
|
4911
|
+
]
|
|
4912
|
+
.filter(Boolean)
|
|
4913
|
+
.join(' ');
|
|
4914
|
+
}
|
|
4915
|
+
isDisabled(direction) {
|
|
4916
|
+
if (direction === 'prev') {
|
|
4917
|
+
return this.currentPage <= 1;
|
|
4918
|
+
}
|
|
4919
|
+
return this.currentPage >= this.computedTotalPages();
|
|
4920
|
+
}
|
|
4921
|
+
goToPage(page) {
|
|
4922
|
+
if (typeof page === 'number') {
|
|
4923
|
+
const validPage = Math.max(1, Math.min(page, this.computedTotalPages()));
|
|
4924
|
+
if (validPage !== this.currentPage) {
|
|
4925
|
+
this._currentPage.set(validPage);
|
|
4926
|
+
this.pageChange.emit(validPage);
|
|
4927
|
+
}
|
|
4928
|
+
}
|
|
4929
|
+
}
|
|
4930
|
+
goToPrevious() {
|
|
4931
|
+
if (!this.isDisabled('prev')) {
|
|
4932
|
+
this.goToPage(this.currentPage - 1);
|
|
4933
|
+
}
|
|
4934
|
+
}
|
|
4935
|
+
goToNext() {
|
|
4936
|
+
if (!this.isDisabled('next')) {
|
|
4937
|
+
this.goToPage(this.currentPage + 1);
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
goToFirst() {
|
|
4941
|
+
if (this.currentPage > 1) {
|
|
4942
|
+
this.goToPage(1);
|
|
4943
|
+
}
|
|
4944
|
+
}
|
|
4945
|
+
goToLast() {
|
|
4946
|
+
const lastPage = this.computedTotalPages();
|
|
4947
|
+
if (this.currentPage < lastPage) {
|
|
4948
|
+
this.goToPage(lastPage);
|
|
4949
|
+
}
|
|
4950
|
+
}
|
|
4951
|
+
isEllipsis(item) {
|
|
4952
|
+
return item === 'ellipsis-start' || item === 'ellipsis-end';
|
|
4953
|
+
}
|
|
4954
|
+
isCurrentPage(page) {
|
|
4955
|
+
return typeof page === 'number' && page === this.currentPage;
|
|
4956
|
+
}
|
|
4957
|
+
getAriaCurrent(page) {
|
|
4958
|
+
return this.isCurrentPage(page) ? 'page' : null;
|
|
4959
|
+
}
|
|
4960
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4961
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: PaginationComponent, isStandalone: true, selector: "sefin-pagination", inputs: { currentPage: "currentPage", totalPages: "totalPages", totalItems: "totalItems", itemsPerPage: "itemsPerPage", siblingCount: "siblingCount", showFirstLast: "showFirstLast", showPrevNext: "showPrevNext", size: "size", variant: "variant", class: "class" }, outputs: { pageChange: "pageChange" }, ngImport: i0, template: "<nav [class]=\"paginationClasses\" aria-label=\"Pagination Navigation\">\n <ul class=\"sefin-pagination__list\">\n <!-- First button -->\n <li *ngIf=\"showFirstLast\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"currentPage <= 1\"\n (click)=\"goToFirst()\"\n aria-label=\"Go to first page\"\n [attr.aria-disabled]=\"currentPage <= 1\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11 17L6 12L11 7M18 17L13 12L18 7\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Previous button -->\n <li *ngIf=\"showPrevNext\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"isDisabled('prev')\"\n (click)=\"goToPrevious()\"\n aria-label=\"Go to previous page\"\n [attr.aria-disabled]=\"isDisabled('prev')\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15 18L9 12L15 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Page numbers -->\n <li\n *ngFor=\"let page of pageNumbers(); let i = index\"\n class=\"sefin-pagination__item\"\n >\n <ng-container *ngIf=\"isEllipsis(page); else pageButton\">\n <span class=\"sefin-pagination__ellipsis\" aria-hidden=\"true\">...</span>\n </ng-container>\n <ng-template #pageButton>\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--page\"\n [class.sefin-pagination__button--active]=\"isCurrentPage(page)\"\n (click)=\"goToPage(page)\"\n [attr.aria-label]=\"'Go to page ' + page\"\n [attr.aria-current]=\"getAriaCurrent(page)\"\n >\n {{ page }}\n </button>\n </ng-template>\n </li>\n\n <!-- Next button -->\n <li *ngIf=\"showPrevNext\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"isDisabled('next')\"\n (click)=\"goToNext()\"\n aria-label=\"Go to next page\"\n [attr.aria-disabled]=\"isDisabled('next')\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 18L15 12L9 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Last button -->\n <li *ngIf=\"showFirstLast\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"currentPage >= computedTotalPages()\"\n (click)=\"goToLast()\"\n aria-label=\"Go to last page\"\n [attr.aria-disabled]=\"currentPage >= computedTotalPages()\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M13 17L18 12L13 7M6 17L11 12L6 7\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n </ul>\n</nav>\n", styles: [".sefin-pagination{display:inline-flex;font-family:var(--sefin-font-family-base)}.sefin-pagination__list{display:flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);list-style:none;margin:0;padding:0}.sefin-pagination__item{display:inline-flex;align-items:center}.sefin-pagination__button{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:var(--sefin-line-height-normal);border:1px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);color:var(--sefin-color-text);cursor:pointer;outline:none;transition:all .2s ease-in-out;border-radius:var(--sefin-radius-md);-webkit-user-select:none;user-select:none}.sefin-pagination__button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-pagination__button:hover:not(:disabled):not(.sefin-pagination__button--active){background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-primary);color:var(--sefin-color-primary)}.sefin-pagination__button:active:not(:disabled){transform:translateY(1px)}.sefin-pagination__button:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-pagination__button--page{min-width:40px;text-align:center}.sefin-pagination__button--active{background-color:var(--sefin-color-primary);border-color:var(--sefin-color-primary);color:#fff;font-weight:var(--sefin-font-weight-semibold)}.sefin-pagination__button--active:hover{background-color:var(--sefin-color-primary-dark);border-color:var(--sefin-color-primary-dark);color:#fff}.sefin-pagination__button--nav{padding:0}.sefin-pagination__button svg{display:block;width:16px;height:16px;flex-shrink:0}.sefin-pagination__ellipsis{display:inline-flex;align-items:center;justify-content:center;color:var(--sefin-color-text-secondary);padding:0 var(--sefin-spacing-sm, 8px);-webkit-user-select:none;user-select:none;min-width:40px}.sefin-pagination--sm .sefin-pagination__button{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-pagination--sm .sefin-pagination__button--page{min-width:32px}.sefin-pagination--sm .sefin-pagination__button svg{width:14px;height:14px}.sefin-pagination--sm .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-sm, 14px);min-width:32px}.sefin-pagination--md .sefin-pagination__button{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-pagination--md .sefin-pagination__button--page{min-width:40px}.sefin-pagination--md .sefin-pagination__button svg{width:16px;height:16px}.sefin-pagination--md .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-base, 16px);min-width:40px}.sefin-pagination--lg .sefin-pagination__button{padding:var(--sefin-spacing-md, 16px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-lg, 18px);min-height:48px}.sefin-pagination--lg .sefin-pagination__button--page{min-width:48px}.sefin-pagination--lg .sefin-pagination__button svg{width:18px;height:18px}.sefin-pagination--lg .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-lg, 18px);min-width:48px}.sefin-pagination--compact .sefin-pagination__button--page{min-width:auto;padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-pagination--compact .sefin-pagination__ellipsis{min-width:auto;padding:0 var(--sefin-spacing-xs, 4px)}\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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4962
|
+
}
|
|
4963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: PaginationComponent, decorators: [{
|
|
4964
|
+
type: Component,
|
|
4965
|
+
args: [{ selector: 'sefin-pagination', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nav [class]=\"paginationClasses\" aria-label=\"Pagination Navigation\">\n <ul class=\"sefin-pagination__list\">\n <!-- First button -->\n <li *ngIf=\"showFirstLast\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"currentPage <= 1\"\n (click)=\"goToFirst()\"\n aria-label=\"Go to first page\"\n [attr.aria-disabled]=\"currentPage <= 1\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M11 17L6 12L11 7M18 17L13 12L18 7\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Previous button -->\n <li *ngIf=\"showPrevNext\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"isDisabled('prev')\"\n (click)=\"goToPrevious()\"\n aria-label=\"Go to previous page\"\n [attr.aria-disabled]=\"isDisabled('prev')\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15 18L9 12L15 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Page numbers -->\n <li\n *ngFor=\"let page of pageNumbers(); let i = index\"\n class=\"sefin-pagination__item\"\n >\n <ng-container *ngIf=\"isEllipsis(page); else pageButton\">\n <span class=\"sefin-pagination__ellipsis\" aria-hidden=\"true\">...</span>\n </ng-container>\n <ng-template #pageButton>\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--page\"\n [class.sefin-pagination__button--active]=\"isCurrentPage(page)\"\n (click)=\"goToPage(page)\"\n [attr.aria-label]=\"'Go to page ' + page\"\n [attr.aria-current]=\"getAriaCurrent(page)\"\n >\n {{ page }}\n </button>\n </ng-template>\n </li>\n\n <!-- Next button -->\n <li *ngIf=\"showPrevNext\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"isDisabled('next')\"\n (click)=\"goToNext()\"\n aria-label=\"Go to next page\"\n [attr.aria-disabled]=\"isDisabled('next')\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 18L15 12L9 6\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n\n <!-- Last button -->\n <li *ngIf=\"showFirstLast\" class=\"sefin-pagination__item\">\n <button\n type=\"button\"\n class=\"sefin-pagination__button sefin-pagination__button--nav\"\n [disabled]=\"currentPage >= computedTotalPages()\"\n (click)=\"goToLast()\"\n aria-label=\"Go to last page\"\n [attr.aria-disabled]=\"currentPage >= computedTotalPages()\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M13 17L18 12L13 7M6 17L11 12L6 7\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </li>\n </ul>\n</nav>\n", styles: [".sefin-pagination{display:inline-flex;font-family:var(--sefin-font-family-base)}.sefin-pagination__list{display:flex;align-items:center;gap:var(--sefin-spacing-xs, 4px);list-style:none;margin:0;padding:0}.sefin-pagination__item{display:inline-flex;align-items:center}.sefin-pagination__button{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:var(--sefin-line-height-normal);border:1px solid var(--sefin-color-border);background-color:var(--sefin-color-surface);color:var(--sefin-color-text);cursor:pointer;outline:none;transition:all .2s ease-in-out;border-radius:var(--sefin-radius-md);-webkit-user-select:none;user-select:none}.sefin-pagination__button:focus-visible{outline:2px solid var(--sefin-color-border-focus);outline-offset:2px}.sefin-pagination__button:hover:not(:disabled):not(.sefin-pagination__button--active){background-color:var(--sefin-color-surface-hover);border-color:var(--sefin-color-primary);color:var(--sefin-color-primary)}.sefin-pagination__button:active:not(:disabled){transform:translateY(1px)}.sefin-pagination__button:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.sefin-pagination__button--page{min-width:40px;text-align:center}.sefin-pagination__button--active{background-color:var(--sefin-color-primary);border-color:var(--sefin-color-primary);color:#fff;font-weight:var(--sefin-font-weight-semibold)}.sefin-pagination__button--active:hover{background-color:var(--sefin-color-primary-dark);border-color:var(--sefin-color-primary-dark);color:#fff}.sefin-pagination__button--nav{padding:0}.sefin-pagination__button svg{display:block;width:16px;height:16px;flex-shrink:0}.sefin-pagination__ellipsis{display:inline-flex;align-items:center;justify-content:center;color:var(--sefin-color-text-secondary);padding:0 var(--sefin-spacing-sm, 8px);-webkit-user-select:none;user-select:none;min-width:40px}.sefin-pagination--sm .sefin-pagination__button{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, 14px);min-height:32px}.sefin-pagination--sm .sefin-pagination__button--page{min-width:32px}.sefin-pagination--sm .sefin-pagination__button svg{width:14px;height:14px}.sefin-pagination--sm .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-sm, 14px);min-width:32px}.sefin-pagination--md .sefin-pagination__button{padding:var(--sefin-spacing-sm, 8px) var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-base, 16px);min-height:40px}.sefin-pagination--md .sefin-pagination__button--page{min-width:40px}.sefin-pagination--md .sefin-pagination__button svg{width:16px;height:16px}.sefin-pagination--md .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-base, 16px);min-width:40px}.sefin-pagination--lg .sefin-pagination__button{padding:var(--sefin-spacing-md, 16px) var(--sefin-spacing-lg, 24px);font-size:var(--sefin-font-size-lg, 18px);min-height:48px}.sefin-pagination--lg .sefin-pagination__button--page{min-width:48px}.sefin-pagination--lg .sefin-pagination__button svg{width:18px;height:18px}.sefin-pagination--lg .sefin-pagination__ellipsis{font-size:var(--sefin-font-size-lg, 18px);min-width:48px}.sefin-pagination--compact .sefin-pagination__button--page{min-width:auto;padding-left:var(--sefin-spacing-sm, 8px);padding-right:var(--sefin-spacing-sm, 8px)}.sefin-pagination--compact .sefin-pagination__ellipsis{min-width:auto;padding:0 var(--sefin-spacing-xs, 4px)}\n"] }]
|
|
4966
|
+
}], propDecorators: { currentPage: [{
|
|
4967
|
+
type: Input
|
|
4968
|
+
}], totalPages: [{
|
|
4969
|
+
type: Input
|
|
4970
|
+
}], totalItems: [{
|
|
4971
|
+
type: Input
|
|
4972
|
+
}], itemsPerPage: [{
|
|
4973
|
+
type: Input
|
|
4974
|
+
}], siblingCount: [{
|
|
4975
|
+
type: Input
|
|
4976
|
+
}], showFirstLast: [{
|
|
4977
|
+
type: Input
|
|
4978
|
+
}], showPrevNext: [{
|
|
4979
|
+
type: Input
|
|
4980
|
+
}], size: [{
|
|
4981
|
+
type: Input
|
|
4982
|
+
}], variant: [{
|
|
4983
|
+
type: Input
|
|
4984
|
+
}], class: [{
|
|
4985
|
+
type: Input
|
|
4986
|
+
}], pageChange: [{
|
|
4987
|
+
type: Output
|
|
4988
|
+
}] } });
|
|
4989
|
+
|
|
4990
|
+
class TextareaComponent {
|
|
4991
|
+
textareaRef;
|
|
4992
|
+
/** Textarea variant style. Options: 'outlined' | 'filled' | 'standard' */
|
|
4993
|
+
variant = 'outlined';
|
|
4994
|
+
/** Textarea size. Options: 'sm' | 'md' | 'lg' */
|
|
4995
|
+
size = 'md';
|
|
4996
|
+
/** Placeholder text */
|
|
4997
|
+
placeholder = '';
|
|
4998
|
+
/** Helper text shown below the textarea */
|
|
4999
|
+
hint = '';
|
|
5000
|
+
/** Error message to display */
|
|
5001
|
+
errorMessage = '';
|
|
5002
|
+
/** Whether the field is required */
|
|
5003
|
+
required = false;
|
|
5004
|
+
/** Whether the field is disabled */
|
|
5005
|
+
disabled = false;
|
|
5006
|
+
/** Whether the field is readonly */
|
|
5007
|
+
readonly = false;
|
|
5008
|
+
/** Maximum length of the input */
|
|
5009
|
+
maxLength;
|
|
5010
|
+
/** Minimum length of the input */
|
|
5011
|
+
minLength;
|
|
5012
|
+
/** Pattern for validation (regex string) */
|
|
5013
|
+
pattern;
|
|
5014
|
+
/** Number of visible text lines */
|
|
5015
|
+
rows = 4;
|
|
5016
|
+
/** Number of visible text columns */
|
|
5017
|
+
cols;
|
|
5018
|
+
/** Whether to auto-resize based on content */
|
|
5019
|
+
autoResize = false;
|
|
5020
|
+
/** Minimum height when auto-resize is enabled */
|
|
5021
|
+
minHeight;
|
|
5022
|
+
/** Maximum height when auto-resize is enabled */
|
|
5023
|
+
maxHeight;
|
|
5024
|
+
/** Whether to show character counter */
|
|
5025
|
+
showCounter = false;
|
|
5026
|
+
/** Autocomplete attribute */
|
|
5027
|
+
autocomplete;
|
|
5028
|
+
/** Textarea name attribute */
|
|
5029
|
+
name = '';
|
|
5030
|
+
/** Textarea id attribute */
|
|
5031
|
+
id = '';
|
|
5032
|
+
/** Additional CSS classes */
|
|
5033
|
+
class = '';
|
|
5034
|
+
/** Custom validation function */
|
|
5035
|
+
customValidator;
|
|
5036
|
+
/** Initial value for the textarea (for non-reactive forms) */
|
|
5037
|
+
set value(val) {
|
|
5038
|
+
this._value = val || '';
|
|
5039
|
+
if (this.textareaRef?.nativeElement) {
|
|
5040
|
+
this.textareaRef.nativeElement.value = this._value;
|
|
5041
|
+
if (this.autoResize) {
|
|
5042
|
+
setTimeout(() => this.adjustHeight(), 0);
|
|
5043
|
+
}
|
|
5044
|
+
}
|
|
5045
|
+
this.validateField();
|
|
5046
|
+
}
|
|
5047
|
+
get value() {
|
|
5048
|
+
return this._value;
|
|
5049
|
+
}
|
|
5050
|
+
/** Event emitted when the value changes */
|
|
5051
|
+
valueChange = new EventEmitter();
|
|
5052
|
+
/** Event emitted when the textarea is focused */
|
|
5053
|
+
focused = new EventEmitter();
|
|
5054
|
+
/** Event emitted when the textarea is blurred */
|
|
5055
|
+
blurred = new EventEmitter();
|
|
5056
|
+
_value = '';
|
|
5057
|
+
isFocused = false;
|
|
5058
|
+
hasError = false;
|
|
5059
|
+
internalErrorMessage = '';
|
|
5060
|
+
currentHeight = 0;
|
|
5061
|
+
onChange = (value) => { };
|
|
5062
|
+
onTouched = () => { };
|
|
5063
|
+
destroy$ = new Subject();
|
|
5064
|
+
control;
|
|
5065
|
+
ngOnInit() {
|
|
5066
|
+
this.generateIdIfNeeded();
|
|
5067
|
+
}
|
|
5068
|
+
ngAfterViewInit() {
|
|
5069
|
+
if (this.textareaRef?.nativeElement) {
|
|
5070
|
+
// Set initial value if provided
|
|
4056
5071
|
if (this._value) {
|
|
4057
5072
|
this.textareaRef.nativeElement.value = this._value;
|
|
4058
5073
|
}
|
|
@@ -4350,6 +5365,436 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
4350
5365
|
* Molecules index
|
|
4351
5366
|
*/
|
|
4352
5367
|
|
|
5368
|
+
/**
|
|
5369
|
+
* Helper function to build displayed columns array including selection and actions
|
|
5370
|
+
*/
|
|
5371
|
+
function buildDisplayedColumns(columns, selectable, hasActions) {
|
|
5372
|
+
const displayedColumns = [];
|
|
5373
|
+
if (selectable) {
|
|
5374
|
+
displayedColumns.push('select');
|
|
5375
|
+
}
|
|
5376
|
+
displayedColumns.push(...columns.map((col) => col.key));
|
|
5377
|
+
if (hasActions) {
|
|
5378
|
+
displayedColumns.push('actions');
|
|
5379
|
+
}
|
|
5380
|
+
return displayedColumns;
|
|
5381
|
+
}
|
|
5382
|
+
class TableComponent {
|
|
5383
|
+
cdr;
|
|
5384
|
+
/** Column definitions */
|
|
5385
|
+
columns = [];
|
|
5386
|
+
/** Table data */
|
|
5387
|
+
data = [];
|
|
5388
|
+
/** Property key used for tracking rows (default: 'id') */
|
|
5389
|
+
trackByKey = 'id';
|
|
5390
|
+
/** Loading state */
|
|
5391
|
+
loading = false;
|
|
5392
|
+
/** Empty state message */
|
|
5393
|
+
emptyText = 'No data available';
|
|
5394
|
+
/** Table density */
|
|
5395
|
+
density = 'comfortable';
|
|
5396
|
+
/** Striped rows */
|
|
5397
|
+
striped = false;
|
|
5398
|
+
/** Row hover effect */
|
|
5399
|
+
hover = false;
|
|
5400
|
+
/** Enable row selection */
|
|
5401
|
+
selectable = false;
|
|
5402
|
+
/** Selection mode: 'single' or 'multiple' */
|
|
5403
|
+
selectionMode = 'multiple';
|
|
5404
|
+
/** Enable pagination */
|
|
5405
|
+
pagination = false;
|
|
5406
|
+
/** Page size options */
|
|
5407
|
+
pageSizeOptions = [10, 25, 50];
|
|
5408
|
+
/** Current page size */
|
|
5409
|
+
pageSize = 10;
|
|
5410
|
+
/** Total items (for server-side mode) */
|
|
5411
|
+
total;
|
|
5412
|
+
/** Enable sorting */
|
|
5413
|
+
sort = false;
|
|
5414
|
+
/** Server-side mode (don't slice data locally) */
|
|
5415
|
+
serverSide = false;
|
|
5416
|
+
/** Sticky header */
|
|
5417
|
+
stickyHeader = false;
|
|
5418
|
+
/** Header actions template slot */
|
|
5419
|
+
headerActionsTemplate;
|
|
5420
|
+
/** Empty state icon template slot */
|
|
5421
|
+
emptyIconTemplate;
|
|
5422
|
+
/** Row clicked event */
|
|
5423
|
+
rowClicked = new EventEmitter();
|
|
5424
|
+
/** Selection changed event */
|
|
5425
|
+
selectionChanged = new EventEmitter();
|
|
5426
|
+
/** Page changed event */
|
|
5427
|
+
pageChanged = new EventEmitter();
|
|
5428
|
+
/** Sort changed event */
|
|
5429
|
+
sortChanged = new EventEmitter();
|
|
5430
|
+
selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
5431
|
+
currentSortColumn = signal('', ...(ngDevMode ? [{ debugName: "currentSortColumn" }] : []));
|
|
5432
|
+
currentSortDirection = signal('', ...(ngDevMode ? [{ debugName: "currentSortDirection" }] : []));
|
|
5433
|
+
currentPage = signal(1, ...(ngDevMode ? [{ debugName: "currentPage" }] : []));
|
|
5434
|
+
currentPageSize = signal(this.pageSize, ...(ngDevMode ? [{ debugName: "currentPageSize" }] : []));
|
|
5435
|
+
// Computed sorted and paginated data
|
|
5436
|
+
sortedData = computed(() => {
|
|
5437
|
+
if (!this.sort || !this.currentSortColumn() || this.serverSide) {
|
|
5438
|
+
return this.data;
|
|
5439
|
+
}
|
|
5440
|
+
const column = this.columns.find((col) => col.key === this.currentSortColumn());
|
|
5441
|
+
if (!column || !column.sortable) {
|
|
5442
|
+
return this.data;
|
|
5443
|
+
}
|
|
5444
|
+
const direction = this.currentSortDirection();
|
|
5445
|
+
if (!direction) {
|
|
5446
|
+
return this.data;
|
|
5447
|
+
}
|
|
5448
|
+
const sorted = [...this.data].sort((a, b) => {
|
|
5449
|
+
const aValue = this.getCellValue(a, column);
|
|
5450
|
+
const bValue = this.getCellValue(b, column);
|
|
5451
|
+
let comparison = 0;
|
|
5452
|
+
if (column.type === 'number') {
|
|
5453
|
+
comparison = (aValue || 0) - (bValue || 0);
|
|
5454
|
+
}
|
|
5455
|
+
else if (column.type === 'date') {
|
|
5456
|
+
const aDate = this.parseDate(aValue);
|
|
5457
|
+
const bDate = this.parseDate(bValue);
|
|
5458
|
+
comparison = aDate.getTime() - bDate.getTime();
|
|
5459
|
+
}
|
|
5460
|
+
else {
|
|
5461
|
+
const aStr = String(aValue || '').toLowerCase();
|
|
5462
|
+
const bStr = String(bValue || '').toLowerCase();
|
|
5463
|
+
comparison = aStr.localeCompare(bStr);
|
|
5464
|
+
}
|
|
5465
|
+
return direction === 'asc' ? comparison : -comparison;
|
|
5466
|
+
});
|
|
5467
|
+
return sorted;
|
|
5468
|
+
}, ...(ngDevMode ? [{ debugName: "sortedData" }] : []));
|
|
5469
|
+
paginatedData = computed(() => {
|
|
5470
|
+
if (this.serverSide || !this.pagination) {
|
|
5471
|
+
return this.sortedData();
|
|
5472
|
+
}
|
|
5473
|
+
const startIndex = (this.currentPage() - 1) * this.currentPageSize();
|
|
5474
|
+
const endIndex = startIndex + this.currentPageSize();
|
|
5475
|
+
return this.sortedData().slice(startIndex, endIndex);
|
|
5476
|
+
}, ...(ngDevMode ? [{ debugName: "paginatedData" }] : []));
|
|
5477
|
+
displayedData = computed(() => {
|
|
5478
|
+
return this.paginatedData();
|
|
5479
|
+
}, ...(ngDevMode ? [{ debugName: "displayedData" }] : []));
|
|
5480
|
+
totalPages = computed(() => {
|
|
5481
|
+
if (this.serverSide && this.total !== undefined) {
|
|
5482
|
+
return Math.ceil(this.total / this.currentPageSize());
|
|
5483
|
+
}
|
|
5484
|
+
return Math.ceil(this.sortedData().length / this.currentPageSize());
|
|
5485
|
+
}, ...(ngDevMode ? [{ debugName: "totalPages" }] : []));
|
|
5486
|
+
isEmpty = computed(() => {
|
|
5487
|
+
return !this.loading && this.displayedData().length === 0;
|
|
5488
|
+
}, ...(ngDevMode ? [{ debugName: "isEmpty" }] : []));
|
|
5489
|
+
hasActionsColumn = computed(() => {
|
|
5490
|
+
return this.columns.some((col) => col.type === 'actions');
|
|
5491
|
+
}, ...(ngDevMode ? [{ debugName: "hasActionsColumn" }] : []));
|
|
5492
|
+
totalColspan = computed(() => {
|
|
5493
|
+
const selectableCol = this.selectable ? 1 : 0;
|
|
5494
|
+
const actionsCol = this.hasActionsColumn() ? 1 : 0;
|
|
5495
|
+
return selectableCol + this.columns.length + actionsCol;
|
|
5496
|
+
}, ...(ngDevMode ? [{ debugName: "totalColspan" }] : []));
|
|
5497
|
+
isAllSelected = computed(() => {
|
|
5498
|
+
if (!this.selectable || this.selectionMode === 'single') {
|
|
5499
|
+
return false;
|
|
5500
|
+
}
|
|
5501
|
+
const currentPageData = this.displayedData();
|
|
5502
|
+
const currentPageIds = new Set(currentPageData.map((row) => this.getItemId(row)));
|
|
5503
|
+
const selectedInPage = this.selectedItems().filter((item) => currentPageIds.has(this.getItemId(item)));
|
|
5504
|
+
return (currentPageData.length > 0 &&
|
|
5505
|
+
selectedInPage.length === currentPageData.length);
|
|
5506
|
+
}, ...(ngDevMode ? [{ debugName: "isAllSelected" }] : []));
|
|
5507
|
+
isIndeterminate = computed(() => {
|
|
5508
|
+
if (!this.selectable || this.selectionMode === 'single') {
|
|
5509
|
+
return false;
|
|
5510
|
+
}
|
|
5511
|
+
const currentPageData = this.displayedData();
|
|
5512
|
+
const currentPageIds = new Set(currentPageData.map((row) => this.getItemId(row)));
|
|
5513
|
+
const selectedInPage = this.selectedItems().filter((item) => currentPageIds.has(this.getItemId(item)));
|
|
5514
|
+
return (selectedInPage.length > 0 &&
|
|
5515
|
+
selectedInPage.length < currentPageData.length);
|
|
5516
|
+
}, ...(ngDevMode ? [{ debugName: "isIndeterminate" }] : []));
|
|
5517
|
+
constructor(cdr) {
|
|
5518
|
+
this.cdr = cdr;
|
|
5519
|
+
}
|
|
5520
|
+
ngOnInit() {
|
|
5521
|
+
this.currentPageSize.set(this.pageSize);
|
|
5522
|
+
}
|
|
5523
|
+
ngOnChanges(changes) {
|
|
5524
|
+
if (changes['pageSize']) {
|
|
5525
|
+
this.currentPageSize.set(this.pageSize);
|
|
5526
|
+
}
|
|
5527
|
+
if (changes['data'] && this.serverSide) {
|
|
5528
|
+
this.cdr.markForCheck();
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
5531
|
+
trackByFn(index, item) {
|
|
5532
|
+
return item[this.trackByKey] !== undefined ? item[this.trackByKey] : index;
|
|
5533
|
+
}
|
|
5534
|
+
getCellValue(row, column) {
|
|
5535
|
+
return row[column.key];
|
|
5536
|
+
}
|
|
5537
|
+
formatCellValue(value, type) {
|
|
5538
|
+
if (value === null || value === undefined) {
|
|
5539
|
+
return '';
|
|
5540
|
+
}
|
|
5541
|
+
if (type === 'number') {
|
|
5542
|
+
return typeof value === 'number' ? value.toLocaleString() : String(value);
|
|
5543
|
+
}
|
|
5544
|
+
if (type === 'date') {
|
|
5545
|
+
if (value instanceof Date) {
|
|
5546
|
+
return value.toLocaleDateString();
|
|
5547
|
+
}
|
|
5548
|
+
if (typeof value === 'string') {
|
|
5549
|
+
const date = this.parseDate(value);
|
|
5550
|
+
if (!isNaN(date.getTime())) {
|
|
5551
|
+
return date.toLocaleDateString();
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
}
|
|
5555
|
+
return String(value);
|
|
5556
|
+
}
|
|
5557
|
+
parseDate(value) {
|
|
5558
|
+
if (value instanceof Date) {
|
|
5559
|
+
return value;
|
|
5560
|
+
}
|
|
5561
|
+
if (typeof value === 'string') {
|
|
5562
|
+
return new Date(value);
|
|
5563
|
+
}
|
|
5564
|
+
return new Date();
|
|
5565
|
+
}
|
|
5566
|
+
onRowClick(row) {
|
|
5567
|
+
if (!this.loading) {
|
|
5568
|
+
this.rowClicked.emit(row);
|
|
5569
|
+
}
|
|
5570
|
+
}
|
|
5571
|
+
onSort(column) {
|
|
5572
|
+
if (!this.sort || !column.sortable || this.loading) {
|
|
5573
|
+
return;
|
|
5574
|
+
}
|
|
5575
|
+
const currentColumn = this.currentSortColumn();
|
|
5576
|
+
const currentDirection = this.currentSortDirection();
|
|
5577
|
+
let newDirection = 'asc';
|
|
5578
|
+
if (currentColumn === column.key) {
|
|
5579
|
+
if (currentDirection === 'asc') {
|
|
5580
|
+
newDirection = 'desc';
|
|
5581
|
+
}
|
|
5582
|
+
else if (currentDirection === 'desc') {
|
|
5583
|
+
newDirection = '';
|
|
5584
|
+
this.currentSortColumn.set('');
|
|
5585
|
+
this.currentSortDirection.set('');
|
|
5586
|
+
const sortEvent = {
|
|
5587
|
+
active: '',
|
|
5588
|
+
direction: '',
|
|
5589
|
+
};
|
|
5590
|
+
this.sortChanged.emit(sortEvent);
|
|
5591
|
+
this.cdr.markForCheck();
|
|
5592
|
+
return;
|
|
5593
|
+
}
|
|
5594
|
+
}
|
|
5595
|
+
this.currentSortColumn.set(column.key);
|
|
5596
|
+
this.currentSortDirection.set(newDirection);
|
|
5597
|
+
const sortEvent = {
|
|
5598
|
+
active: column.key,
|
|
5599
|
+
direction: newDirection,
|
|
5600
|
+
};
|
|
5601
|
+
this.sortChanged.emit(sortEvent);
|
|
5602
|
+
this.cdr.markForCheck();
|
|
5603
|
+
}
|
|
5604
|
+
onPageChange(page) {
|
|
5605
|
+
this.currentPage.set(page);
|
|
5606
|
+
const pageEvent = {
|
|
5607
|
+
pageIndex: page - 1,
|
|
5608
|
+
pageSize: this.currentPageSize(),
|
|
5609
|
+
};
|
|
5610
|
+
this.pageChanged.emit(pageEvent);
|
|
5611
|
+
this.cdr.markForCheck();
|
|
5612
|
+
}
|
|
5613
|
+
isSelected(row) {
|
|
5614
|
+
return this.selectedItems().some((item) => this.getItemId(item) === this.getItemId(row));
|
|
5615
|
+
}
|
|
5616
|
+
toggleRowSelection(checked, row) {
|
|
5617
|
+
if (row === undefined) {
|
|
5618
|
+
return;
|
|
5619
|
+
}
|
|
5620
|
+
if (this.selectionMode === 'single') {
|
|
5621
|
+
if (checked) {
|
|
5622
|
+
this.selectedItems.set([row]);
|
|
5623
|
+
}
|
|
5624
|
+
else {
|
|
5625
|
+
this.selectedItems.set([]);
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5628
|
+
else {
|
|
5629
|
+
const current = this.selectedItems();
|
|
5630
|
+
const itemId = this.getItemId(row);
|
|
5631
|
+
if (checked) {
|
|
5632
|
+
const index = current.findIndex((item) => this.getItemId(item) === itemId);
|
|
5633
|
+
if (index < 0) {
|
|
5634
|
+
this.selectedItems.set([...current, row]);
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
else {
|
|
5638
|
+
const updated = current.filter((item) => this.getItemId(item) !== itemId);
|
|
5639
|
+
this.selectedItems.set(updated);
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
this.selectionChanged.emit([...this.selectedItems()]);
|
|
5643
|
+
this.cdr.markForCheck();
|
|
5644
|
+
}
|
|
5645
|
+
toggleSelectAll(checked) {
|
|
5646
|
+
if (this.selectionMode === 'single') {
|
|
5647
|
+
return;
|
|
5648
|
+
}
|
|
5649
|
+
const currentPageData = this.displayedData();
|
|
5650
|
+
if (checked) {
|
|
5651
|
+
const currentIds = new Set(this.selectedItems().map((item) => this.getItemId(item)));
|
|
5652
|
+
const newItems = currentPageData.filter((row) => !currentIds.has(this.getItemId(row)));
|
|
5653
|
+
this.selectedItems.set([...this.selectedItems(), ...newItems]);
|
|
5654
|
+
}
|
|
5655
|
+
else {
|
|
5656
|
+
const currentPageIds = new Set(currentPageData.map((row) => this.getItemId(row)));
|
|
5657
|
+
const updated = this.selectedItems().filter((item) => !currentPageIds.has(this.getItemId(item)));
|
|
5658
|
+
this.selectedItems.set(updated);
|
|
5659
|
+
}
|
|
5660
|
+
this.selectionChanged.emit([...this.selectedItems()]);
|
|
5661
|
+
this.cdr.markForCheck();
|
|
5662
|
+
}
|
|
5663
|
+
getItemId(item) {
|
|
5664
|
+
return item[this.trackByKey] !== undefined ? item[this.trackByKey] : item;
|
|
5665
|
+
}
|
|
5666
|
+
getColumnClass(column) {
|
|
5667
|
+
const classes = [];
|
|
5668
|
+
if (column.align) {
|
|
5669
|
+
classes.push(`sefin-table__cell--align-${column.align}`);
|
|
5670
|
+
}
|
|
5671
|
+
if (column.sticky) {
|
|
5672
|
+
classes.push('sefin-table__cell--sticky');
|
|
5673
|
+
if (column.stickyEnd) {
|
|
5674
|
+
classes.push('sefin-table__cell--sticky-end');
|
|
5675
|
+
}
|
|
5676
|
+
}
|
|
5677
|
+
return classes.join(' ');
|
|
5678
|
+
}
|
|
5679
|
+
getTableClasses() {
|
|
5680
|
+
const classes = ['sefin-table'];
|
|
5681
|
+
if (this.density === 'compact') {
|
|
5682
|
+
classes.push('sefin-table--density-compact');
|
|
5683
|
+
}
|
|
5684
|
+
if (this.striped) {
|
|
5685
|
+
classes.push('sefin-table--striped');
|
|
5686
|
+
}
|
|
5687
|
+
if (this.hover) {
|
|
5688
|
+
classes.push('sefin-table--hover');
|
|
5689
|
+
}
|
|
5690
|
+
if (this.stickyHeader) {
|
|
5691
|
+
classes.push('sefin-table--sticky-header');
|
|
5692
|
+
}
|
|
5693
|
+
return classes.join(' ');
|
|
5694
|
+
}
|
|
5695
|
+
getColumnWidth(column) {
|
|
5696
|
+
return column.width;
|
|
5697
|
+
}
|
|
5698
|
+
getPageNumbers() {
|
|
5699
|
+
const current = this.currentPage();
|
|
5700
|
+
const total = this.totalPages();
|
|
5701
|
+
const pages = [];
|
|
5702
|
+
if (total <= 7) {
|
|
5703
|
+
for (let i = 1; i <= total; i++) {
|
|
5704
|
+
pages.push(i);
|
|
5705
|
+
}
|
|
5706
|
+
}
|
|
5707
|
+
else {
|
|
5708
|
+
if (current <= 3) {
|
|
5709
|
+
for (let i = 1; i <= 4; i++) {
|
|
5710
|
+
pages.push(i);
|
|
5711
|
+
}
|
|
5712
|
+
pages.push('ellipsis');
|
|
5713
|
+
pages.push(total);
|
|
5714
|
+
}
|
|
5715
|
+
else if (current >= total - 2) {
|
|
5716
|
+
pages.push(1);
|
|
5717
|
+
pages.push('ellipsis');
|
|
5718
|
+
for (let i = total - 3; i <= total; i++) {
|
|
5719
|
+
pages.push(i);
|
|
5720
|
+
}
|
|
5721
|
+
}
|
|
5722
|
+
else {
|
|
5723
|
+
pages.push(1);
|
|
5724
|
+
pages.push('ellipsis');
|
|
5725
|
+
for (let i = current - 1; i <= current + 1; i++) {
|
|
5726
|
+
pages.push(i);
|
|
5727
|
+
}
|
|
5728
|
+
pages.push('ellipsis');
|
|
5729
|
+
pages.push(total);
|
|
5730
|
+
}
|
|
5731
|
+
}
|
|
5732
|
+
return pages;
|
|
5733
|
+
}
|
|
5734
|
+
// Expose Math to template
|
|
5735
|
+
Math = Math;
|
|
5736
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
5737
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", type: TableComponent, isStandalone: true, selector: "sefin-table", inputs: { columns: "columns", data: "data", trackByKey: "trackByKey", loading: "loading", emptyText: "emptyText", density: "density", striped: "striped", hover: "hover", selectable: "selectable", selectionMode: "selectionMode", pagination: "pagination", pageSizeOptions: "pageSizeOptions", pageSize: "pageSize", total: "total", sort: "sort", serverSide: "serverSide", stickyHeader: "stickyHeader", headerActionsTemplate: "headerActionsTemplate", emptyIconTemplate: "emptyIconTemplate" }, outputs: { rowClicked: "rowClicked", selectionChanged: "selectionChanged", pageChanged: "pageChanged", sortChanged: "sortChanged" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"sefin-table__container\">\n <!-- Header Actions Slot -->\n <div *ngIf=\"headerActionsTemplate\" class=\"sefin-table__header-actions\">\n <ng-container *ngTemplateOutlet=\"headerActionsTemplate\"></ng-container>\n </div>\n\n <!-- Loading Overlay -->\n <div *ngIf=\"loading\" class=\"sefin-table__loading\">\n <div class=\"sefin-table__loading-bar\"></div>\n <div class=\"sefin-table__loading-rows\">\n <div *ngFor=\"let i of [1, 2, 3, 4, 5]\" class=\"sefin-table__skeleton-row\">\n <div\n class=\"sefin-table__skeleton-cell\"\n *ngFor=\"let col of columns\"\n ></div>\n </div>\n </div>\n </div>\n\n <!-- Table -->\n <div\n class=\"sefin-table__wrapper\"\n [class.sefin-table__wrapper--loading]=\"loading\"\n >\n <table [class]=\"getTableClasses()\" class=\"sefin-table__native-table\">\n <!-- Table Header -->\n <thead\n class=\"sefin-table__header\"\n [class.sefin-table__header--sticky]=\"stickyHeader\"\n >\n <tr class=\"sefin-table__header-row\">\n <!-- Selection Column Header -->\n <th\n *ngIf=\"selectable\"\n class=\"sefin-table__header-cell sefin-table__header-cell--select\"\n >\n <sefin-checkbox\n *ngIf=\"selectionMode === 'multiple'\"\n [value]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleSelectAll($event)\"\n [attr.aria-label]=\"'Select all rows'\"\n size=\"sm\"\n ></sefin-checkbox>\n </th>\n\n <!-- Data Column Headers -->\n <th\n *ngFor=\"let column of columns\"\n [class]=\"getColumnClass(column)\"\n [class.sefin-table__header-cell--sortable]=\"column.sortable && sort\"\n [class.sefin-table__header-cell--sorted]=\"\n currentSortColumn() === column.key\n \"\n [class.sefin-table__header-cell--sort-asc]=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'asc'\n \"\n [class.sefin-table__header-cell--sort-desc]=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'desc'\n \"\n [class.sefin-table__header-cell--sticky]=\"column.sticky\"\n [class.sefin-table__header-cell--sticky-end]=\"\n column.sticky && column.stickyEnd\n \"\n [style.width]=\"getColumnWidth(column)\"\n class=\"sefin-table__header-cell\"\n (click)=\"column.sortable && sort ? onSort(column) : null\"\n [attr.aria-sort]=\"\n currentSortColumn() === column.key\n ? currentSortDirection() === 'asc'\n ? 'ascending'\n : currentSortDirection() === 'desc'\n ? 'descending'\n : 'none'\n : null\n \"\n role=\"columnheader\"\n [attr.tabindex]=\"column.sortable && sort ? 0 : null\"\n >\n <span class=\"sefin-table__header-content\">\n {{ column.header }}\n <span\n *ngIf=\"column.sortable && sort\"\n class=\"sefin-table__sort-icon\"\n >\n <svg\n *ngIf=\"\n currentSortColumn() !== column.key ||\n currentSortDirection() === ''\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 4.5L6 1.5L9 4.5M3 7.5L6 10.5L9 7.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n *ngIf=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'asc'\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 7.5L6 4.5L9 7.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n *ngIf=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'desc'\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 4.5L6 7.5L9 4.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n </span>\n </th>\n\n <th\n *ngIf=\"hasActionsColumn()\"\n class=\"sefin-table__header-cell sefin-table__header-cell--actions\"\n ></th>\n </tr>\n </thead>\n\n <!-- Table Body -->\n <tbody class=\"sefin-table__body\">\n <!-- Data Rows -->\n <tr\n *ngFor=\"let row of displayedData(); trackBy: trackByFn\"\n class=\"sefin-table__row sefin-table__row--clickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection Column Cell -->\n <td\n *ngIf=\"selectable\"\n class=\"sefin-table__cell sefin-table__cell--select\"\n >\n <sefin-checkbox\n [value]=\"isSelected(row)\"\n (checkedChange)=\"toggleRowSelection($event, row)\"\n [attr.aria-label]=\"'Select row'\"\n size=\"sm\"\n ></sefin-checkbox>\n </td>\n\n <!-- Data Column Cells -->\n <td\n *ngFor=\"let column of columns\"\n [class]=\"getColumnClass(column)\"\n [class.sefin-table__cell--sticky]=\"column.sticky\"\n [class.sefin-table__cell--sticky-end]=\"\n column.sticky && column.stickyEnd\n \"\n class=\"sefin-table__cell\"\n >\n <!-- Custom Template -->\n <ng-container *ngIf=\"column.cellTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n column.cellTemplate;\n context: {\n $implicit: row,\n column: column,\n value: getCellValue(row, column)\n }\n \"\n ></ng-container>\n </ng-container>\n\n <!-- Badge Type -->\n <ng-container\n *ngIf=\"!column.cellTemplate && column.type === 'badge'\"\n >\n <sefin-badge\n [value]=\"getCellValue(row, column)\"\n variant=\"primary\"\n size=\"sm\"\n ></sefin-badge>\n </ng-container>\n\n <!-- Actions Type -->\n <ng-container\n *ngIf=\"!column.cellTemplate && column.type === 'actions'\"\n >\n <div class=\"sefin-table__actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </ng-container>\n\n <!-- Default/Text/Number/Date Type -->\n <ng-container\n *ngIf=\"\n !column.cellTemplate &&\n column.type !== 'badge' &&\n column.type !== 'actions'\n \"\n >\n <span class=\"sefin-table__cell-content\">\n {{ formatCellValue(getCellValue(row, column), column.type) }}\n </span>\n </ng-container>\n </td>\n\n <!-- Actions Column Cell -->\n <td\n *ngIf=\"hasActionsColumn()\"\n class=\"sefin-table__cell sefin-table__cell--actions\"\n >\n <div class=\"sefin-table__actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </td>\n </tr>\n\n <!-- Empty Row -->\n <tr *ngIf=\"isEmpty()\" class=\"sefin-table__row sefin-table__row--empty\">\n <td [attr.colspan]=\"totalColspan()\" class=\"sefin-table__empty-cell\">\n <div class=\"sefin-table__empty-state\">\n <ng-container *ngIf=\"emptyIconTemplate\">\n <ng-container\n *ngTemplateOutlet=\"emptyIconTemplate\"\n ></ng-container>\n </ng-container>\n <p class=\"sefin-table__empty-text\">{{ emptyText }}</p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <!-- Pagination -->\n <sefin-pagination\n *ngIf=\"pagination && !isEmpty()\"\n [currentPage]=\"currentPage()\"\n [totalPages]=\"totalPages()\"\n [totalItems]=\"serverSide && total !== undefined ? total : undefined\"\n [itemsPerPage]=\"currentPageSize()\"\n (pageChange)=\"onPageChange($event)\"\n class=\"sefin-table__paginator\"\n size=\"md\"\n ></sefin-pagination>\n</div>\n", styles: [".sefin-table{display:block;width:100%;font-family:var(--sefin-font-family-base, \"Pluto\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);background-color:var(--sefin-color-surface, #ffffff);border-radius:var(--sefin-radius-md, 8px);overflow:hidden}.sefin-table__container{display:flex;flex-direction:column;width:100%;background-color:var(--sefin-color-surface, #ffffff);border:1px solid var(--sefin-color-border, #cecece);border-radius:var(--sefin-radius-md, 8px);overflow:hidden;box-shadow:var(--sefin-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, .05));transition:box-shadow .2s ease-in-out}.sefin-table__header-actions{display:flex;justify-content:flex-end;align-items:center;padding:var(--sefin-spacing-md, 16px);border-bottom:1px solid var(--sefin-color-border, #e5e5e5);background-color:var(--sefin-color-background, #ffffff);border-radius:var(--sefin-radius-md, 8px) var(--sefin-radius-md, 8px) 0 0}.sefin-table__wrapper{position:relative;overflow-x:auto;overflow-y:visible;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__wrapper--loading{opacity:.6;pointer-events:none}.sefin-table__loading{position:absolute;inset:0;z-index:10;background-color:#fffffffa;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;flex-direction:column;border-radius:var(--sefin-radius-md, 8px)}.sefin-table__loading-bar{height:3px;background:linear-gradient(90deg,transparent,var(--sefin-color-primary, #55C3D8),transparent);animation:loading-bar 1.5s ease-in-out infinite;width:100%;border-radius:0 var(--sefin-radius-lg, 12px) 0 0}@keyframes loading-bar{0%{transform:translate(-100%)}to{transform:translate(200%)}}.sefin-table__loading-rows{flex:1;display:flex;flex-direction:column;padding:var(--sefin-spacing-lg, 24px);gap:var(--sefin-spacing-md, 16px)}.sefin-table__skeleton-row{display:flex;gap:var(--sefin-spacing-md, 16px);padding:var(--sefin-spacing-sm, 8px) 0}.sefin-table__skeleton-cell{flex:1;height:20px;background:linear-gradient(90deg,var(--sefin-color-surface-hover, #f5f5f5) 0%,rgba(85,195,216,.15) 50%,var(--sefin-color-surface-hover, #f5f5f5) 100%);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:var(--sefin-radius-sm, 4px)}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}.sefin-table__native-table{width:100%;border-collapse:separate;border-spacing:0;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--density-compact .sefin-table__header-cell,.sefin-table--density-compact .sefin-table__cell{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, .875rem);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-table--density-compact .sefin-table__header-cell{padding-top:var(--sefin-spacing-sm, 8px);padding-bottom:var(--sefin-spacing-sm, 8px)}.sefin-table--density-compact .sefin-table__cell{padding-top:var(--sefin-spacing-xs, 4px);padding-bottom:var(--sefin-spacing-xs, 4px)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__header-cell,.sefin-table:not(.sefin-table--density-compact) .sefin-table__cell{padding:var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-base, 1rem);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__header-cell{padding-top:var(--sefin-spacing-md, 16px);padding-bottom:var(--sefin-spacing-md, 16px)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__cell{padding-top:var(--sefin-spacing-sm, 8px);padding-bottom:var(--sefin-spacing-sm, 8px)}.sefin-table__header{background-color:var(--sefin-color-background-elevated, #fafafa);border-bottom:2px solid var(--sefin-color-border, #e5e5e5)}.sefin-table__header--sticky{position:sticky;top:0;z-index:3;box-shadow:0 2px 8px #0000000f}.sefin-table__header-row{background-color:var(--sefin-color-background-elevated, #fafafa)}.sefin-table__header-cell{font-weight:var(--sefin-font-weight-semibold, 600);font-size:var(--sefin-font-size-sm, .875rem);color:var(--sefin-color-text, #383838);text-transform:uppercase;letter-spacing:.5px;text-align:left;white-space:nowrap;border-bottom:none;position:relative;background-color:var(--sefin-color-background-elevated, #fafafa);-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out;z-index:1}.sefin-table__header-cell--align-left{text-align:left}.sefin-table__header-cell--align-center{text-align:center}.sefin-table__header-cell--align-right{text-align:right}.sefin-table__header-cell--select{width:56px;padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-sm, 8px);text-align:center}.sefin-table__header-cell--actions{width:120px;text-align:right}.sefin-table__header-cell--sortable{cursor:pointer}.sefin-table__header-cell--sortable:hover{background-color:#55c3d814;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sortable:hover .sefin-table__sort-icon{opacity:1;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sortable:active{background-color:#55c3d81f}.sefin-table__header-cell--sortable:focus-visible{outline:2px solid var(--sefin-color-border-focus, #55C3D8);outline-offset:-2px;border-radius:var(--sefin-radius-sm, 4px)}.sefin-table__header-cell--sorted{color:var(--sefin-color-primary, #55C3D8);background-color:#55c3d80f}.sefin-table__header-cell--sorted .sefin-table__sort-icon{opacity:1;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sticky{position:sticky;background-color:var(--sefin-color-background-elevated, #fafafa);z-index:2;box-shadow:2px 0 4px #0000000a}.sefin-table__header-cell--sticky:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--sefin-color-border, #e5e5e5);opacity:.6}.sefin-table__header-cell--sticky.sefin-table__header-cell--sticky-end{right:0;box-shadow:-2px 0 4px #0000000a}.sefin-table__header-cell--sticky.sefin-table__header-cell--sticky-end:after{left:0;right:auto}.sefin-table__header-content{display:flex;align-items:center;justify-content:flex-start;gap:var(--sefin-spacing-xs, 4px);width:100%}.sefin-table__sort-icon{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;color:var(--sefin-color-text-secondary, #9b9b9b);opacity:.4;transition:all .2s ease-in-out;flex-shrink:0;margin-left:var(--sefin-spacing-xs, 4px)}.sefin-table__sort-icon svg{display:block;width:100%;height:100%}.sefin-table__body{background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__row{border-bottom:1px solid var(--sefin-color-border, #e5e5e5);transition:all .2s ease-in-out;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__row--clickable{cursor:pointer}.sefin-table__row--clickable:hover:not(.sefin-table__row--empty){background-color:#55c3d80d;box-shadow:inset 3px 0 0 var(--sefin-color-primary, #55C3D8)}.sefin-table__row--clickable:hover:not(.sefin-table__row--empty) .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table__row--clickable:active:not(.sefin-table__row--empty){background-color:#55c3d814;box-shadow:inset 3px 0 0 var(--sefin-color-primary-dark, #3f9bb0)}.sefin-table__row--clickable:active:not(.sefin-table__row--empty) .sefin-table__cell--sticky{background-color:#55c3d814}.sefin-table__row--empty{border-bottom:none}.sefin-table__row:focus-visible{outline:2px solid var(--sefin-color-border-focus, #55C3D8);outline-offset:-2px;border-radius:var(--sefin-radius-sm, 4px)}.sefin-table__row:last-child{border-bottom:none}.sefin-table__cell{font-family:var(--sefin-font-family-base, \"Pluto\", sans-serif);font-size:var(--sefin-font-size-base, 1rem);font-weight:var(--sefin-font-weight-normal, 400);color:var(--sefin-color-text, #383838);border-bottom:none;vertical-align:middle;background-color:inherit;transition:background-color .2s ease-in-out,color .2s ease-in-out}.sefin-table__cell--align-left{text-align:left}.sefin-table__cell--align-center{text-align:center}.sefin-table__cell--align-right{text-align:right}.sefin-table__cell--select{width:56px;padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-sm, 8px);text-align:center}.sefin-table__cell--actions{text-align:right;width:120px}.sefin-table__cell--sticky{position:sticky;background-color:inherit;z-index:1;box-shadow:2px 0 4px #0000000a}.sefin-table__cell--sticky:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--sefin-color-border, #e5e5e5);opacity:.6}.sefin-table__cell--sticky.sefin-table__cell--sticky-end{right:0;box-shadow:-2px 0 4px #0000000a}.sefin-table__cell--sticky.sefin-table__cell--sticky-end:after{left:0;right:auto}.sefin-table__cell-content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #383838)}.sefin-table__actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--sefin-spacing-xs, 4px);flex-wrap:wrap}.sefin-table--striped .sefin-table__row:nth-child(2n){background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--striped .sefin-table__row:nth-child(odd){background-color:#f8f9facc}.sefin-table--striped .sefin-table__cell--sticky:nth-child(2n){background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--striped .sefin-table__cell--sticky:nth-child(odd){background-color:#f8f9facc}.sefin-table--striped .sefin-table__row--clickable:hover,.sefin-table--striped .sefin-table__row--clickable:hover .sefin-table__cell--sticky{background-color:#55c3d814!important}.sefin-table--hover .sefin-table__row:not(.sefin-table__row--empty):hover{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row:not(.sefin-table__row--empty):hover .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row--clickable:not(.sefin-table__row--empty):hover{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row--clickable:not(.sefin-table__row--empty):hover .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table--sticky-header .sefin-table__header{position:sticky;top:0;z-index:3;box-shadow:0 4px 12px #00000014}.sefin-table__empty-cell{padding:var(--sefin-spacing-4xl, 96px) var(--sefin-spacing-xl, 32px);text-align:center;border-bottom:none;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--sefin-spacing-lg, 24px);padding:var(--sefin-spacing-2xl, 48px);background:linear-gradient(to bottom,rgba(248,249,250,.5),transparent);border-radius:var(--sefin-radius-md, 8px);margin:var(--sefin-spacing-lg, 24px)}.sefin-table__empty-text{font-size:var(--sefin-font-size-lg, 1.125rem);font-weight:var(--sefin-font-weight-medium, 500);line-height:var(--sefin-line-height-relaxed, 1.75);color:var(--sefin-color-text-secondary, #686868);margin:0;font-family:var(--sefin-font-family-base, \"Pluto\", sans-serif);max-width:480px;letter-spacing:.2px}.sefin-table__paginator{border-top:1px solid var(--sefin-color-border, #e5e5e5);background-color:var(--sefin-color-background, #ffffff);padding:var(--sefin-spacing-md, 16px);border-radius:0 0 var(--sefin-radius-md, 8px) var(--sefin-radius-md, 8px)}.sefin-table ::ng-deep .sefin-checkbox{margin:0;transition:transform .2s ease-in-out}.sefin-table ::ng-deep .sefin-checkbox:hover{transform:scale(1.05)}.sefin-table ::ng-deep .sefin-badge{margin:0;box-shadow:0 1px 3px #0000001a;transition:transform .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-table ::ng-deep .sefin-badge:hover{transform:translateY(-1px);box-shadow:0 2px 6px #00000026}.sefin-table ::ng-deep .sefin-button,.sefin-table ::ng-deep .sefin-icon-button{transition:transform .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-table ::ng-deep .sefin-button:hover,.sefin-table ::ng-deep .sefin-icon-button:hover{transform:translateY(-1px)}.sefin-table ::ng-deep .sefin-button:active,.sefin-table ::ng-deep .sefin-icon-button:active{transform:translateY(0)}\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: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginationComponent, selector: "sefin-pagination", inputs: ["currentPage", "totalPages", "totalItems", "itemsPerPage", "siblingCount", "showFirstLast", "showPrevNext", "size", "variant", "class"], outputs: ["pageChange"] }, { kind: "component", type: CheckboxComponent, selector: "sefin-checkbox", inputs: ["size", "disabled", "indeterminate", "class", "label", "name", "value"], outputs: ["valueChange", "checkedChange"] }, { kind: "component", type: BadgeComponent, selector: "sefin-badge", inputs: ["variant", "size", "dot", "max", "value", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
5738
|
+
}
|
|
5739
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TableComponent, decorators: [{
|
|
5740
|
+
type: Component,
|
|
5741
|
+
args: [{ selector: 'sefin-table', standalone: true, imports: [CommonModule, PaginationComponent, CheckboxComponent, BadgeComponent], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"sefin-table__container\">\n <!-- Header Actions Slot -->\n <div *ngIf=\"headerActionsTemplate\" class=\"sefin-table__header-actions\">\n <ng-container *ngTemplateOutlet=\"headerActionsTemplate\"></ng-container>\n </div>\n\n <!-- Loading Overlay -->\n <div *ngIf=\"loading\" class=\"sefin-table__loading\">\n <div class=\"sefin-table__loading-bar\"></div>\n <div class=\"sefin-table__loading-rows\">\n <div *ngFor=\"let i of [1, 2, 3, 4, 5]\" class=\"sefin-table__skeleton-row\">\n <div\n class=\"sefin-table__skeleton-cell\"\n *ngFor=\"let col of columns\"\n ></div>\n </div>\n </div>\n </div>\n\n <!-- Table -->\n <div\n class=\"sefin-table__wrapper\"\n [class.sefin-table__wrapper--loading]=\"loading\"\n >\n <table [class]=\"getTableClasses()\" class=\"sefin-table__native-table\">\n <!-- Table Header -->\n <thead\n class=\"sefin-table__header\"\n [class.sefin-table__header--sticky]=\"stickyHeader\"\n >\n <tr class=\"sefin-table__header-row\">\n <!-- Selection Column Header -->\n <th\n *ngIf=\"selectable\"\n class=\"sefin-table__header-cell sefin-table__header-cell--select\"\n >\n <sefin-checkbox\n *ngIf=\"selectionMode === 'multiple'\"\n [value]=\"isAllSelected()\"\n [indeterminate]=\"isIndeterminate()\"\n (checkedChange)=\"toggleSelectAll($event)\"\n [attr.aria-label]=\"'Select all rows'\"\n size=\"sm\"\n ></sefin-checkbox>\n </th>\n\n <!-- Data Column Headers -->\n <th\n *ngFor=\"let column of columns\"\n [class]=\"getColumnClass(column)\"\n [class.sefin-table__header-cell--sortable]=\"column.sortable && sort\"\n [class.sefin-table__header-cell--sorted]=\"\n currentSortColumn() === column.key\n \"\n [class.sefin-table__header-cell--sort-asc]=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'asc'\n \"\n [class.sefin-table__header-cell--sort-desc]=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'desc'\n \"\n [class.sefin-table__header-cell--sticky]=\"column.sticky\"\n [class.sefin-table__header-cell--sticky-end]=\"\n column.sticky && column.stickyEnd\n \"\n [style.width]=\"getColumnWidth(column)\"\n class=\"sefin-table__header-cell\"\n (click)=\"column.sortable && sort ? onSort(column) : null\"\n [attr.aria-sort]=\"\n currentSortColumn() === column.key\n ? currentSortDirection() === 'asc'\n ? 'ascending'\n : currentSortDirection() === 'desc'\n ? 'descending'\n : 'none'\n : null\n \"\n role=\"columnheader\"\n [attr.tabindex]=\"column.sortable && sort ? 0 : null\"\n >\n <span class=\"sefin-table__header-content\">\n {{ column.header }}\n <span\n *ngIf=\"column.sortable && sort\"\n class=\"sefin-table__sort-icon\"\n >\n <svg\n *ngIf=\"\n currentSortColumn() !== column.key ||\n currentSortDirection() === ''\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 4.5L6 1.5L9 4.5M3 7.5L6 10.5L9 7.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n *ngIf=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'asc'\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 7.5L6 4.5L9 7.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n *ngIf=\"\n currentSortColumn() === column.key &&\n currentSortDirection() === 'desc'\n \"\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M3 4.5L6 7.5L9 4.5\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n </span>\n </th>\n\n <th\n *ngIf=\"hasActionsColumn()\"\n class=\"sefin-table__header-cell sefin-table__header-cell--actions\"\n ></th>\n </tr>\n </thead>\n\n <!-- Table Body -->\n <tbody class=\"sefin-table__body\">\n <!-- Data Rows -->\n <tr\n *ngFor=\"let row of displayedData(); trackBy: trackByFn\"\n class=\"sefin-table__row sefin-table__row--clickable\"\n (click)=\"onRowClick(row)\"\n >\n <!-- Selection Column Cell -->\n <td\n *ngIf=\"selectable\"\n class=\"sefin-table__cell sefin-table__cell--select\"\n >\n <sefin-checkbox\n [value]=\"isSelected(row)\"\n (checkedChange)=\"toggleRowSelection($event, row)\"\n [attr.aria-label]=\"'Select row'\"\n size=\"sm\"\n ></sefin-checkbox>\n </td>\n\n <!-- Data Column Cells -->\n <td\n *ngFor=\"let column of columns\"\n [class]=\"getColumnClass(column)\"\n [class.sefin-table__cell--sticky]=\"column.sticky\"\n [class.sefin-table__cell--sticky-end]=\"\n column.sticky && column.stickyEnd\n \"\n class=\"sefin-table__cell\"\n >\n <!-- Custom Template -->\n <ng-container *ngIf=\"column.cellTemplate\">\n <ng-container\n *ngTemplateOutlet=\"\n column.cellTemplate;\n context: {\n $implicit: row,\n column: column,\n value: getCellValue(row, column)\n }\n \"\n ></ng-container>\n </ng-container>\n\n <!-- Badge Type -->\n <ng-container\n *ngIf=\"!column.cellTemplate && column.type === 'badge'\"\n >\n <sefin-badge\n [value]=\"getCellValue(row, column)\"\n variant=\"primary\"\n size=\"sm\"\n ></sefin-badge>\n </ng-container>\n\n <!-- Actions Type -->\n <ng-container\n *ngIf=\"!column.cellTemplate && column.type === 'actions'\"\n >\n <div class=\"sefin-table__actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </ng-container>\n\n <!-- Default/Text/Number/Date Type -->\n <ng-container\n *ngIf=\"\n !column.cellTemplate &&\n column.type !== 'badge' &&\n column.type !== 'actions'\n \"\n >\n <span class=\"sefin-table__cell-content\">\n {{ formatCellValue(getCellValue(row, column), column.type) }}\n </span>\n </ng-container>\n </td>\n\n <!-- Actions Column Cell -->\n <td\n *ngIf=\"hasActionsColumn()\"\n class=\"sefin-table__cell sefin-table__cell--actions\"\n >\n <div class=\"sefin-table__actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </div>\n </td>\n </tr>\n\n <!-- Empty Row -->\n <tr *ngIf=\"isEmpty()\" class=\"sefin-table__row sefin-table__row--empty\">\n <td [attr.colspan]=\"totalColspan()\" class=\"sefin-table__empty-cell\">\n <div class=\"sefin-table__empty-state\">\n <ng-container *ngIf=\"emptyIconTemplate\">\n <ng-container\n *ngTemplateOutlet=\"emptyIconTemplate\"\n ></ng-container>\n </ng-container>\n <p class=\"sefin-table__empty-text\">{{ emptyText }}</p>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <!-- Pagination -->\n <sefin-pagination\n *ngIf=\"pagination && !isEmpty()\"\n [currentPage]=\"currentPage()\"\n [totalPages]=\"totalPages()\"\n [totalItems]=\"serverSide && total !== undefined ? total : undefined\"\n [itemsPerPage]=\"currentPageSize()\"\n (pageChange)=\"onPageChange($event)\"\n class=\"sefin-table__paginator\"\n size=\"md\"\n ></sefin-pagination>\n</div>\n", styles: [".sefin-table{display:block;width:100%;font-family:var(--sefin-font-family-base, \"Pluto\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);background-color:var(--sefin-color-surface, #ffffff);border-radius:var(--sefin-radius-md, 8px);overflow:hidden}.sefin-table__container{display:flex;flex-direction:column;width:100%;background-color:var(--sefin-color-surface, #ffffff);border:1px solid var(--sefin-color-border, #cecece);border-radius:var(--sefin-radius-md, 8px);overflow:hidden;box-shadow:var(--sefin-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, .05));transition:box-shadow .2s ease-in-out}.sefin-table__header-actions{display:flex;justify-content:flex-end;align-items:center;padding:var(--sefin-spacing-md, 16px);border-bottom:1px solid var(--sefin-color-border, #e5e5e5);background-color:var(--sefin-color-background, #ffffff);border-radius:var(--sefin-radius-md, 8px) var(--sefin-radius-md, 8px) 0 0}.sefin-table__wrapper{position:relative;overflow-x:auto;overflow-y:visible;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__wrapper--loading{opacity:.6;pointer-events:none}.sefin-table__loading{position:absolute;inset:0;z-index:10;background-color:#fffffffa;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);display:flex;flex-direction:column;border-radius:var(--sefin-radius-md, 8px)}.sefin-table__loading-bar{height:3px;background:linear-gradient(90deg,transparent,var(--sefin-color-primary, #55C3D8),transparent);animation:loading-bar 1.5s ease-in-out infinite;width:100%;border-radius:0 var(--sefin-radius-lg, 12px) 0 0}@keyframes loading-bar{0%{transform:translate(-100%)}to{transform:translate(200%)}}.sefin-table__loading-rows{flex:1;display:flex;flex-direction:column;padding:var(--sefin-spacing-lg, 24px);gap:var(--sefin-spacing-md, 16px)}.sefin-table__skeleton-row{display:flex;gap:var(--sefin-spacing-md, 16px);padding:var(--sefin-spacing-sm, 8px) 0}.sefin-table__skeleton-cell{flex:1;height:20px;background:linear-gradient(90deg,var(--sefin-color-surface-hover, #f5f5f5) 0%,rgba(85,195,216,.15) 50%,var(--sefin-color-surface-hover, #f5f5f5) 100%);background-size:200% 100%;animation:skeleton-loading 1.5s ease-in-out infinite;border-radius:var(--sefin-radius-sm, 4px)}@keyframes skeleton-loading{0%{background-position:200% 0}to{background-position:-200% 0}}.sefin-table__native-table{width:100%;border-collapse:separate;border-spacing:0;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--density-compact .sefin-table__header-cell,.sefin-table--density-compact .sefin-table__cell{padding:var(--sefin-spacing-xs, 4px) var(--sefin-spacing-sm, 8px);font-size:var(--sefin-font-size-sm, .875rem);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-table--density-compact .sefin-table__header-cell{padding-top:var(--sefin-spacing-sm, 8px);padding-bottom:var(--sefin-spacing-sm, 8px)}.sefin-table--density-compact .sefin-table__cell{padding-top:var(--sefin-spacing-xs, 4px);padding-bottom:var(--sefin-spacing-xs, 4px)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__header-cell,.sefin-table:not(.sefin-table--density-compact) .sefin-table__cell{padding:var(--sefin-spacing-md, 16px);font-size:var(--sefin-font-size-base, 1rem);line-height:var(--sefin-line-height-normal, 1.5)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__header-cell{padding-top:var(--sefin-spacing-md, 16px);padding-bottom:var(--sefin-spacing-md, 16px)}.sefin-table:not(.sefin-table--density-compact) .sefin-table__cell{padding-top:var(--sefin-spacing-sm, 8px);padding-bottom:var(--sefin-spacing-sm, 8px)}.sefin-table__header{background-color:var(--sefin-color-background-elevated, #fafafa);border-bottom:2px solid var(--sefin-color-border, #e5e5e5)}.sefin-table__header--sticky{position:sticky;top:0;z-index:3;box-shadow:0 2px 8px #0000000f}.sefin-table__header-row{background-color:var(--sefin-color-background-elevated, #fafafa)}.sefin-table__header-cell{font-weight:var(--sefin-font-weight-semibold, 600);font-size:var(--sefin-font-size-sm, .875rem);color:var(--sefin-color-text, #383838);text-transform:uppercase;letter-spacing:.5px;text-align:left;white-space:nowrap;border-bottom:none;position:relative;background-color:var(--sefin-color-background-elevated, #fafafa);-webkit-user-select:none;user-select:none;transition:all .2s ease-in-out;z-index:1}.sefin-table__header-cell--align-left{text-align:left}.sefin-table__header-cell--align-center{text-align:center}.sefin-table__header-cell--align-right{text-align:right}.sefin-table__header-cell--select{width:56px;padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-sm, 8px);text-align:center}.sefin-table__header-cell--actions{width:120px;text-align:right}.sefin-table__header-cell--sortable{cursor:pointer}.sefin-table__header-cell--sortable:hover{background-color:#55c3d814;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sortable:hover .sefin-table__sort-icon{opacity:1;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sortable:active{background-color:#55c3d81f}.sefin-table__header-cell--sortable:focus-visible{outline:2px solid var(--sefin-color-border-focus, #55C3D8);outline-offset:-2px;border-radius:var(--sefin-radius-sm, 4px)}.sefin-table__header-cell--sorted{color:var(--sefin-color-primary, #55C3D8);background-color:#55c3d80f}.sefin-table__header-cell--sorted .sefin-table__sort-icon{opacity:1;color:var(--sefin-color-primary, #55C3D8)}.sefin-table__header-cell--sticky{position:sticky;background-color:var(--sefin-color-background-elevated, #fafafa);z-index:2;box-shadow:2px 0 4px #0000000a}.sefin-table__header-cell--sticky:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--sefin-color-border, #e5e5e5);opacity:.6}.sefin-table__header-cell--sticky.sefin-table__header-cell--sticky-end{right:0;box-shadow:-2px 0 4px #0000000a}.sefin-table__header-cell--sticky.sefin-table__header-cell--sticky-end:after{left:0;right:auto}.sefin-table__header-content{display:flex;align-items:center;justify-content:flex-start;gap:var(--sefin-spacing-xs, 4px);width:100%}.sefin-table__sort-icon{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;color:var(--sefin-color-text-secondary, #9b9b9b);opacity:.4;transition:all .2s ease-in-out;flex-shrink:0;margin-left:var(--sefin-spacing-xs, 4px)}.sefin-table__sort-icon svg{display:block;width:100%;height:100%}.sefin-table__body{background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__row{border-bottom:1px solid var(--sefin-color-border, #e5e5e5);transition:all .2s ease-in-out;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__row--clickable{cursor:pointer}.sefin-table__row--clickable:hover:not(.sefin-table__row--empty){background-color:#55c3d80d;box-shadow:inset 3px 0 0 var(--sefin-color-primary, #55C3D8)}.sefin-table__row--clickable:hover:not(.sefin-table__row--empty) .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table__row--clickable:active:not(.sefin-table__row--empty){background-color:#55c3d814;box-shadow:inset 3px 0 0 var(--sefin-color-primary-dark, #3f9bb0)}.sefin-table__row--clickable:active:not(.sefin-table__row--empty) .sefin-table__cell--sticky{background-color:#55c3d814}.sefin-table__row--empty{border-bottom:none}.sefin-table__row:focus-visible{outline:2px solid var(--sefin-color-border-focus, #55C3D8);outline-offset:-2px;border-radius:var(--sefin-radius-sm, 4px)}.sefin-table__row:last-child{border-bottom:none}.sefin-table__cell{font-family:var(--sefin-font-family-base, \"Pluto\", sans-serif);font-size:var(--sefin-font-size-base, 1rem);font-weight:var(--sefin-font-weight-normal, 400);color:var(--sefin-color-text, #383838);border-bottom:none;vertical-align:middle;background-color:inherit;transition:background-color .2s ease-in-out,color .2s ease-in-out}.sefin-table__cell--align-left{text-align:left}.sefin-table__cell--align-center{text-align:center}.sefin-table__cell--align-right{text-align:right}.sefin-table__cell--select{width:56px;padding-left:var(--sefin-spacing-md, 16px);padding-right:var(--sefin-spacing-sm, 8px);text-align:center}.sefin-table__cell--actions{text-align:right;width:120px}.sefin-table__cell--sticky{position:sticky;background-color:inherit;z-index:1;box-shadow:2px 0 4px #0000000a}.sefin-table__cell--sticky:after{content:\"\";position:absolute;top:0;right:0;bottom:0;width:1px;background-color:var(--sefin-color-border, #e5e5e5);opacity:.6}.sefin-table__cell--sticky.sefin-table__cell--sticky-end{right:0;box-shadow:-2px 0 4px #0000000a}.sefin-table__cell--sticky.sefin-table__cell--sticky-end:after{left:0;right:auto}.sefin-table__cell-content{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:var(--sefin-line-height-normal, 1.5);color:var(--sefin-color-text, #383838)}.sefin-table__actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--sefin-spacing-xs, 4px);flex-wrap:wrap}.sefin-table--striped .sefin-table__row:nth-child(2n){background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--striped .sefin-table__row:nth-child(odd){background-color:#f8f9facc}.sefin-table--striped .sefin-table__cell--sticky:nth-child(2n){background-color:var(--sefin-color-surface, #ffffff)}.sefin-table--striped .sefin-table__cell--sticky:nth-child(odd){background-color:#f8f9facc}.sefin-table--striped .sefin-table__row--clickable:hover,.sefin-table--striped .sefin-table__row--clickable:hover .sefin-table__cell--sticky{background-color:#55c3d814!important}.sefin-table--hover .sefin-table__row:not(.sefin-table__row--empty):hover{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row:not(.sefin-table__row--empty):hover .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row--clickable:not(.sefin-table__row--empty):hover{background-color:#55c3d80d}.sefin-table--hover .sefin-table__row--clickable:not(.sefin-table__row--empty):hover .sefin-table__cell--sticky{background-color:#55c3d80d}.sefin-table--sticky-header .sefin-table__header{position:sticky;top:0;z-index:3;box-shadow:0 4px 12px #00000014}.sefin-table__empty-cell{padding:var(--sefin-spacing-4xl, 96px) var(--sefin-spacing-xl, 32px);text-align:center;border-bottom:none;background-color:var(--sefin-color-surface, #ffffff)}.sefin-table__empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--sefin-spacing-lg, 24px);padding:var(--sefin-spacing-2xl, 48px);background:linear-gradient(to bottom,rgba(248,249,250,.5),transparent);border-radius:var(--sefin-radius-md, 8px);margin:var(--sefin-spacing-lg, 24px)}.sefin-table__empty-text{font-size:var(--sefin-font-size-lg, 1.125rem);font-weight:var(--sefin-font-weight-medium, 500);line-height:var(--sefin-line-height-relaxed, 1.75);color:var(--sefin-color-text-secondary, #686868);margin:0;font-family:var(--sefin-font-family-base, \"Pluto\", sans-serif);max-width:480px;letter-spacing:.2px}.sefin-table__paginator{border-top:1px solid var(--sefin-color-border, #e5e5e5);background-color:var(--sefin-color-background, #ffffff);padding:var(--sefin-spacing-md, 16px);border-radius:0 0 var(--sefin-radius-md, 8px) var(--sefin-radius-md, 8px)}.sefin-table ::ng-deep .sefin-checkbox{margin:0;transition:transform .2s ease-in-out}.sefin-table ::ng-deep .sefin-checkbox:hover{transform:scale(1.05)}.sefin-table ::ng-deep .sefin-badge{margin:0;box-shadow:0 1px 3px #0000001a;transition:transform .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-table ::ng-deep .sefin-badge:hover{transform:translateY(-1px);box-shadow:0 2px 6px #00000026}.sefin-table ::ng-deep .sefin-button,.sefin-table ::ng-deep .sefin-icon-button{transition:transform .2s ease-in-out,box-shadow .2s ease-in-out}.sefin-table ::ng-deep .sefin-button:hover,.sefin-table ::ng-deep .sefin-icon-button:hover{transform:translateY(-1px)}.sefin-table ::ng-deep .sefin-button:active,.sefin-table ::ng-deep .sefin-icon-button:active{transform:translateY(0)}\n"] }]
|
|
5742
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { columns: [{
|
|
5743
|
+
type: Input
|
|
5744
|
+
}], data: [{
|
|
5745
|
+
type: Input
|
|
5746
|
+
}], trackByKey: [{
|
|
5747
|
+
type: Input
|
|
5748
|
+
}], loading: [{
|
|
5749
|
+
type: Input
|
|
5750
|
+
}], emptyText: [{
|
|
5751
|
+
type: Input
|
|
5752
|
+
}], density: [{
|
|
5753
|
+
type: Input
|
|
5754
|
+
}], striped: [{
|
|
5755
|
+
type: Input
|
|
5756
|
+
}], hover: [{
|
|
5757
|
+
type: Input
|
|
5758
|
+
}], selectable: [{
|
|
5759
|
+
type: Input
|
|
5760
|
+
}], selectionMode: [{
|
|
5761
|
+
type: Input
|
|
5762
|
+
}], pagination: [{
|
|
5763
|
+
type: Input
|
|
5764
|
+
}], pageSizeOptions: [{
|
|
5765
|
+
type: Input
|
|
5766
|
+
}], pageSize: [{
|
|
5767
|
+
type: Input
|
|
5768
|
+
}], total: [{
|
|
5769
|
+
type: Input
|
|
5770
|
+
}], sort: [{
|
|
5771
|
+
type: Input
|
|
5772
|
+
}], serverSide: [{
|
|
5773
|
+
type: Input
|
|
5774
|
+
}], stickyHeader: [{
|
|
5775
|
+
type: Input
|
|
5776
|
+
}], headerActionsTemplate: [{
|
|
5777
|
+
type: Input
|
|
5778
|
+
}], emptyIconTemplate: [{
|
|
5779
|
+
type: Input
|
|
5780
|
+
}], rowClicked: [{
|
|
5781
|
+
type: Output
|
|
5782
|
+
}], selectionChanged: [{
|
|
5783
|
+
type: Output
|
|
5784
|
+
}], pageChanged: [{
|
|
5785
|
+
type: Output
|
|
5786
|
+
}], sortChanged: [{
|
|
5787
|
+
type: Output
|
|
5788
|
+
}] } });
|
|
5789
|
+
|
|
5790
|
+
/**
|
|
5791
|
+
* Table component exports
|
|
5792
|
+
*/
|
|
5793
|
+
|
|
5794
|
+
/**
|
|
5795
|
+
* Organisms index
|
|
5796
|
+
*/
|
|
5797
|
+
|
|
4353
5798
|
/*
|
|
4354
5799
|
* Public API Surface of @lesterarte/sefin-ui
|
|
4355
5800
|
*/
|
|
@@ -4361,5 +5806,5 @@ const STYLES_PATH = './styles/index.scss';
|
|
|
4361
5806
|
* Generated bundle index. Do not edit.
|
|
4362
5807
|
*/
|
|
4363
5808
|
|
|
4364
|
-
export { AccordionItemComponent, AlertComponent, AutocompleteComponent, AvatarComponent, BORDER_RADIUS_TOKENS, BRAND_THEME, BadgeComponent, ButtonComponent, COLOR_TOKENS, CardComponent, CheckboxComponent, ChipComponent, ContainerComponent, DARK_THEME, DESIGN_TOKENS, DatepickerComponent, DividerComponent, FabButtonComponent, IconButtonComponent, IconComponent, ImageComponent, LIGHT_THEME, LinkComponent, ProgressBarComponent, RadioComponent, SHADOW_TOKENS, SPACING_TOKENS, STYLES_PATH, SelectComponent, SpinnerComponent, StackComponent, SwitchComponent, TYPOGRAPHY_TOKENS, TagComponent, TextFieldComponent, TextareaComponent, ThemeLoader, ToastComponent, TooltipComponent, TypographyComponent };
|
|
5809
|
+
export { AccordionItemComponent, AlertComponent, AutocompleteComponent, AvatarComponent, BORDER_RADIUS_TOKENS, BRAND_THEME, BadgeComponent, BreadcrumbsComponent, ButtonComponent, ButtonGroupComponent, COLOR_TOKENS, CardComponent, CheckboxComponent, ChipComponent, ContainerComponent, DARK_THEME, DESIGN_TOKENS, DatepickerComponent, DividerComponent, FabButtonComponent, FormFieldComponent, IconButtonComponent, IconComponent, ImageComponent, LIGHT_THEME, LinkComponent, PaginationComponent, ProgressBarComponent, RadioComponent, RateComponent, SHADOW_TOKENS, SPACING_TOKENS, STYLES_PATH, SelectComponent, SpacerComponent, SpinnerComponent, StackComponent, SwitchComponent, TYPOGRAPHY_TOKENS, TabComponent, TableComponent, TagComponent, TextFieldComponent, TextareaComponent, ThemeLoader, ToastComponent, TooltipComponent, TypographyComponent, buildDisplayedColumns };
|
|
4365
5810
|
//# sourceMappingURL=lesterarte-sefin-ui.mjs.map
|