@juligc99/loro-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -0
- package/assets/loro-ui/favicons/Assets.xcassets/AppIcon.appiconset/AppIcon-Any.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/AppIcon.appiconset/AppIcon-Dark.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/AppIcon.appiconset/Contents.json +26 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Contents.json +6 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/Contents.json +56 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-dark-2732x2732-1.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-dark-2732x2732-2.png +0 -0
- package/assets/loro-ui/favicons/Assets.xcassets/Splash.imageset/splash-dark-2732x2732.png +0 -0
- package/assets/loro-ui/favicons/apple-touch-icon.png +0 -0
- package/assets/loro-ui/favicons/favicon.ico +0 -0
- package/assets/loro-ui/favicons/favicon.svg +4 -0
- package/assets/loro-ui/fonts/google-fonts.css +107 -0
- package/assets/loro-ui/fonts/inter-latin-ext.woff2 +0 -0
- package/assets/loro-ui/fonts/inter-latin.woff2 +0 -0
- package/assets/loro-ui/fonts/manrope-latin-ext.woff2 +0 -0
- package/assets/loro-ui/fonts/manrope-latin.woff2 +0 -0
- package/assets/loro-ui/icons/apple.svg +7 -0
- package/assets/loro-ui/icons/arrow-right.svg +1 -0
- package/assets/loro-ui/icons/auto.svg +3 -0
- package/assets/loro-ui/icons/back.svg +1 -0
- package/assets/loro-ui/icons/bag.svg +1 -0
- package/assets/loro-ui/icons/barcode.svg +3 -0
- package/assets/loro-ui/icons/bell.svg +3 -0
- package/assets/loro-ui/icons/bottle.svg +3 -0
- package/assets/loro-ui/icons/bulb.svg +3 -0
- package/assets/loro-ui/icons/calendar.svg +1 -0
- package/assets/loro-ui/icons/camera.svg +3 -0
- package/assets/loro-ui/icons/cart.svg +3 -0
- package/assets/loro-ui/icons/chart-bar.svg +3 -0
- package/assets/loro-ui/icons/chat.svg +3 -0
- package/assets/loro-ui/icons/check.svg +3 -0
- package/assets/loro-ui/icons/checkbox-empty.svg +1 -0
- package/assets/loro-ui/icons/chevron-down.svg +3 -0
- package/assets/loro-ui/icons/chevron-right.svg +3 -0
- package/assets/loro-ui/icons/chevron-up.svg +3 -0
- package/assets/loro-ui/icons/clock.svg +3 -0
- package/assets/loro-ui/icons/download.svg +3 -0
- package/assets/loro-ui/icons/email.svg +1 -0
- package/assets/loro-ui/icons/eye-off.svg +6 -0
- package/assets/loro-ui/icons/eye.svg +1 -0
- package/assets/loro-ui/icons/globe.svg +3 -0
- package/assets/loro-ui/icons/google.svg +1 -0
- package/assets/loro-ui/icons/headset.svg +3 -0
- package/assets/loro-ui/icons/help.svg +3 -0
- package/assets/loro-ui/icons/home.svg +1 -0
- package/assets/loro-ui/icons/info.svg +3 -0
- package/assets/loro-ui/icons/laptop.svg +3 -0
- package/assets/loro-ui/icons/leaf.svg +3 -0
- package/assets/loro-ui/icons/list.svg +1 -0
- package/assets/loro-ui/icons/location.svg +3 -0
- package/assets/loro-ui/icons/lock.svg +1 -0
- package/assets/loro-ui/icons/logout.svg +3 -0
- package/assets/loro-ui/icons/megaphone.svg +3 -0
- package/assets/loro-ui/icons/moon.svg +3 -0
- package/assets/loro-ui/icons/more-vertical.svg +3 -0
- package/assets/loro-ui/icons/nav-compare.svg +4 -0
- package/assets/loro-ui/icons/nav-home.svg +4 -0
- package/assets/loro-ui/icons/nav-list.svg +6 -0
- package/assets/loro-ui/icons/nav-pantry.svg +6 -0
- package/assets/loro-ui/icons/pantry-stock.svg +8 -0
- package/assets/loro-ui/icons/paperclip.svg +3 -0
- package/assets/loro-ui/icons/phone.svg +3 -0
- package/assets/loro-ui/icons/plus-user.svg +1 -0
- package/assets/loro-ui/icons/plus.svg +3 -0
- package/assets/loro-ui/icons/scanner.svg +1 -0
- package/assets/loro-ui/icons/search.svg +3 -0
- package/assets/loro-ui/icons/send.svg +3 -0
- package/assets/loro-ui/icons/settings.svg +1 -0
- package/assets/loro-ui/icons/shelf.svg +1 -0
- package/assets/loro-ui/icons/shield-alert.svg +3 -0
- package/assets/loro-ui/icons/shield.svg +3 -0
- package/assets/loro-ui/icons/star.svg +3 -0
- package/assets/loro-ui/icons/store.svg +3 -0
- package/assets/loro-ui/icons/sun.svg +3 -0
- package/assets/loro-ui/icons/tablet.svg +3 -0
- package/assets/loro-ui/icons/tag.svg +1 -0
- package/assets/loro-ui/icons/tick-circle.svg +3 -0
- package/assets/loro-ui/icons/trash-white.svg +3 -0
- package/assets/loro-ui/icons/trash.svg +3 -0
- package/assets/loro-ui/icons/trend.svg +3 -0
- package/assets/loro-ui/icons/user.svg +1 -0
- package/assets/loro-ui/icons/warning.svg +3 -0
- package/assets/loro-ui/images/al-loro-design-library-home-ai.png +0 -0
- package/assets/loro-ui/images/home-icon-ai.svg +15 -0
- package/assets/loro-ui/images/home-icon-basket.svg +12 -0
- package/assets/loro-ui/images/home-icon-compare.svg +12 -0
- package/assets/loro-ui/images/home-icon-expiry.svg +18 -0
- package/assets/loro-ui/images/home-icon-pantry.svg +18 -0
- package/assets/loro-ui/images/home-icon-scan.svg +11 -0
- package/assets/loro-ui/images/image-home.png +0 -0
- package/assets/loro-ui/images/logo-despensa-buy.png +0 -0
- package/assets/loro-ui/images/logo-list-buy.png +0 -0
- package/assets/loro-ui/images/loro-apaisado-blanco.png +0 -0
- package/assets/loro-ui/images/loro-apaisado.png +0 -0
- package/assets/loro-ui/images/loro-card-buy.png +0 -0
- package/assets/loro-ui/images/loro-card-caducidad.png +0 -0
- package/assets/loro-ui/images/loro-card-comparativa.png +0 -0
- package/assets/loro-ui/images/loro-card-ia.png +0 -0
- package/assets/loro-ui/images/loro-card-qr.png +0 -0
- package/assets/loro-ui/images/loro-despensa.png +0 -0
- package/assets/loro-ui/images/loro-icon-default.png +0 -0
- package/assets/loro-ui/images/loro-spinner-ring.svg +76 -0
- package/assets/loro-ui/images/loro-tittle-sub.png +0 -0
- package/assets/loro-ui/images/pantry-cabinet.svg +12 -0
- package/assets/loro-ui/images/pantry-metric-chart.svg +16 -0
- package/assets/loro-ui/images/product-bananas.svg +6 -0
- package/assets/loro-ui/images/product-milk.svg +6 -0
- package/assets/loro-ui/images/product-pasta.svg +5 -0
- package/assets/loro-ui/images/product-rice.svg +6 -0
- package/assets/loro-ui/images/product-tomatoes.svg +6 -0
- package/assets/loro-ui/images/product-yogurt.svg +6 -0
- package/assets/loro-ui/images/store-ahorramas.svg +1 -0
- package/assets/loro-ui/images/store-alcampo.png +0 -0
- package/assets/loro-ui/images/store-aldi.svg +7 -0
- package/assets/loro-ui/images/store-bonpreu.svg +19 -0
- package/assets/loro-ui/images/store-caprabo.svg +29 -0
- package/assets/loro-ui/images/store-carrefour.svg +43 -0
- package/assets/loro-ui/images/store-consum.png +0 -0
- package/assets/loro-ui/images/store-coviran.png +0 -0
- package/assets/loro-ui/images/store-dia.svg +59 -0
- package/assets/loro-ui/images/store-el-corte-ingles.svg +20 -0
- package/assets/loro-ui/images/store-eroski.png +0 -0
- package/assets/loro-ui/images/store-froiz.svg +1 -0
- package/assets/loro-ui/images/store-gadis.png +0 -0
- package/assets/loro-ui/images/store-lidl.svg +7 -0
- package/assets/loro-ui/images/store-mercadona.svg +17 -0
- package/assets/loro-ui/loro-assets.generated.ts +1009 -0
- package/design-tokens/loro-theme.scss +376 -0
- package/fesm2022/juligc99-loro-ui.mjs +3592 -0
- package/fesm2022/juligc99-loro-ui.mjs.map +1 -0
- package/package.json +83 -0
- package/styles/_breakpoints.scss +28 -0
- package/types/juligc99-loro-ui.d.ts +818 -0
|
@@ -0,0 +1,3592 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, input, output, inject, signal, computed, effect, model, viewChild, Injectable } from '@angular/core';
|
|
3
|
+
import { LoroIcon as LoroIcon$1, LORO_ICON_PATHS, LORO_ICON_LEGACY_NAMES } from '@loro-ui/components/resources/loro-icon/loro-icon';
|
|
4
|
+
import { Toolbar, ToolbarWidget } from '@angular/aria/toolbar';
|
|
5
|
+
import { LoroImage as LoroImage$1 } from '@loro-ui/components/resources/loro-image/loro-image';
|
|
6
|
+
import { LoroHapticsService as LoroHapticsService$1 } from '@loro-ui/services/loro-haptics.service';
|
|
7
|
+
import { LoroButton as LoroButton$1 } from '@loro-ui/components/components/loro-button/loro-button';
|
|
8
|
+
import { RouterLink, Router } from '@angular/router';
|
|
9
|
+
import { LoroBadge as LoroBadge$1 } from '@loro-ui/components/components/loro-badge/loro-badge';
|
|
10
|
+
import { LoroRadio as LoroRadio$1 } from '@loro-ui/components/forms/loro-radio/loro-radio';
|
|
11
|
+
import { LoroToggle as LoroToggle$1 } from '@loro-ui/components/forms/loro-toggle/loro-toggle';
|
|
12
|
+
import { LoroInput as LoroInput$1 } from '@loro-ui/components/forms/loro-input/loro-input';
|
|
13
|
+
import { DecimalPipe, DOCUMENT } from '@angular/common';
|
|
14
|
+
import { LoroNotificationRow as LoroNotificationRow$1 } from '@loro-ui/components/feedback/loro-notification-row/loro-notification-row';
|
|
15
|
+
import { LORO_ICON_LEGACY_NAMES as LORO_ICON_LEGACY_NAMES$1, LORO_ICON_PATHS as LORO_ICON_PATHS$1, LORO_IMAGE_LEGACY_NAMES, LORO_IMAGE_PATHS } from '@loro-ui/assets/loro-assets.generated';
|
|
16
|
+
export { LORO_ICON_ASSETS, LORO_ICON_LEGACY_NAMES, LORO_ICON_PATHS, LORO_IMAGE_ASSETS, LORO_IMAGE_LEGACY_NAMES, LORO_IMAGE_PATHS } from '@loro-ui/assets/loro-assets.generated';
|
|
17
|
+
import { Capacitor } from '@capacitor/core';
|
|
18
|
+
import { ImpactStyle, Haptics, NotificationType } from '@capacitor/haptics';
|
|
19
|
+
|
|
20
|
+
class Footer {
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: Footer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: Footer, isStandalone: true, selector: "loro-footer", ngImport: i0, template: `
|
|
23
|
+
<footer class="loro-footer">
|
|
24
|
+
<div class="loro-footer__meta">
|
|
25
|
+
<span class="loro-footer__dot"></span>
|
|
26
|
+
<p>© 2026 Al Loro App. Todos los derechos reservados.</p>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="loro-footer__links">
|
|
29
|
+
<a href="#">Términos</a>
|
|
30
|
+
<a href="#">Privacidad</a>
|
|
31
|
+
<a href="#">Soporte</a>
|
|
32
|
+
</div>
|
|
33
|
+
</footer>
|
|
34
|
+
`, isInline: true, styles: [".loro-footer{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.75rem;padding-block:1.25rem;border-top:1px solid var(--loro-border-subtle);color:var(--loro-muted);font-size:.75rem}.loro-footer__meta,.loro-footer__links{display:flex;align-items:center;gap:.75rem}.loro-footer__meta{justify-content:center;text-align:center}.loro-footer__dot{width:.375rem;height:.375rem;flex:0 0 auto;border-radius:999px;background:var(--loro-primary-500)}.loro-footer__links{flex-wrap:wrap;justify-content:center;font-weight:600}.loro-footer__links a{color:inherit;text-decoration:none;transition:color .18s ease}.loro-footer__links a:hover{color:var(--loro-primary-500)}.loro-footer p{margin:0}@media(min-width:640px){.loro-footer{flex-direction:row}.loro-footer__meta{text-align:left}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
35
|
+
}
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: Footer, decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{ selector: 'loro-footer', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
39
|
+
<footer class="loro-footer">
|
|
40
|
+
<div class="loro-footer__meta">
|
|
41
|
+
<span class="loro-footer__dot"></span>
|
|
42
|
+
<p>© 2026 Al Loro App. Todos los derechos reservados.</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="loro-footer__links">
|
|
45
|
+
<a href="#">Términos</a>
|
|
46
|
+
<a href="#">Privacidad</a>
|
|
47
|
+
<a href="#">Soporte</a>
|
|
48
|
+
</div>
|
|
49
|
+
</footer>
|
|
50
|
+
`, styles: [".loro-footer{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.75rem;padding-block:1.25rem;border-top:1px solid var(--loro-border-subtle);color:var(--loro-muted);font-size:.75rem}.loro-footer__meta,.loro-footer__links{display:flex;align-items:center;gap:.75rem}.loro-footer__meta{justify-content:center;text-align:center}.loro-footer__dot{width:.375rem;height:.375rem;flex:0 0 auto;border-radius:999px;background:var(--loro-primary-500)}.loro-footer__links{flex-wrap:wrap;justify-content:center;font-weight:600}.loro-footer__links a{color:inherit;text-decoration:none;transition:color .18s ease}.loro-footer__links a:hover{color:var(--loro-primary-500)}.loro-footer p{margin:0}@media(min-width:640px){.loro-footer{flex-direction:row}.loro-footer__meta{text-align:left}}\n"] }]
|
|
51
|
+
}] });
|
|
52
|
+
|
|
53
|
+
class LoroAccordion {
|
|
54
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
55
|
+
icon = input('help', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
56
|
+
expanded = input(false, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
57
|
+
expandedChange = output();
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAccordion, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAccordion, isStandalone: true, selector: "loro-accordion", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandedChange: "expandedChange" }, ngImport: i0, template: `
|
|
60
|
+
<article class="loro-accordion" [class.loro-accordion--open]="expanded()">
|
|
61
|
+
<button type="button" class="loro-accordion__header" (click)="expandedChange.emit(!expanded())">
|
|
62
|
+
@if (icon()) {
|
|
63
|
+
<span class="loro-accordion__icon">
|
|
64
|
+
<loro-icon [name]="icon()!" [size]="24" [alt]="title()" color="primary" />
|
|
65
|
+
</span>
|
|
66
|
+
}
|
|
67
|
+
<span class="loro-accordion__title">{{ title() }}</span>
|
|
68
|
+
<loro-icon [name]="expanded() ? 'chevron-up' : 'chevron-down'" [size]="22" alt="Expandir" color="primary" />
|
|
69
|
+
</button>
|
|
70
|
+
@if (expanded()) {
|
|
71
|
+
<div class="loro-accordion__body">
|
|
72
|
+
<ng-content />
|
|
73
|
+
</div>
|
|
74
|
+
}
|
|
75
|
+
</article>
|
|
76
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-accordion{overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-soft)}.loro-accordion--open{border-color:#6c3cff57}.loro-accordion__header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.9rem;width:100%;min-height:4.3rem;padding:0 1.1rem;border:0;background:transparent;color:var(--loro-text-strong);font:inherit;text-align:left;cursor:pointer}.loro-accordion__icon{display:grid;width:2.6rem;height:2.6rem;place-items:center;border-radius:50%;background:var(--loro-brand-tint-surface)}.loro-accordion__title{font-size:1rem;font-weight:900;line-height:1.25}.loro-accordion__body{padding:0 1.35rem 1.35rem;color:var(--loro-muted-strong);font-size:.94rem;font-weight:600;line-height:1.65}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
77
|
+
}
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAccordion, decorators: [{
|
|
79
|
+
type: Component,
|
|
80
|
+
args: [{ selector: 'loro-accordion', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
81
|
+
<article class="loro-accordion" [class.loro-accordion--open]="expanded()">
|
|
82
|
+
<button type="button" class="loro-accordion__header" (click)="expandedChange.emit(!expanded())">
|
|
83
|
+
@if (icon()) {
|
|
84
|
+
<span class="loro-accordion__icon">
|
|
85
|
+
<loro-icon [name]="icon()!" [size]="24" [alt]="title()" color="primary" />
|
|
86
|
+
</span>
|
|
87
|
+
}
|
|
88
|
+
<span class="loro-accordion__title">{{ title() }}</span>
|
|
89
|
+
<loro-icon [name]="expanded() ? 'chevron-up' : 'chevron-down'" [size]="22" alt="Expandir" color="primary" />
|
|
90
|
+
</button>
|
|
91
|
+
@if (expanded()) {
|
|
92
|
+
<div class="loro-accordion__body">
|
|
93
|
+
<ng-content />
|
|
94
|
+
</div>
|
|
95
|
+
}
|
|
96
|
+
</article>
|
|
97
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-accordion{overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-soft)}.loro-accordion--open{border-color:#6c3cff57}.loro-accordion__header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.9rem;width:100%;min-height:4.3rem;padding:0 1.1rem;border:0;background:transparent;color:var(--loro-text-strong);font:inherit;text-align:left;cursor:pointer}.loro-accordion__icon{display:grid;width:2.6rem;height:2.6rem;place-items:center;border-radius:50%;background:var(--loro-brand-tint-surface)}.loro-accordion__title{font-size:1rem;font-weight:900;line-height:1.25}.loro-accordion__body{padding:0 1.35rem 1.35rem;color:var(--loro-muted-strong);font-size:.94rem;font-weight:600;line-height:1.65}\n"] }]
|
|
98
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], expandedChange: [{ type: i0.Output, args: ["expandedChange"] }] } });
|
|
99
|
+
|
|
100
|
+
const DEFAULT_MAIN_ITEMS = [
|
|
101
|
+
{ id: 'home', label: 'Inicio', icon: 'nav-home', active: true },
|
|
102
|
+
{ id: 'list', label: 'Lista', icon: 'nav-list' },
|
|
103
|
+
{ id: 'scan', label: 'Escanear', icon: 'scanner' },
|
|
104
|
+
{ id: 'compare', label: 'Comparar', icon: 'nav-compare' },
|
|
105
|
+
{ id: 'pantry', label: 'Despensa', icon: 'nav-pantry' },
|
|
106
|
+
];
|
|
107
|
+
const DEFAULT_UTILITY_ITEMS = [
|
|
108
|
+
{ id: 'settings', label: 'Ajustes', icon: 'settings' },
|
|
109
|
+
{ id: 'logout', label: 'Cerrar sesión', icon: 'logout' },
|
|
110
|
+
];
|
|
111
|
+
class LoroAppNav {
|
|
112
|
+
haptics = inject(LoroHapticsService$1);
|
|
113
|
+
draggedMobilePosition = signal(null, ...(ngDevMode ? [{ debugName: "draggedMobilePosition" }] : /* istanbul ignore next */ []));
|
|
114
|
+
draggedMobileIndex = signal(null, ...(ngDevMode ? [{ debugName: "draggedMobileIndex" }] : /* istanbul ignore next */ []));
|
|
115
|
+
activePointerId = null;
|
|
116
|
+
suppressNextMobileClick = false;
|
|
117
|
+
items = input(DEFAULT_MAIN_ITEMS, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
118
|
+
utilityItems = input(DEFAULT_UTILITY_ITEMS, ...(ngDevMode ? [{ debugName: "utilityItems" }] : /* istanbul ignore next */ []));
|
|
119
|
+
ariaLabel = input('Navegación principal', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
120
|
+
showUtilityItems = input(true, ...(ngDevMode ? [{ debugName: "showUtilityItems" }] : /* istanbul ignore next */ []));
|
|
121
|
+
compactDesktop = input(false, ...(ngDevMode ? [{ debugName: "compactDesktop" }] : /* istanbul ignore next */ []));
|
|
122
|
+
itemClick = output();
|
|
123
|
+
utilityItemClick = output();
|
|
124
|
+
navItemClick = output();
|
|
125
|
+
desktopItems = computed(() => this.items().filter((item) => item.id !== 'scan'), ...(ngDevMode ? [{ debugName: "desktopItems" }] : /* istanbul ignore next */ []));
|
|
126
|
+
mobileItems = computed(() => this.items().slice(0, 5), ...(ngDevMode ? [{ debugName: "mobileItems" }] : /* istanbul ignore next */ []));
|
|
127
|
+
mobileVisualSlotCount = computed(() => this.mobileItems().length, ...(ngDevMode ? [{ debugName: "mobileVisualSlotCount" }] : /* istanbul ignore next */ []));
|
|
128
|
+
selectedMobileIndex = computed(() => {
|
|
129
|
+
const index = this.mobileItems().findIndex((item) => item.active);
|
|
130
|
+
return index >= 0 ? index : 0;
|
|
131
|
+
}, ...(ngDevMode ? [{ debugName: "selectedMobileIndex" }] : /* istanbul ignore next */ []));
|
|
132
|
+
mobileSliderPosition = computed(() => this.draggedMobilePosition() ?? this.mobileItemIndexToVisualSlot(this.selectedMobileIndex()), ...(ngDevMode ? [{ debugName: "mobileSliderPosition" }] : /* istanbul ignore next */ []));
|
|
133
|
+
isMobileDragging = computed(() => this.draggedMobilePosition() !== null, ...(ngDevMode ? [{ debugName: "isMobileDragging" }] : /* istanbul ignore next */ []));
|
|
134
|
+
mobileItemCount = computed(() => this.mobileItems().length, ...(ngDevMode ? [{ debugName: "mobileItemCount" }] : /* istanbul ignore next */ []));
|
|
135
|
+
isMobileItemVisualActive(index) {
|
|
136
|
+
// Mientras se arrastra, ningún icono cambia visualmente.
|
|
137
|
+
// El nuevo activo solo se refleja cuando el gesto termina y el padre
|
|
138
|
+
// actualiza el item con active: true.
|
|
139
|
+
return this.selectedMobileIndex() === index;
|
|
140
|
+
}
|
|
141
|
+
onMainItemClick(item) {
|
|
142
|
+
if (item.disabled) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.emitMainItem(item, true);
|
|
146
|
+
}
|
|
147
|
+
onMobileItemClick(item) {
|
|
148
|
+
if (this.suppressNextMobileClick) {
|
|
149
|
+
this.suppressNextMobileClick = false;
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this.onMainItemClick(item);
|
|
153
|
+
}
|
|
154
|
+
onMobilePointerDown(event) {
|
|
155
|
+
if (!event.isPrimary || event.button !== 0 || this.mobileItems().length === 0) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const nav = event.currentTarget;
|
|
159
|
+
this.activePointerId = event.pointerId;
|
|
160
|
+
nav.setPointerCapture(event.pointerId);
|
|
161
|
+
const slotPosition = this.getMobileVisualSlotPosition(event.clientX, nav);
|
|
162
|
+
const index = this.getNearestEnabledMobileIndex(slotPosition);
|
|
163
|
+
if (index === null) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this.draggedMobilePosition.set(slotPosition);
|
|
167
|
+
this.draggedMobileIndex.set(index);
|
|
168
|
+
this.haptics.selection();
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
}
|
|
171
|
+
onMobilePointerMove(event) {
|
|
172
|
+
if (event.pointerId !== this.activePointerId) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const nav = event.currentTarget;
|
|
176
|
+
const slotPosition = this.getMobileVisualSlotPosition(event.clientX, nav);
|
|
177
|
+
const index = this.getNearestEnabledMobileIndex(slotPosition);
|
|
178
|
+
this.draggedMobilePosition.set(slotPosition);
|
|
179
|
+
if (index !== null && index !== this.draggedMobileIndex()) {
|
|
180
|
+
this.draggedMobileIndex.set(index);
|
|
181
|
+
this.haptics.selection();
|
|
182
|
+
}
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
}
|
|
185
|
+
onMobilePointerUp(event) {
|
|
186
|
+
if (event.pointerId !== this.activePointerId) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const nav = event.currentTarget;
|
|
190
|
+
const slotPosition = this.getMobileVisualSlotPosition(event.clientX, nav);
|
|
191
|
+
const index = this.getNearestEnabledMobileIndex(slotPosition) ?? this.draggedMobileIndex();
|
|
192
|
+
this.releaseMobilePointer(nav, event.pointerId);
|
|
193
|
+
if (index === null) {
|
|
194
|
+
this.draggedMobilePosition.set(null);
|
|
195
|
+
this.draggedMobileIndex.set(null);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
const item = this.mobileItems()[index];
|
|
199
|
+
if (!item || item.disabled) {
|
|
200
|
+
this.draggedMobilePosition.set(null);
|
|
201
|
+
this.draggedMobileIndex.set(null);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
// Keep the thumb exactly on the snapped item until the parent applies
|
|
205
|
+
// the new active state, avoiding a visual jump back to the old item.
|
|
206
|
+
this.draggedMobilePosition.set(this.mobileItemIndexToVisualSlot(index));
|
|
207
|
+
this.draggedMobileIndex.set(index);
|
|
208
|
+
this.suppressNextMobileClick = true;
|
|
209
|
+
globalThis.setTimeout(() => {
|
|
210
|
+
this.suppressNextMobileClick = false;
|
|
211
|
+
});
|
|
212
|
+
this.emitMainItem(item, false);
|
|
213
|
+
globalThis.queueMicrotask(() => {
|
|
214
|
+
this.draggedMobilePosition.set(null);
|
|
215
|
+
this.draggedMobileIndex.set(null);
|
|
216
|
+
});
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
}
|
|
219
|
+
onMobilePointerCancel(event) {
|
|
220
|
+
if (event.pointerId !== this.activePointerId) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
this.releaseMobilePointer(event.currentTarget, event.pointerId);
|
|
224
|
+
this.draggedMobilePosition.set(null);
|
|
225
|
+
this.draggedMobileIndex.set(null);
|
|
226
|
+
}
|
|
227
|
+
onUtilityItemClick(item) {
|
|
228
|
+
if (item.disabled) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
this.haptics.impact('light');
|
|
232
|
+
this.utilityItemClick.emit(item);
|
|
233
|
+
this.navItemClick.emit({ item, section: 'utility' });
|
|
234
|
+
}
|
|
235
|
+
emitMainItem(item, withHaptics) {
|
|
236
|
+
if (withHaptics) {
|
|
237
|
+
this.haptics.selection();
|
|
238
|
+
}
|
|
239
|
+
this.itemClick.emit(item);
|
|
240
|
+
this.navItemClick.emit({ item, section: 'main' });
|
|
241
|
+
}
|
|
242
|
+
getMobileVisualSlotPosition(clientX, nav) {
|
|
243
|
+
const slotCount = this.mobileVisualSlotCount();
|
|
244
|
+
if (slotCount <= 1) {
|
|
245
|
+
return 0;
|
|
246
|
+
}
|
|
247
|
+
const rect = nav.getBoundingClientRect();
|
|
248
|
+
const itemWidth = rect.width / slotCount;
|
|
249
|
+
const position = (clientX - rect.left - itemWidth / 2) / itemWidth;
|
|
250
|
+
return Math.min(Math.max(position, 0), slotCount - 1);
|
|
251
|
+
}
|
|
252
|
+
mobileItemGridColumn(index) {
|
|
253
|
+
return index + 1;
|
|
254
|
+
}
|
|
255
|
+
mobileItemIndexToVisualSlot(index) {
|
|
256
|
+
return index;
|
|
257
|
+
}
|
|
258
|
+
getNearestEnabledMobileIndex(slotPosition) {
|
|
259
|
+
const items = this.mobileItems();
|
|
260
|
+
const enabledIndexes = items
|
|
261
|
+
.map((item, index) => ({ item, index }))
|
|
262
|
+
.filter(({ item }) => !item.disabled)
|
|
263
|
+
.map(({ index }) => index);
|
|
264
|
+
if (enabledIndexes.length === 0) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
return enabledIndexes.reduce((nearest, index) => Math.abs(this.mobileItemIndexToVisualSlot(index) - slotPosition) <
|
|
268
|
+
Math.abs(this.mobileItemIndexToVisualSlot(nearest) - slotPosition)
|
|
269
|
+
? index
|
|
270
|
+
: nearest);
|
|
271
|
+
}
|
|
272
|
+
releaseMobilePointer(nav, pointerId) {
|
|
273
|
+
if (nav.hasPointerCapture(pointerId)) {
|
|
274
|
+
nav.releasePointerCapture(pointerId);
|
|
275
|
+
}
|
|
276
|
+
this.activePointerId = null;
|
|
277
|
+
}
|
|
278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAppNav, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
279
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAppNav, isStandalone: true, selector: "loro-app-nav", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, utilityItems: { classPropertyName: "utilityItems", publicName: "utilityItems", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, showUtilityItems: { classPropertyName: "showUtilityItems", publicName: "showUtilityItems", isSignal: true, isRequired: false, transformFunction: null }, compactDesktop: { classPropertyName: "compactDesktop", publicName: "compactDesktop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", utilityItemClick: "utilityItemClick", navItemClick: "navItemClick" }, ngImport: i0, template: "<aside class=\"loro-app-nav\">\n <div class=\"loro-app-nav__desktop\">\n <div class=\"loro-app-nav__surface\" [class.loro-app-nav__surface--compact]=\"compactDesktop()\">\n <div class=\"loro-app-nav__brand\">\n <loro-image\n class=\"loro-app-nav__brand-image\"\n name=\"image-loro-apaisado\"\n alt=\"AlLoro\"\n width=\"10rem\"\n height=\"auto\"\n />\n </div>\n\n <nav class=\"loro-app-nav__nav\" [attr.aria-label]=\"ariaLabel()\">\n @for (item of desktopItems(); track item.id) {\n <loro-button\n class=\"loro-app-nav__item\"\n [class.loro-app-nav__item--active]=\"item.active\"\n [class.loro-app-nav__item--disabled]=\"item.disabled\"\n [class.loro-app-nav__item--logout]=\"item.id === 'logout'\"\n [text]=\"item.label\"\n [icon]=\"item.icon\"\n iconMode=\"with-icon\"\n iconColor=\"default\"\n variant=\"navigation\"\n [selected]=\"!!item.active\"\n [color]=\"item.id === 'logout' ? 'danger' : 'primary'\"\n type=\"button\"\n [fullWidth]=\"true\"\n [ariaLabel]=\"item.label\"\n [disabled]=\"!!item.disabled\"\n (buttonClick)=\"onMainItemClick(item)\"\n >\n @if (item.badge !== null && item.badge !== undefined && item.badge !== '') {\n <span class=\"loro-app-nav__badge\">{{ item.badge }}</span>\n }\n </loro-button>\n }\n </nav>\n\n <div class=\"loro-app-nav__spacer\"></div>\n\n @if (showUtilityItems() && utilityItems().length > 0) {\n <div class=\"loro-app-nav__divider\" aria-hidden=\"true\"></div>\n\n <nav\n class=\"loro-app-nav__nav loro-app-nav__nav--utility\"\n aria-label=\"Navegaci\u00F3n secundaria\"\n >\n @for (item of utilityItems(); track item.id) {\n <loro-button\n class=\"loro-app-nav__item\"\n [class.loro-app-nav__item--active]=\"item.active\"\n [class.loro-app-nav__item--disabled]=\"item.disabled\"\n [class.loro-app-nav__item--logout]=\"item.id === 'logout'\"\n [text]=\"item.label\"\n [icon]=\"item.icon\"\n iconMode=\"with-icon\"\n iconColor=\"default\"\n variant=\"navigation\"\n [selected]=\"!!item.active\"\n [color]=\"item.id === 'logout' ? 'danger' : 'primary'\"\n type=\"button\"\n [fullWidth]=\"true\"\n [ariaLabel]=\"item.label\"\n [disabled]=\"!!item.disabled\"\n (buttonClick)=\"onUtilityItemClick(item)\"\n >\n @if (item.badge !== null && item.badge !== undefined && item.badge !== '') {\n <span class=\"loro-app-nav__badge\">{{ item.badge }}</span>\n }\n </loro-button>\n }\n </nav>\n }\n </div>\n </div>\n\n <nav\n ngToolbar\n class=\"loro-app-nav__mobile\"\n [attr.aria-label]=\"ariaLabel()\"\n [style.--loro-mobile-slider-position]=\"mobileSliderPosition()\"\n [class.loro-app-nav__mobile--dragging]=\"isMobileDragging()\"\n [class.loro-app-nav__mobile--with-labels]=\"true\"\n [style.--loro-mobile-item-count]=\"mobileItemCount()\"\n [style.--loro-mobile-visual-slot-count]=\"mobileVisualSlotCount()\"\n (pointerdown)=\"onMobilePointerDown($event)\"\n (pointermove)=\"onMobilePointerMove($event)\"\n (pointerup)=\"onMobilePointerUp($event)\"\n (pointercancel)=\"onMobilePointerCancel($event)\"\n >\n <span class=\"loro-app-nav__mobile-slider\" aria-hidden=\"true\"></span>\n\n @for (item of mobileItems(); track item.id; let index = $index) {\n <button\n ngToolbarWidget\n type=\"button\"\n class=\"loro-app-nav__mobile-item\"\n [style.grid-column]=\"mobileItemGridColumn(index)\"\n [class.loro-app-nav__mobile-item--active]=\"isMobileItemVisualActive(index)\"\n [class.loro-app-nav__mobile-item--disabled]=\"item.disabled\"\n [attr.aria-label]=\"item.label\"\n [attr.aria-current]=\"item.active ? 'page' : null\"\n [value]=\"item.id\"\n [disabled]=\"!!item.disabled\"\n (click)=\"onMobileItemClick(item)\"\n >\n <loro-icon\n class=\"loro-app-nav__mobile-icon\"\n [name]=\"item.icon\"\n [size]=\"24\"\n color=\"default\"\n [alt]=\"item.label\"\n />\n <span class=\"loro-app-nav__mobile-label\">{{ item.label }}</span>\n </button>\n }\n </nav>\n</aside>\n", styles: [":host{display:block;width:100%;height:100%}.loro-app-nav{width:100%;height:100%}.loro-app-nav__desktop{display:none;height:100%}.loro-app-nav__surface{width:100%;max-width:none;display:flex;height:100%;flex-direction:column;gap:1.1rem;padding:1.75rem 1.35rem 1.5rem;background:var(--loro-nav-desktop-surface, var(--loro-shell-header-surface));border:1px solid var(--loro-nav-desktop-border, var(--loro-border-soft))}html[data-theme=dark] .loro-app-nav__surface{background:var(--loro-nav-desktop-surface, rgba(24, 28, 32, .78));border-color:var(--loro-nav-desktop-border, rgba(255, 255, 255, .08));box-shadow:var(--loro-nav-desktop-shadow, none)}.loro-app-nav__surface--compact{gap:.9rem;padding:1.25rem 1rem 1.15rem}.loro-app-nav__surface--compact .loro-app-nav__brand{min-height:3.65rem;padding-bottom:1.2rem}.loro-app-nav__surface--compact .loro-app-nav__item{--loro-button-min-height: 3.75rem}.loro-app-nav__brand{display:flex;align-items:center;min-height:4.25rem;padding:.35rem .55rem .85rem}.loro-app-nav__brand-image{display:block}.loro-app-nav__nav{display:flex;flex-direction:column;gap:.75rem}.loro-app-nav__item{--loro-button-min-height: 4.25rem;--loro-button-padding: 1rem 1.2rem;--loro-button-radius: 1rem;--loro-button-font-size: 1rem;--loro-button-background: var(--loro-nav-button-background, transparent);--loro-button-border-color: var(--loro-nav-button-border, transparent);--loro-button-color: var(--loro-nav-button-text, var(--loro-text-strong));--loro-button-hover-background: var(--loro-nav-button-hover-bg, var(--loro-nav-hover-bg));--loro-button-hover-border-color: var(--loro-nav-button-hover-border, transparent);--loro-button-hover-color: var(--loro-nav-button-hover-text, var(--loro-nav-button-text, var(--loro-text-strong)));--loro-button-hover-shadow: var(--loro-nav-button-hover-shadow, none);display:block;width:100%;color:var(--loro-nav-button-text, var(--loro-text-strong))}.loro-app-nav__item--active{--loro-button-selected-background: var(--loro-nav-button-active-bg, var(--loro-nav-active-bg));--loro-button-selected-border-color: var(--loro-nav-button-active-border, var(--loro-nav-active-border));--loro-button-selected-color: var(--loro-nav-button-active-text, var(--loro-primary-500));--loro-button-selected-shadow: var(--loro-nav-button-active-shadow, inset .35rem 0 0 var(--loro-primary-500))}.loro-app-nav__item--logout{--loro-button-background: var(--loro-nav-button-danger-bg, var(--loro-danger-surface));--loro-button-border-color: var(--loro-nav-button-danger-border, transparent);--loro-button-color: var(--loro-nav-button-danger-text, var(--loro-danger-text));--loro-button-hover-background: var(--loro-nav-button-danger-bg, var(--loro-danger-surface));--loro-button-hover-border-color: var(--loro-nav-button-danger-border, transparent);--loro-button-hover-color: var(--loro-nav-button-danger-text, var(--loro-danger-text));--loro-button-shadow: none;--loro-button-hover-shadow: none}.loro-app-nav__item--disabled,.loro-app-nav__mobile-item--disabled{cursor:not-allowed;opacity:.45}.loro-app-nav__label,.loro-app-nav__mobile-label{color:inherit}.loro-app-nav__label{font-size:.98rem;font-weight:700;color:inherit}.loro-app-nav__badge{margin-left:auto;min-width:1.5rem;padding:.125rem .5rem;border-radius:999px;background:#ffffff24;color:inherit;font-size:.75rem;font-weight:700;text-align:center;box-shadow:inset 0 1px #ffffff14}.loro-app-nav__spacer{flex:1}.loro-app-nav__divider{height:1px;margin:.65rem 0 .9rem;background:var(--loro-nav-divider)}.loro-app-nav__nav--utility{margin-top:auto}.loro-app-nav__mobile{position:fixed;left:50%;bottom:max(1.25rem,env(safe-area-inset-bottom,0px) * .28);z-index:70;display:grid;grid-template-columns:repeat(var(--loro-mobile-visual-slot-count, 4),minmax(0,1fr));width:min(76vw - max(1rem,var(--app-shell-mobile-gutter, 1rem) * .75),19rem);gap:0;margin:0;transform:translate(-50%);padding:0;overflow:hidden;border:1px solid var(--loro-nav-mobile-border, rgba(43, 35, 80, .08));border-radius:999px;isolation:isolate;background:var(--loro-nav-mobile-glass-surface, rgba(255, 255, 255, .68));box-shadow:var(--loro-nav-mobile-surface-shadow, 0 8px 24px rgba(28, 32, 48, .1));backdrop-filter:blur(var(--loro-nav-mobile-glass-blur, 24px)) saturate(1.32);-webkit-backdrop-filter:blur(var(--loro-nav-mobile-glass-blur, 24px)) saturate(1.32);touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;transition:background .22s ease,border-color .22s ease,box-shadow .22s ease}.loro-app-nav__mobile-item{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:3.58rem;gap:.18rem;padding:.35rem .15rem;border:0;border-radius:999px;outline:0;background:transparent;color:var(--loro-nav-mobile-icon, var(--loro-text));cursor:pointer;appearance:none;-webkit-appearance:none;opacity:1;visibility:visible;transition:transform .22s cubic-bezier(.22,1,.36,1);-webkit-tap-highlight-color:transparent}.loro-app-nav__mobile-item:active,.loro-app-nav__mobile-item--active,.loro-app-nav__mobile-item:hover{background:transparent;color:var(--loro-nav-mobile-icon, var(--loro-text))}.loro-app-nav__mobile-item:focus-visible{outline:2px solid var(--loro-focus-ring);outline-offset:-4px}.loro-app-nav__mobile-item:disabled{cursor:not-allowed;opacity:.45}.loro-app-nav__mobile-icon{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:center;color:inherit!important;opacity:1!important;visibility:visible!important;pointer-events:none;mix-blend-mode:normal;transform:scale(.94);transform-origin:center}.loro-app-nav__mobile-item ::ng-deep .loro-icon,.loro-app-nav__mobile-item ::ng-deep svg{display:block!important;color:inherit!important;opacity:1!important;visibility:visible!important;pointer-events:none!important}.loro-app-nav__mobile-item ::ng-deep .loro-icon__mask{background-color:currentColor!important;opacity:1!important;visibility:visible!important}.loro-app-nav__mobile-item ::ng-deep svg [fill]:not([fill=none]){fill:currentColor!important}.loro-app-nav__mobile-item ::ng-deep svg [stroke]:not([stroke=none]){stroke:currentColor!important}.loro-app-nav__mobile-slider{position:absolute;inset-block:0;left:0;z-index:1;width:calc(100% / var(--loro-mobile-visual-slot-count, 4));border:0;border-radius:999px;background:var(--loro-nav-mobile-indicator, linear-gradient(180deg, rgba(227, 229, 233, .96) 0%, rgba(214, 217, 223, .92) 100%));box-shadow:var(--loro-nav-mobile-indicator-shadow, inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 5px rgba(21, 28, 42, .06));transform:translate3d(calc(var(--loro-mobile-slider-position, 0) * 100%),0,0);will-change:transform;transition:transform .26s cubic-bezier(.22,1,.36,1);pointer-events:none}.loro-app-nav__mobile--dragging .loro-app-nav__mobile-slider{transition:none}.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-icon,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item ::ng-deep .loro-icon,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item ::ng-deep svg{color:var(--loro-nav-mobile-icon, var(--loro-text))!important;opacity:1!important;visibility:visible!important}.loro-app-nav__mobile-label{display:block;max-width:100%;overflow:hidden;color:inherit;font-size:.625rem;font-weight:700;line-height:1.1;text-align:center;text-overflow:ellipsis;white-space:nowrap;opacity:0;transform:translateY(.08rem);transition:opacity .18s ease,transform .18s ease}.loro-app-nav__mobile--with-labels{width:min(92vw - max(1rem,var(--app-shell-mobile-gutter, 1rem) * .75),24rem)}.loro-app-nav__mobile--with-labels .loro-app-nav__mobile-item{min-height:4.4rem;padding-top:.7rem}.loro-app-nav__mobile--with-labels .loro-app-nav__mobile-label{opacity:1;transform:translateY(0)}@media(max-width:479.99px)and (orientation:portrait){:host{height:auto}.loro-app-nav{height:auto;padding:0}.loro-app-nav__desktop{height:auto}}@media(min-width:1024px){:host,.loro-app-nav,.loro-app-nav__desktop{height:100%}.loro-app-nav__desktop{display:block}.loro-app-nav__mobile{display:none}}@media(prefers-reduced-motion:reduce){.loro-app-nav__mobile-slider,.loro-app-nav__mobile-item,.loro-app-nav__mobile-item ::ng-deep .loro-icon{transition-duration:1ms}}\n"], dependencies: [{ kind: "directive", type: Toolbar, selector: "[ngToolbar]", inputs: ["orientation", "softDisabled", "disabled", "wrap", "values"], outputs: ["valuesChange"], exportAs: ["ngToolbar"] }, { kind: "directive", type: ToolbarWidget, selector: "[ngToolbarWidget]", inputs: ["id", "disabled", "value"], exportAs: ["ngToolbarWidget"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }, { kind: "component", type: LoroButton$1, selector: "loro-button", inputs: ["label", "text", "icon", "iconContent", "iconMode", "iconSize", "iconButtonSize", "iconColor", "socialMobileCompact", "selected", "variant", "typeButton", "color", "size", "fullWidth", "buttonWidth", "disabled", "loading", "type", "formId", "ariaLabel", "ariaDescription"], outputs: ["buttonClick", "change", "sanChange"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
280
|
+
}
|
|
281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAppNav, decorators: [{
|
|
282
|
+
type: Component,
|
|
283
|
+
args: [{ selector: 'loro-app-nav', standalone: true, imports: [Toolbar, ToolbarWidget, LoroImage$1, LoroButton$1, LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<aside class=\"loro-app-nav\">\n <div class=\"loro-app-nav__desktop\">\n <div class=\"loro-app-nav__surface\" [class.loro-app-nav__surface--compact]=\"compactDesktop()\">\n <div class=\"loro-app-nav__brand\">\n <loro-image\n class=\"loro-app-nav__brand-image\"\n name=\"image-loro-apaisado\"\n alt=\"AlLoro\"\n width=\"10rem\"\n height=\"auto\"\n />\n </div>\n\n <nav class=\"loro-app-nav__nav\" [attr.aria-label]=\"ariaLabel()\">\n @for (item of desktopItems(); track item.id) {\n <loro-button\n class=\"loro-app-nav__item\"\n [class.loro-app-nav__item--active]=\"item.active\"\n [class.loro-app-nav__item--disabled]=\"item.disabled\"\n [class.loro-app-nav__item--logout]=\"item.id === 'logout'\"\n [text]=\"item.label\"\n [icon]=\"item.icon\"\n iconMode=\"with-icon\"\n iconColor=\"default\"\n variant=\"navigation\"\n [selected]=\"!!item.active\"\n [color]=\"item.id === 'logout' ? 'danger' : 'primary'\"\n type=\"button\"\n [fullWidth]=\"true\"\n [ariaLabel]=\"item.label\"\n [disabled]=\"!!item.disabled\"\n (buttonClick)=\"onMainItemClick(item)\"\n >\n @if (item.badge !== null && item.badge !== undefined && item.badge !== '') {\n <span class=\"loro-app-nav__badge\">{{ item.badge }}</span>\n }\n </loro-button>\n }\n </nav>\n\n <div class=\"loro-app-nav__spacer\"></div>\n\n @if (showUtilityItems() && utilityItems().length > 0) {\n <div class=\"loro-app-nav__divider\" aria-hidden=\"true\"></div>\n\n <nav\n class=\"loro-app-nav__nav loro-app-nav__nav--utility\"\n aria-label=\"Navegaci\u00F3n secundaria\"\n >\n @for (item of utilityItems(); track item.id) {\n <loro-button\n class=\"loro-app-nav__item\"\n [class.loro-app-nav__item--active]=\"item.active\"\n [class.loro-app-nav__item--disabled]=\"item.disabled\"\n [class.loro-app-nav__item--logout]=\"item.id === 'logout'\"\n [text]=\"item.label\"\n [icon]=\"item.icon\"\n iconMode=\"with-icon\"\n iconColor=\"default\"\n variant=\"navigation\"\n [selected]=\"!!item.active\"\n [color]=\"item.id === 'logout' ? 'danger' : 'primary'\"\n type=\"button\"\n [fullWidth]=\"true\"\n [ariaLabel]=\"item.label\"\n [disabled]=\"!!item.disabled\"\n (buttonClick)=\"onUtilityItemClick(item)\"\n >\n @if (item.badge !== null && item.badge !== undefined && item.badge !== '') {\n <span class=\"loro-app-nav__badge\">{{ item.badge }}</span>\n }\n </loro-button>\n }\n </nav>\n }\n </div>\n </div>\n\n <nav\n ngToolbar\n class=\"loro-app-nav__mobile\"\n [attr.aria-label]=\"ariaLabel()\"\n [style.--loro-mobile-slider-position]=\"mobileSliderPosition()\"\n [class.loro-app-nav__mobile--dragging]=\"isMobileDragging()\"\n [class.loro-app-nav__mobile--with-labels]=\"true\"\n [style.--loro-mobile-item-count]=\"mobileItemCount()\"\n [style.--loro-mobile-visual-slot-count]=\"mobileVisualSlotCount()\"\n (pointerdown)=\"onMobilePointerDown($event)\"\n (pointermove)=\"onMobilePointerMove($event)\"\n (pointerup)=\"onMobilePointerUp($event)\"\n (pointercancel)=\"onMobilePointerCancel($event)\"\n >\n <span class=\"loro-app-nav__mobile-slider\" aria-hidden=\"true\"></span>\n\n @for (item of mobileItems(); track item.id; let index = $index) {\n <button\n ngToolbarWidget\n type=\"button\"\n class=\"loro-app-nav__mobile-item\"\n [style.grid-column]=\"mobileItemGridColumn(index)\"\n [class.loro-app-nav__mobile-item--active]=\"isMobileItemVisualActive(index)\"\n [class.loro-app-nav__mobile-item--disabled]=\"item.disabled\"\n [attr.aria-label]=\"item.label\"\n [attr.aria-current]=\"item.active ? 'page' : null\"\n [value]=\"item.id\"\n [disabled]=\"!!item.disabled\"\n (click)=\"onMobileItemClick(item)\"\n >\n <loro-icon\n class=\"loro-app-nav__mobile-icon\"\n [name]=\"item.icon\"\n [size]=\"24\"\n color=\"default\"\n [alt]=\"item.label\"\n />\n <span class=\"loro-app-nav__mobile-label\">{{ item.label }}</span>\n </button>\n }\n </nav>\n</aside>\n", styles: [":host{display:block;width:100%;height:100%}.loro-app-nav{width:100%;height:100%}.loro-app-nav__desktop{display:none;height:100%}.loro-app-nav__surface{width:100%;max-width:none;display:flex;height:100%;flex-direction:column;gap:1.1rem;padding:1.75rem 1.35rem 1.5rem;background:var(--loro-nav-desktop-surface, var(--loro-shell-header-surface));border:1px solid var(--loro-nav-desktop-border, var(--loro-border-soft))}html[data-theme=dark] .loro-app-nav__surface{background:var(--loro-nav-desktop-surface, rgba(24, 28, 32, .78));border-color:var(--loro-nav-desktop-border, rgba(255, 255, 255, .08));box-shadow:var(--loro-nav-desktop-shadow, none)}.loro-app-nav__surface--compact{gap:.9rem;padding:1.25rem 1rem 1.15rem}.loro-app-nav__surface--compact .loro-app-nav__brand{min-height:3.65rem;padding-bottom:1.2rem}.loro-app-nav__surface--compact .loro-app-nav__item{--loro-button-min-height: 3.75rem}.loro-app-nav__brand{display:flex;align-items:center;min-height:4.25rem;padding:.35rem .55rem .85rem}.loro-app-nav__brand-image{display:block}.loro-app-nav__nav{display:flex;flex-direction:column;gap:.75rem}.loro-app-nav__item{--loro-button-min-height: 4.25rem;--loro-button-padding: 1rem 1.2rem;--loro-button-radius: 1rem;--loro-button-font-size: 1rem;--loro-button-background: var(--loro-nav-button-background, transparent);--loro-button-border-color: var(--loro-nav-button-border, transparent);--loro-button-color: var(--loro-nav-button-text, var(--loro-text-strong));--loro-button-hover-background: var(--loro-nav-button-hover-bg, var(--loro-nav-hover-bg));--loro-button-hover-border-color: var(--loro-nav-button-hover-border, transparent);--loro-button-hover-color: var(--loro-nav-button-hover-text, var(--loro-nav-button-text, var(--loro-text-strong)));--loro-button-hover-shadow: var(--loro-nav-button-hover-shadow, none);display:block;width:100%;color:var(--loro-nav-button-text, var(--loro-text-strong))}.loro-app-nav__item--active{--loro-button-selected-background: var(--loro-nav-button-active-bg, var(--loro-nav-active-bg));--loro-button-selected-border-color: var(--loro-nav-button-active-border, var(--loro-nav-active-border));--loro-button-selected-color: var(--loro-nav-button-active-text, var(--loro-primary-500));--loro-button-selected-shadow: var(--loro-nav-button-active-shadow, inset .35rem 0 0 var(--loro-primary-500))}.loro-app-nav__item--logout{--loro-button-background: var(--loro-nav-button-danger-bg, var(--loro-danger-surface));--loro-button-border-color: var(--loro-nav-button-danger-border, transparent);--loro-button-color: var(--loro-nav-button-danger-text, var(--loro-danger-text));--loro-button-hover-background: var(--loro-nav-button-danger-bg, var(--loro-danger-surface));--loro-button-hover-border-color: var(--loro-nav-button-danger-border, transparent);--loro-button-hover-color: var(--loro-nav-button-danger-text, var(--loro-danger-text));--loro-button-shadow: none;--loro-button-hover-shadow: none}.loro-app-nav__item--disabled,.loro-app-nav__mobile-item--disabled{cursor:not-allowed;opacity:.45}.loro-app-nav__label,.loro-app-nav__mobile-label{color:inherit}.loro-app-nav__label{font-size:.98rem;font-weight:700;color:inherit}.loro-app-nav__badge{margin-left:auto;min-width:1.5rem;padding:.125rem .5rem;border-radius:999px;background:#ffffff24;color:inherit;font-size:.75rem;font-weight:700;text-align:center;box-shadow:inset 0 1px #ffffff14}.loro-app-nav__spacer{flex:1}.loro-app-nav__divider{height:1px;margin:.65rem 0 .9rem;background:var(--loro-nav-divider)}.loro-app-nav__nav--utility{margin-top:auto}.loro-app-nav__mobile{position:fixed;left:50%;bottom:max(1.25rem,env(safe-area-inset-bottom,0px) * .28);z-index:70;display:grid;grid-template-columns:repeat(var(--loro-mobile-visual-slot-count, 4),minmax(0,1fr));width:min(76vw - max(1rem,var(--app-shell-mobile-gutter, 1rem) * .75),19rem);gap:0;margin:0;transform:translate(-50%);padding:0;overflow:hidden;border:1px solid var(--loro-nav-mobile-border, rgba(43, 35, 80, .08));border-radius:999px;isolation:isolate;background:var(--loro-nav-mobile-glass-surface, rgba(255, 255, 255, .68));box-shadow:var(--loro-nav-mobile-surface-shadow, 0 8px 24px rgba(28, 32, 48, .1));backdrop-filter:blur(var(--loro-nav-mobile-glass-blur, 24px)) saturate(1.32);-webkit-backdrop-filter:blur(var(--loro-nav-mobile-glass-blur, 24px)) saturate(1.32);touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;transition:background .22s ease,border-color .22s ease,box-shadow .22s ease}.loro-app-nav__mobile-item{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:3.58rem;gap:.18rem;padding:.35rem .15rem;border:0;border-radius:999px;outline:0;background:transparent;color:var(--loro-nav-mobile-icon, var(--loro-text));cursor:pointer;appearance:none;-webkit-appearance:none;opacity:1;visibility:visible;transition:transform .22s cubic-bezier(.22,1,.36,1);-webkit-tap-highlight-color:transparent}.loro-app-nav__mobile-item:active,.loro-app-nav__mobile-item--active,.loro-app-nav__mobile-item:hover{background:transparent;color:var(--loro-nav-mobile-icon, var(--loro-text))}.loro-app-nav__mobile-item:focus-visible{outline:2px solid var(--loro-focus-ring);outline-offset:-4px}.loro-app-nav__mobile-item:disabled{cursor:not-allowed;opacity:.45}.loro-app-nav__mobile-icon{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:center;color:inherit!important;opacity:1!important;visibility:visible!important;pointer-events:none;mix-blend-mode:normal;transform:scale(.94);transform-origin:center}.loro-app-nav__mobile-item ::ng-deep .loro-icon,.loro-app-nav__mobile-item ::ng-deep svg{display:block!important;color:inherit!important;opacity:1!important;visibility:visible!important;pointer-events:none!important}.loro-app-nav__mobile-item ::ng-deep .loro-icon__mask{background-color:currentColor!important;opacity:1!important;visibility:visible!important}.loro-app-nav__mobile-item ::ng-deep svg [fill]:not([fill=none]){fill:currentColor!important}.loro-app-nav__mobile-item ::ng-deep svg [stroke]:not([stroke=none]){stroke:currentColor!important}.loro-app-nav__mobile-slider{position:absolute;inset-block:0;left:0;z-index:1;width:calc(100% / var(--loro-mobile-visual-slot-count, 4));border:0;border-radius:999px;background:var(--loro-nav-mobile-indicator, linear-gradient(180deg, rgba(227, 229, 233, .96) 0%, rgba(214, 217, 223, .92) 100%));box-shadow:var(--loro-nav-mobile-indicator-shadow, inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 5px rgba(21, 28, 42, .06));transform:translate3d(calc(var(--loro-mobile-slider-position, 0) * 100%),0,0);will-change:transform;transition:transform .26s cubic-bezier(.22,1,.36,1);pointer-events:none}.loro-app-nav__mobile--dragging .loro-app-nav__mobile-slider{transition:none}.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-icon,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item ::ng-deep .loro-icon,.loro-app-nav__mobile--dragging .loro-app-nav__mobile-item ::ng-deep svg{color:var(--loro-nav-mobile-icon, var(--loro-text))!important;opacity:1!important;visibility:visible!important}.loro-app-nav__mobile-label{display:block;max-width:100%;overflow:hidden;color:inherit;font-size:.625rem;font-weight:700;line-height:1.1;text-align:center;text-overflow:ellipsis;white-space:nowrap;opacity:0;transform:translateY(.08rem);transition:opacity .18s ease,transform .18s ease}.loro-app-nav__mobile--with-labels{width:min(92vw - max(1rem,var(--app-shell-mobile-gutter, 1rem) * .75),24rem)}.loro-app-nav__mobile--with-labels .loro-app-nav__mobile-item{min-height:4.4rem;padding-top:.7rem}.loro-app-nav__mobile--with-labels .loro-app-nav__mobile-label{opacity:1;transform:translateY(0)}@media(max-width:479.99px)and (orientation:portrait){:host{height:auto}.loro-app-nav{height:auto;padding:0}.loro-app-nav__desktop{height:auto}}@media(min-width:1024px){:host,.loro-app-nav,.loro-app-nav__desktop{height:100%}.loro-app-nav__desktop{display:block}.loro-app-nav__mobile{display:none}}@media(prefers-reduced-motion:reduce){.loro-app-nav__mobile-slider,.loro-app-nav__mobile-item,.loro-app-nav__mobile-item ::ng-deep .loro-icon{transition-duration:1ms}}\n"] }]
|
|
284
|
+
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], utilityItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "utilityItems", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], showUtilityItems: [{ type: i0.Input, args: [{ isSignal: true, alias: "showUtilityItems", required: false }] }], compactDesktop: [{ type: i0.Input, args: [{ isSignal: true, alias: "compactDesktop", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], utilityItemClick: [{ type: i0.Output, args: ["utilityItemClick"] }], navItemClick: [{ type: i0.Output, args: ["navItemClick"] }] } });
|
|
285
|
+
|
|
286
|
+
class LoroAssistantCard {
|
|
287
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
288
|
+
description = input.required(...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
289
|
+
imageName = input(null, ...(ngDevMode ? [{ debugName: "imageName" }] : /* istanbul ignore next */ []));
|
|
290
|
+
icon = input('headset', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
291
|
+
actionLabel = input('', ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
292
|
+
actionIcon = input('chat', ...(ngDevMode ? [{ debugName: "actionIcon" }] : /* istanbul ignore next */ []));
|
|
293
|
+
actionVariant = input('primary', ...(ngDevMode ? [{ debugName: "actionVariant" }] : /* istanbul ignore next */ []));
|
|
294
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAssistantCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
295
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAssistantCard, isStandalone: true, selector: "loro-assistant-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: true, transformFunction: null }, imageName: { classPropertyName: "imageName", publicName: "imageName", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, actionIcon: { classPropertyName: "actionIcon", publicName: "actionIcon", isSignal: true, isRequired: false, transformFunction: null }, actionVariant: { classPropertyName: "actionVariant", publicName: "actionVariant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
296
|
+
<section class="loro-assistant-card">
|
|
297
|
+
<div class="loro-assistant-card__media">
|
|
298
|
+
@if (imageName()) {
|
|
299
|
+
<loro-image [name]="imageName()!" [alt]="title()" width="100%" />
|
|
300
|
+
} @else {
|
|
301
|
+
<loro-icon [name]="icon()" [size]="56" [alt]="title()" color="primary" />
|
|
302
|
+
}
|
|
303
|
+
</div>
|
|
304
|
+
<div class="loro-assistant-card__copy">
|
|
305
|
+
<h2>{{ title() }}</h2>
|
|
306
|
+
<p>{{ description() }}</p>
|
|
307
|
+
</div>
|
|
308
|
+
@if (actionLabel()) {
|
|
309
|
+
<loro-button
|
|
310
|
+
[label]="actionLabel()"
|
|
311
|
+
[icon]="actionIcon()"
|
|
312
|
+
[variant]="actionVariant()"
|
|
313
|
+
[fullWidth]="true" />
|
|
314
|
+
}
|
|
315
|
+
</section>
|
|
316
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-assistant-card{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(12rem,auto);align-items:center;gap:1.5rem;padding:1.35rem 1.5rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-assistant-card__media{display:grid;width:6rem;height:5rem;place-items:center;overflow:hidden}.loro-assistant-card__copy{min-width:0}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:1.2rem;font-weight:900;line-height:1.2}p{margin-top:.35rem;color:var(--loro-muted);font-weight:650;line-height:1.45}@media(max-width:680px){.loro-assistant-card{grid-template-columns:auto minmax(0,1fr)}loro-button{grid-column:1 / -1}}\n"], dependencies: [{ kind: "component", type: LoroButton$1, selector: "loro-button", inputs: ["label", "text", "icon", "iconContent", "iconMode", "iconSize", "iconButtonSize", "iconColor", "socialMobileCompact", "selected", "variant", "typeButton", "color", "size", "fullWidth", "buttonWidth", "disabled", "loading", "type", "formId", "ariaLabel", "ariaDescription"], outputs: ["buttonClick", "change", "sanChange"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
317
|
+
}
|
|
318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAssistantCard, decorators: [{
|
|
319
|
+
type: Component,
|
|
320
|
+
args: [{ selector: 'loro-assistant-card', standalone: true, imports: [LoroButton$1, LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
321
|
+
<section class="loro-assistant-card">
|
|
322
|
+
<div class="loro-assistant-card__media">
|
|
323
|
+
@if (imageName()) {
|
|
324
|
+
<loro-image [name]="imageName()!" [alt]="title()" width="100%" />
|
|
325
|
+
} @else {
|
|
326
|
+
<loro-icon [name]="icon()" [size]="56" [alt]="title()" color="primary" />
|
|
327
|
+
}
|
|
328
|
+
</div>
|
|
329
|
+
<div class="loro-assistant-card__copy">
|
|
330
|
+
<h2>{{ title() }}</h2>
|
|
331
|
+
<p>{{ description() }}</p>
|
|
332
|
+
</div>
|
|
333
|
+
@if (actionLabel()) {
|
|
334
|
+
<loro-button
|
|
335
|
+
[label]="actionLabel()"
|
|
336
|
+
[icon]="actionIcon()"
|
|
337
|
+
[variant]="actionVariant()"
|
|
338
|
+
[fullWidth]="true" />
|
|
339
|
+
}
|
|
340
|
+
</section>
|
|
341
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-assistant-card{display:grid;grid-template-columns:auto minmax(0,1fr) minmax(12rem,auto);align-items:center;gap:1.5rem;padding:1.35rem 1.5rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-assistant-card__media{display:grid;width:6rem;height:5rem;place-items:center;overflow:hidden}.loro-assistant-card__copy{min-width:0}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:1.2rem;font-weight:900;line-height:1.2}p{margin-top:.35rem;color:var(--loro-muted);font-weight:650;line-height:1.45}@media(max-width:680px){.loro-assistant-card{grid-template-columns:auto minmax(0,1fr)}loro-button{grid-column:1 / -1}}\n"] }]
|
|
342
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: true }] }], imageName: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageName", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], actionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionIcon", required: false }] }], actionVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionVariant", required: false }] }] } });
|
|
343
|
+
|
|
344
|
+
function isNativeSocialIcon(icon) {
|
|
345
|
+
return icon === 'apple' || icon === 'google';
|
|
346
|
+
}
|
|
347
|
+
class LoroAuthSocialButton {
|
|
348
|
+
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
349
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
350
|
+
outline = input(false, ...(ngDevMode ? [{ debugName: "outline" }] : /* istanbul ignore next */ []));
|
|
351
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
352
|
+
iconSize = input(44, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
353
|
+
nativeIconSrc = computed(() => {
|
|
354
|
+
const icon = this.icon();
|
|
355
|
+
if (!isNativeSocialIcon(icon)) {
|
|
356
|
+
return '';
|
|
357
|
+
}
|
|
358
|
+
return LORO_ICON_PATHS[LORO_ICON_LEGACY_NAMES[icon]];
|
|
359
|
+
}, ...(ngDevMode ? [{ debugName: "nativeIconSrc" }] : /* istanbul ignore next */ []));
|
|
360
|
+
releaseFocus(event) {
|
|
361
|
+
const target = event.currentTarget;
|
|
362
|
+
if (target instanceof HTMLButtonElement) {
|
|
363
|
+
target.blur();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAuthSocialButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
367
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAuthSocialButton, isStandalone: true, selector: "loro-auth-social-button", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
368
|
+
<button
|
|
369
|
+
type="button"
|
|
370
|
+
class="loro-auth-social-button"
|
|
371
|
+
[class.loro-auth-social-button--outline]="outline()"
|
|
372
|
+
[class.loro-auth-social-button--selected]="selected()"
|
|
373
|
+
(click)="releaseFocus($event)"
|
|
374
|
+
>
|
|
375
|
+
@if (nativeIconSrc()) {
|
|
376
|
+
<img
|
|
377
|
+
class="loro-auth-social-button__native-icon"
|
|
378
|
+
[src]="nativeIconSrc()"
|
|
379
|
+
alt=""
|
|
380
|
+
aria-hidden="true"
|
|
381
|
+
[style.width.px]="iconSize()"
|
|
382
|
+
[style.height.px]="iconSize()"
|
|
383
|
+
/>
|
|
384
|
+
} @else {
|
|
385
|
+
<loro-icon [name]="icon()" [size]="iconSize()" [alt]="label()" />
|
|
386
|
+
}
|
|
387
|
+
<span>{{ label() }}</span>
|
|
388
|
+
</button>
|
|
389
|
+
`, isInline: true, styles: [":host{display:block}.loro-auth-social-button{display:flex;width:100%;align-items:center;justify-content:center;gap:.8rem;border:1px solid var(--loro-border-subtle);border-radius:.9rem;background:var(--loro-surface);min-height:3.25rem;padding:.78rem 1rem;box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font:inherit;font-family:var(--loro-font-brand);font-size:.92rem;font-weight:800;cursor:pointer;text-align:center;transition:border-color .18s ease,box-shadow .18s ease,transform .12s ease,background .12s ease}.loro-auth-social-button:hover,.loro-auth-social-button:focus-visible{border-color:var(--loro-auth-field-active-border, var(--loro-primary-500));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-social-button:active{background:color-mix(in srgb,var(--loro-primary-500) 6%,var(--loro-surface));transform:scale(.985)}.loro-auth-social-button loro-icon{transform:scale(.82)}.loro-auth-social-button__native-icon{flex:0 0 auto;object-fit:contain}.loro-auth-social-button--outline{border:2px solid var(--loro-primary-500);box-shadow:none;color:var(--loro-primary-500);background:transparent}.loro-auth-social-button--outline:hover,.loro-auth-social-button--outline:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-social-button--outline:active{background:color-mix(in srgb,var(--loro-primary-500) 8%,transparent)}@media(min-width:1024px){.loro-auth-social-button{min-height:3rem;padding:.65rem 1rem;font-size:.86rem}.loro-auth-social-button--outline{font-size:.92rem}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
390
|
+
}
|
|
391
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAuthSocialButton, decorators: [{
|
|
392
|
+
type: Component,
|
|
393
|
+
args: [{ selector: 'loro-auth-social-button', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
394
|
+
<button
|
|
395
|
+
type="button"
|
|
396
|
+
class="loro-auth-social-button"
|
|
397
|
+
[class.loro-auth-social-button--outline]="outline()"
|
|
398
|
+
[class.loro-auth-social-button--selected]="selected()"
|
|
399
|
+
(click)="releaseFocus($event)"
|
|
400
|
+
>
|
|
401
|
+
@if (nativeIconSrc()) {
|
|
402
|
+
<img
|
|
403
|
+
class="loro-auth-social-button__native-icon"
|
|
404
|
+
[src]="nativeIconSrc()"
|
|
405
|
+
alt=""
|
|
406
|
+
aria-hidden="true"
|
|
407
|
+
[style.width.px]="iconSize()"
|
|
408
|
+
[style.height.px]="iconSize()"
|
|
409
|
+
/>
|
|
410
|
+
} @else {
|
|
411
|
+
<loro-icon [name]="icon()" [size]="iconSize()" [alt]="label()" />
|
|
412
|
+
}
|
|
413
|
+
<span>{{ label() }}</span>
|
|
414
|
+
</button>
|
|
415
|
+
`, styles: [":host{display:block}.loro-auth-social-button{display:flex;width:100%;align-items:center;justify-content:center;gap:.8rem;border:1px solid var(--loro-border-subtle);border-radius:.9rem;background:var(--loro-surface);min-height:3.25rem;padding:.78rem 1rem;box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font:inherit;font-family:var(--loro-font-brand);font-size:.92rem;font-weight:800;cursor:pointer;text-align:center;transition:border-color .18s ease,box-shadow .18s ease,transform .12s ease,background .12s ease}.loro-auth-social-button:hover,.loro-auth-social-button:focus-visible{border-color:var(--loro-auth-field-active-border, var(--loro-primary-500));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-social-button:active{background:color-mix(in srgb,var(--loro-primary-500) 6%,var(--loro-surface));transform:scale(.985)}.loro-auth-social-button loro-icon{transform:scale(.82)}.loro-auth-social-button__native-icon{flex:0 0 auto;object-fit:contain}.loro-auth-social-button--outline{border:2px solid var(--loro-primary-500);box-shadow:none;color:var(--loro-primary-500);background:transparent}.loro-auth-social-button--outline:hover,.loro-auth-social-button--outline:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-social-button--outline:active{background:color-mix(in srgb,var(--loro-primary-500) 8%,transparent)}@media(min-width:1024px){.loro-auth-social-button{min-height:3rem;padding:.65rem 1rem;font-size:.86rem}.loro-auth-social-button--outline{font-size:.92rem}}\n"] }]
|
|
416
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], outline: [{ type: i0.Input, args: [{ isSignal: true, alias: "outline", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }] } });
|
|
417
|
+
|
|
418
|
+
class LoroBadge {
|
|
419
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
420
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
421
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroBadge, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
422
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: LoroBadge, isStandalone: true, selector: "loro-badge", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<span class="loro-badge" [class]="'loro-badge loro-badge--' + variant()">{{ label() }}</span>`, isInline: true, styles: [":host{display:inline-flex;min-width:0;font-family:var(--loro-font-brand)}.loro-badge{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:1.75rem;padding:.25rem .7rem;border:1px solid transparent;border-radius:var(--loro-radius-pill);font-size:.82rem;font-weight:800;line-height:1.1;white-space:nowrap}.loro-badge--success{border-color:#1f9d5533;background:#1f9d551f;color:#1f9d55}.loro-badge--error{border-color:#dc26262e;background:#dc26261a;color:#dc2626}.loro-badge--info{border-color:#6c3cff2e;background:#6c3cff1a;color:var(--loro-primary-700)}.loro-badge--warning{border-color:#f5a80038;background:#f5a8001f;color:#986c00}.loro-badge--neutral{border-color:var(--loro-border-soft);background:var(--loro-surface-muted);color:var(--loro-muted-strong)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
423
|
+
}
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroBadge, decorators: [{
|
|
425
|
+
type: Component,
|
|
426
|
+
args: [{ selector: 'loro-badge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `<span class="loro-badge" [class]="'loro-badge loro-badge--' + variant()">{{ label() }}</span>`, styles: [":host{display:inline-flex;min-width:0;font-family:var(--loro-font-brand)}.loro-badge{display:inline-flex;align-items:center;justify-content:center;max-width:100%;min-height:1.75rem;padding:.25rem .7rem;border:1px solid transparent;border-radius:var(--loro-radius-pill);font-size:.82rem;font-weight:800;line-height:1.1;white-space:nowrap}.loro-badge--success{border-color:#1f9d5533;background:#1f9d551f;color:#1f9d55}.loro-badge--error{border-color:#dc26262e;background:#dc26261a;color:#dc2626}.loro-badge--info{border-color:#6c3cff2e;background:#6c3cff1a;color:var(--loro-primary-700)}.loro-badge--warning{border-color:#f5a80038;background:#f5a8001f;color:#986c00}.loro-badge--neutral{border-color:var(--loro-border-soft);background:var(--loro-surface-muted);color:var(--loro-muted-strong)}\n"] }]
|
|
427
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
428
|
+
|
|
429
|
+
class LoroButton {
|
|
430
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
431
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
432
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
433
|
+
iconContent = input(null, ...(ngDevMode ? [{ debugName: "iconContent" }] : /* istanbul ignore next */ []));
|
|
434
|
+
iconMode = input('none', ...(ngDevMode ? [{ debugName: "iconMode" }] : /* istanbul ignore next */ []));
|
|
435
|
+
iconSize = input(23, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
436
|
+
iconButtonSize = input(null, ...(ngDevMode ? [{ debugName: "iconButtonSize" }] : /* istanbul ignore next */ []));
|
|
437
|
+
iconColor = input('', ...(ngDevMode ? [{ debugName: "iconColor" }] : /* istanbul ignore next */ []));
|
|
438
|
+
socialMobileCompact = input(true, ...(ngDevMode ? [{ debugName: "socialMobileCompact" }] : /* istanbul ignore next */ []));
|
|
439
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
440
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
441
|
+
typeButton = input('primary', ...(ngDevMode ? [{ debugName: "typeButton" }] : /* istanbul ignore next */ []));
|
|
442
|
+
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
443
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
444
|
+
fullWidth = input(false, ...(ngDevMode ? [{ debugName: "fullWidth" }] : /* istanbul ignore next */ []));
|
|
445
|
+
buttonWidth = input('fit-content', ...(ngDevMode ? [{ debugName: "buttonWidth" }] : /* istanbul ignore next */ []));
|
|
446
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
447
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
448
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
449
|
+
formId = input('', ...(ngDevMode ? [{ debugName: "formId" }] : /* istanbul ignore next */ []));
|
|
450
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
451
|
+
ariaDescription = input('', ...(ngDevMode ? [{ debugName: "ariaDescription" }] : /* istanbul ignore next */ []));
|
|
452
|
+
buttonClick = output();
|
|
453
|
+
change = output();
|
|
454
|
+
sanChange = output();
|
|
455
|
+
resolvedText = computed(() => this.text() || this.label(), ...(ngDevMode ? [{ debugName: "resolvedText" }] : /* istanbul ignore next */ []));
|
|
456
|
+
resolvedIcon = computed(() => {
|
|
457
|
+
const icon = this.icon();
|
|
458
|
+
if (this.isIconMode(icon))
|
|
459
|
+
return this.iconContent();
|
|
460
|
+
return this.iconContent() ?? icon;
|
|
461
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
|
|
462
|
+
resolvedIconMode = computed(() => {
|
|
463
|
+
const icon = this.icon();
|
|
464
|
+
if (this.isIconMode(icon))
|
|
465
|
+
return icon;
|
|
466
|
+
if (this.iconMode() !== 'none')
|
|
467
|
+
return this.iconMode();
|
|
468
|
+
return this.resolvedIcon() ? 'with-icon' : 'none';
|
|
469
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIconMode" }] : /* istanbul ignore next */ []));
|
|
470
|
+
resolvedButtonWidth = computed(() => this.fullWidth() ? 'full' : this.buttonWidth(), ...(ngDevMode ? [{ debugName: "resolvedButtonWidth" }] : /* istanbul ignore next */ []));
|
|
471
|
+
resolvedIconButtonSize = computed(() => {
|
|
472
|
+
const customSize = this.iconButtonSize();
|
|
473
|
+
if (typeof customSize === 'number' && customSize > 0)
|
|
474
|
+
return `${customSize}px`;
|
|
475
|
+
if (typeof customSize === 'string' && customSize.trim().length > 0)
|
|
476
|
+
return customSize;
|
|
477
|
+
switch (this.size()) {
|
|
478
|
+
case 'sm':
|
|
479
|
+
return '44px';
|
|
480
|
+
case 'lg':
|
|
481
|
+
return '60px';
|
|
482
|
+
default:
|
|
483
|
+
return '48px';
|
|
484
|
+
}
|
|
485
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIconButtonSize" }] : /* istanbul ignore next */ []));
|
|
486
|
+
resolvedTypeButton = computed(() => {
|
|
487
|
+
const variantMap = {
|
|
488
|
+
outline: 'secondary',
|
|
489
|
+
ghost: 'tertiary',
|
|
490
|
+
soft: 'tertiary',
|
|
491
|
+
action: 'tertiary',
|
|
492
|
+
navigation: 'tertiary',
|
|
493
|
+
};
|
|
494
|
+
return variantMap[this.variant()] ?? this.typeButton();
|
|
495
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedTypeButton" }] : /* istanbul ignore next */ []));
|
|
496
|
+
resolvedColor = computed(() => this.variant() === 'danger' ? 'danger' : this.color(), ...(ngDevMode ? [{ debugName: "resolvedColor" }] : /* istanbul ignore next */ []));
|
|
497
|
+
showIcon = computed(() => !this.loading() && this.resolvedIconMode() !== 'none' && !!this.resolvedIcon(), ...(ngDevMode ? [{ debugName: "showIcon" }] : /* istanbul ignore next */ []));
|
|
498
|
+
resolvedAriaLabel = computed(() => this.ariaLabel() || (this.resolvedIconMode() === 'only-icon' ? this.resolvedText() : null), ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
|
|
499
|
+
resolvedIconColor = computed(() => this.iconColor() || this.defaultIconColor(), ...(ngDevMode ? [{ debugName: "resolvedIconColor" }] : /* istanbul ignore next */ []));
|
|
500
|
+
resolvedIconRenderMode = computed(() => {
|
|
501
|
+
const icon = this.resolvedIcon();
|
|
502
|
+
return icon === 'apple' || icon === 'google' ? 'origin' : 'mask';
|
|
503
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIconRenderMode" }] : /* istanbul ignore next */ []));
|
|
504
|
+
isDisabled = computed(() => this.disabled() || this.loading(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
505
|
+
showSpinner = computed(() => this.loading() && this.resolvedIconMode() !== 'only-icon', ...(ngDevMode ? [{ debugName: "showSpinner" }] : /* istanbul ignore next */ []));
|
|
506
|
+
loadingAriaLabel = computed(() => this.ariaDescription() || `Cargando ${this.resolvedText() || 'contenido'}`, ...(ngDevMode ? [{ debugName: "loadingAriaLabel" }] : /* istanbul ignore next */ []));
|
|
507
|
+
emitChange() {
|
|
508
|
+
if (this.isDisabled()) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
this.buttonClick.emit();
|
|
512
|
+
this.change.emit();
|
|
513
|
+
this.sanChange.emit();
|
|
514
|
+
}
|
|
515
|
+
defaultIconColor() {
|
|
516
|
+
const isStrongButton = this.variant() !== 'navigation' &&
|
|
517
|
+
this.variant() !== 'action' &&
|
|
518
|
+
this.resolvedTypeButton() === 'primary' &&
|
|
519
|
+
this.resolvedColor() !== 'danger';
|
|
520
|
+
return isStrongButton ? 'inverse' : this.resolvedColor() === 'danger' ? 'danger' : 'primary';
|
|
521
|
+
}
|
|
522
|
+
isIconMode(value) {
|
|
523
|
+
return value === 'none' || value === 'with-icon' || value === 'only-icon';
|
|
524
|
+
}
|
|
525
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
526
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroButton, isStandalone: true, selector: "loro-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconContent: { classPropertyName: "iconContent", publicName: "iconContent", isSignal: true, isRequired: false, transformFunction: null }, iconMode: { classPropertyName: "iconMode", publicName: "iconMode", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconButtonSize: { classPropertyName: "iconButtonSize", publicName: "iconButtonSize", isSignal: true, isRequired: false, transformFunction: null }, iconColor: { classPropertyName: "iconColor", publicName: "iconColor", isSignal: true, isRequired: false, transformFunction: null }, socialMobileCompact: { classPropertyName: "socialMobileCompact", publicName: "socialMobileCompact", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, typeButton: { classPropertyName: "typeButton", publicName: "typeButton", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fullWidth: { classPropertyName: "fullWidth", publicName: "fullWidth", isSignal: true, isRequired: false, transformFunction: null }, buttonWidth: { classPropertyName: "buttonWidth", publicName: "buttonWidth", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, formId: { classPropertyName: "formId", publicName: "formId", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaDescription: { classPropertyName: "ariaDescription", publicName: "ariaDescription", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClick: "buttonClick", change: "change", sanChange: "sanChange" }, host: { properties: { "class.loro-button-host--full": "resolvedButtonWidth() === 'full'" } }, ngImport: i0, template: "<button\n [type]=\"type()\"\n [attr.form]=\"formId() || null\"\n class=\"loro-button\"\n [class]=\"'loro-button loro-button--' + resolvedTypeButton()\"\n [class.loro-button--outline]=\"variant() === 'outline'\"\n [class.loro-button--ghost]=\"variant() === 'ghost'\"\n [class.loro-button--soft]=\"variant() === 'soft'\"\n [class.loro-button--social]=\"variant() === 'social'\"\n [class.loro-button--action]=\"variant() === 'action'\"\n [class.loro-button--navigation]=\"variant() === 'navigation'\"\n [class.loro-button--danger]=\"variant() === 'danger'\"\n [class.loro-button--secondary-color]=\"resolvedColor() === 'secondary'\"\n [class.loro-button--tertiary-color]=\"resolvedColor() === 'tertiary'\"\n [class.loro-button--danger-color]=\"resolvedColor() === 'danger'\"\n [class.loro-button--sm]=\"size() === 'sm'\"\n [class.loro-button--lg]=\"size() === 'lg'\"\n [class.loro-button--full]=\"resolvedButtonWidth() === 'full'\"\n [class.loro-button--icon-only]=\"resolvedIconMode() === 'only-icon'\"\n [class.loro-button--social-mobile-compact]=\"socialMobileCompact()\"\n [class.loro-button--selected]=\"selected()\"\n [class.loro-button--loading]=\"loading()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-description]=\"ariaDescription() || null\"\n [attr.aria-busy]=\"loading()\"\n [style.--loro-button-icon-size]=\"resolvedIconButtonSize()\"\n (click)=\"emitChange()\"\n>\n @if (showIcon()) {\n <loro-icon\n [name]=\"resolvedIcon()!\"\n [size]=\"iconSize()\"\n [alt]=\"resolvedText()\"\n [color]=\"resolvedIconColor()\"\n [renderMode]=\"resolvedIconRenderMode()\"\n />\n }\n\n @if (showSpinner()) {\n <span class=\"loro-button__spinner\" aria-hidden=\"true\"></span>\n <span class=\"loro-button__sr-status\" aria-live=\"polite\">{{ loadingAriaLabel() }}</span>\n }\n\n @if (resolvedIconMode() !== 'only-icon') {\n <span class=\"loro-button__label\">{{ resolvedText() }}</span>\n }\n</button>\n", styles: [":host{display:inline-flex;width:fit-content;font-family:var(--loro-font-brand)}:host(.loro-button-host--full){display:block;width:100%}.loro-button{display:inline-flex;align-items:center;justify-content:center;gap:.65rem;min-width:0;min-height:var(--loro-button-min-height, 3.25rem);padding:var(--loro-button-padding, .85rem 1.25rem);border:1px solid transparent;border-radius:var(--loro-button-radius, .9rem);background:var(--loro-button-background, var(--loro-surface-muted));color:var(--loro-text-strong);box-shadow:var(--loro-button-shadow, none);font:inherit;font-size:var(--loro-button-font-size, 1rem);font-weight:900;line-height:1.1;white-space:normal;overflow-wrap:anywhere;word-break:break-word;text-align:center;cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease,color .15s ease}.loro-button__label{min-width:0}.loro-button__spinner{width:1rem;height:1rem;flex:0 0 auto;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loro-button-spin .7s linear infinite}.loro-button__sr-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.loro-button:hover:not(:disabled){transform:translateY(-1px)}.loro-button--full{width:100%}.loro-button--primary,.loro-button--primary.loro-button--primary-color{background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff}.loro-button--secondary,.loro-button--outline{border-color:var(--loro-primary-500);background:transparent;color:var(--loro-primary-700)}.loro-button--tertiary,.loro-button--ghost{background:transparent;color:var(--loro-primary-700)}.loro-button--tertiary{min-height:auto;padding:0;border-radius:.55rem;box-shadow:none}.loro-button--tertiary:hover:not(:disabled){transform:none}.loro-button--tertiary:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-primary-500) 28%,transparent);outline-offset:2px}.loro-button--soft{background:color-mix(in srgb,var(--loro-primary-500) 8%,transparent);color:var(--loro-primary-700)}.loro-button--social{border-color:var(--loro-border-subtle);background:var(--loro-surface);color:var(--loro-text)}.loro-button--action{min-height:var(--loro-button-min-height, 2.75rem);padding:var(--loro-button-padding, 0);border:0;border-radius:var(--loro-button-radius, 50%);background:var(--loro-button-background, transparent);color:var(--loro-button-color, var(--loro-primary-700));box-shadow:var(--loro-button-shadow, none)}.loro-button--action:hover:not(:disabled){background:var(--loro-button-hover-background, color-mix(in srgb, var(--loro-primary) 8%, transparent));transform:translateY(-1px)}.loro-button--action:active:not(:disabled){transform:translateY(1px)}.loro-button--action:focus-visible{outline:3px solid var(--loro-button-focus-ring, color-mix(in srgb, var(--loro-primary) 36%, transparent));outline-offset:3px}.loro-button--social:hover:not(:disabled),.loro-button--social:focus-visible{border-color:var(--loro-primary-500);box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-button--navigation{justify-content:flex-start;gap:1rem;padding:.5rem;border-color:var(--loro-button-border-color, transparent);border-radius:var(--loro-button-radius, 1rem);color:var(--loro-home-avatar-color);text-align:left}.loro-button--navigation .loro-button__label{flex:1;text-align:left}.loro-button--navigation:hover:not(:disabled):not(.loro-button--danger-color):not(.loro-button--selected),.loro-button--navigation:focus-visible:not(:disabled):not(.loro-button--danger-color):not(.loro-button--selected){background:var(--loro-home-avatar-bg);transform:translateY(-.24rem) scale(1.01)}.loro-button--selected{border-color:var(--loro-button-selected-border-color, var(--loro-button-border-color, transparent));background:var(--loro-button-selected-background, var(--loro-button-background, transparent));color:var(--loro-button-selected-color, var(--loro-button-color, var(--loro-nav-button-text, var(--loro-text-strong))))}.loro-button--navigation.loro-button--selected:hover:not(:disabled),.loro-button--navigation.loro-button--selected:focus-visible:not(:disabled){transform:none;border-color:var(--loro-button-selected-border-color, var(--loro-button-border-color, transparent));background:var(--loro-button-selected-background, var(--loro-button-background, transparent));color:var(--loro-button-selected-color, var(--loro-button-color, var(--loro-nav-button-text, var(--loro-text-strong))));outline:none}.loro-button--danger,.loro-button--danger-color{border-color:color-mix(in srgb,var(--loro-danger-text) 24%,transparent);background:var(--loro-danger-surface);color:var(--loro-danger-text)}.loro-button--navigation.loro-button--danger-color{border-color:var(--loro-button-border-color, transparent);background:var(--loro-button-background, var(--loro-danger-surface));color:var(--loro-button-color, var(--loro-danger-text))}.loro-button--secondary-color.loro-button--primary{background:linear-gradient(135deg,var(--loro-primary-700),var(--loro-primary-900));color:#fff}.loro-button--tertiary-color.loro-button--primary{background:linear-gradient(135deg,color-mix(in srgb,var(--loro-primary-500) 82%,white),var(--loro-primary-700));color:#fff}.loro-button--sm{min-height:var(--loro-button-min-height, 2.35rem);border-radius:var(--loro-button-radius, .65rem);font-size:var(--loro-button-font-size, .82rem)}.loro-button--lg{min-height:var(--loro-button-min-height, 3.65rem);padding:var(--loro-button-padding, .95rem 1.35rem);border-radius:var(--loro-button-radius, 1rem);font-size:var(--loro-button-font-size, 1.08rem)}.loro-button--icon-only{width:var(--loro-button-icon-size, 3rem);min-width:var(--loro-button-icon-size, 3rem);padding:0;aspect-ratio:1}.loro-button:disabled{cursor:not-allowed;opacity:.62;transform:none}.loro-button--loading{cursor:progress}@keyframes loro-button-spin{to{transform:rotate(360deg)}}@media(max-width:767.88px){.loro-button--social.loro-button--social-mobile-compact{width:var(--loro-button-icon-size, 3rem);min-width:var(--loro-button-icon-size, 3rem);min-height:var(--loro-button-icon-size, 3rem);margin-inline:auto;padding:0;aspect-ratio:1}.loro-button--social.loro-button--social-mobile-compact .loro-button__label{display:none}}@media(prefers-reduced-motion:reduce){.loro-button{transition:none}.loro-button__spinner{animation-duration:1.4s}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
527
|
+
}
|
|
528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroButton, decorators: [{
|
|
529
|
+
type: Component,
|
|
530
|
+
args: [{ selector: 'loro-button', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
531
|
+
'[class.loro-button-host--full]': "resolvedButtonWidth() === 'full'",
|
|
532
|
+
}, template: "<button\n [type]=\"type()\"\n [attr.form]=\"formId() || null\"\n class=\"loro-button\"\n [class]=\"'loro-button loro-button--' + resolvedTypeButton()\"\n [class.loro-button--outline]=\"variant() === 'outline'\"\n [class.loro-button--ghost]=\"variant() === 'ghost'\"\n [class.loro-button--soft]=\"variant() === 'soft'\"\n [class.loro-button--social]=\"variant() === 'social'\"\n [class.loro-button--action]=\"variant() === 'action'\"\n [class.loro-button--navigation]=\"variant() === 'navigation'\"\n [class.loro-button--danger]=\"variant() === 'danger'\"\n [class.loro-button--secondary-color]=\"resolvedColor() === 'secondary'\"\n [class.loro-button--tertiary-color]=\"resolvedColor() === 'tertiary'\"\n [class.loro-button--danger-color]=\"resolvedColor() === 'danger'\"\n [class.loro-button--sm]=\"size() === 'sm'\"\n [class.loro-button--lg]=\"size() === 'lg'\"\n [class.loro-button--full]=\"resolvedButtonWidth() === 'full'\"\n [class.loro-button--icon-only]=\"resolvedIconMode() === 'only-icon'\"\n [class.loro-button--social-mobile-compact]=\"socialMobileCompact()\"\n [class.loro-button--selected]=\"selected()\"\n [class.loro-button--loading]=\"loading()\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-description]=\"ariaDescription() || null\"\n [attr.aria-busy]=\"loading()\"\n [style.--loro-button-icon-size]=\"resolvedIconButtonSize()\"\n (click)=\"emitChange()\"\n>\n @if (showIcon()) {\n <loro-icon\n [name]=\"resolvedIcon()!\"\n [size]=\"iconSize()\"\n [alt]=\"resolvedText()\"\n [color]=\"resolvedIconColor()\"\n [renderMode]=\"resolvedIconRenderMode()\"\n />\n }\n\n @if (showSpinner()) {\n <span class=\"loro-button__spinner\" aria-hidden=\"true\"></span>\n <span class=\"loro-button__sr-status\" aria-live=\"polite\">{{ loadingAriaLabel() }}</span>\n }\n\n @if (resolvedIconMode() !== 'only-icon') {\n <span class=\"loro-button__label\">{{ resolvedText() }}</span>\n }\n</button>\n", styles: [":host{display:inline-flex;width:fit-content;font-family:var(--loro-font-brand)}:host(.loro-button-host--full){display:block;width:100%}.loro-button{display:inline-flex;align-items:center;justify-content:center;gap:.65rem;min-width:0;min-height:var(--loro-button-min-height, 3.25rem);padding:var(--loro-button-padding, .85rem 1.25rem);border:1px solid transparent;border-radius:var(--loro-button-radius, .9rem);background:var(--loro-button-background, var(--loro-surface-muted));color:var(--loro-text-strong);box-shadow:var(--loro-button-shadow, none);font:inherit;font-size:var(--loro-button-font-size, 1rem);font-weight:900;line-height:1.1;white-space:normal;overflow-wrap:anywhere;word-break:break-word;text-align:center;cursor:pointer;transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease,color .15s ease}.loro-button__label{min-width:0}.loro-button__spinner{width:1rem;height:1rem;flex:0 0 auto;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:loro-button-spin .7s linear infinite}.loro-button__sr-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.loro-button:hover:not(:disabled){transform:translateY(-1px)}.loro-button--full{width:100%}.loro-button--primary,.loro-button--primary.loro-button--primary-color{background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff}.loro-button--secondary,.loro-button--outline{border-color:var(--loro-primary-500);background:transparent;color:var(--loro-primary-700)}.loro-button--tertiary,.loro-button--ghost{background:transparent;color:var(--loro-primary-700)}.loro-button--tertiary{min-height:auto;padding:0;border-radius:.55rem;box-shadow:none}.loro-button--tertiary:hover:not(:disabled){transform:none}.loro-button--tertiary:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-primary-500) 28%,transparent);outline-offset:2px}.loro-button--soft{background:color-mix(in srgb,var(--loro-primary-500) 8%,transparent);color:var(--loro-primary-700)}.loro-button--social{border-color:var(--loro-border-subtle);background:var(--loro-surface);color:var(--loro-text)}.loro-button--action{min-height:var(--loro-button-min-height, 2.75rem);padding:var(--loro-button-padding, 0);border:0;border-radius:var(--loro-button-radius, 50%);background:var(--loro-button-background, transparent);color:var(--loro-button-color, var(--loro-primary-700));box-shadow:var(--loro-button-shadow, none)}.loro-button--action:hover:not(:disabled){background:var(--loro-button-hover-background, color-mix(in srgb, var(--loro-primary) 8%, transparent));transform:translateY(-1px)}.loro-button--action:active:not(:disabled){transform:translateY(1px)}.loro-button--action:focus-visible{outline:3px solid var(--loro-button-focus-ring, color-mix(in srgb, var(--loro-primary) 36%, transparent));outline-offset:3px}.loro-button--social:hover:not(:disabled),.loro-button--social:focus-visible{border-color:var(--loro-primary-500);box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-button--navigation{justify-content:flex-start;gap:1rem;padding:.5rem;border-color:var(--loro-button-border-color, transparent);border-radius:var(--loro-button-radius, 1rem);color:var(--loro-home-avatar-color);text-align:left}.loro-button--navigation .loro-button__label{flex:1;text-align:left}.loro-button--navigation:hover:not(:disabled):not(.loro-button--danger-color):not(.loro-button--selected),.loro-button--navigation:focus-visible:not(:disabled):not(.loro-button--danger-color):not(.loro-button--selected){background:var(--loro-home-avatar-bg);transform:translateY(-.24rem) scale(1.01)}.loro-button--selected{border-color:var(--loro-button-selected-border-color, var(--loro-button-border-color, transparent));background:var(--loro-button-selected-background, var(--loro-button-background, transparent));color:var(--loro-button-selected-color, var(--loro-button-color, var(--loro-nav-button-text, var(--loro-text-strong))))}.loro-button--navigation.loro-button--selected:hover:not(:disabled),.loro-button--navigation.loro-button--selected:focus-visible:not(:disabled){transform:none;border-color:var(--loro-button-selected-border-color, var(--loro-button-border-color, transparent));background:var(--loro-button-selected-background, var(--loro-button-background, transparent));color:var(--loro-button-selected-color, var(--loro-button-color, var(--loro-nav-button-text, var(--loro-text-strong))));outline:none}.loro-button--danger,.loro-button--danger-color{border-color:color-mix(in srgb,var(--loro-danger-text) 24%,transparent);background:var(--loro-danger-surface);color:var(--loro-danger-text)}.loro-button--navigation.loro-button--danger-color{border-color:var(--loro-button-border-color, transparent);background:var(--loro-button-background, var(--loro-danger-surface));color:var(--loro-button-color, var(--loro-danger-text))}.loro-button--secondary-color.loro-button--primary{background:linear-gradient(135deg,var(--loro-primary-700),var(--loro-primary-900));color:#fff}.loro-button--tertiary-color.loro-button--primary{background:linear-gradient(135deg,color-mix(in srgb,var(--loro-primary-500) 82%,white),var(--loro-primary-700));color:#fff}.loro-button--sm{min-height:var(--loro-button-min-height, 2.35rem);border-radius:var(--loro-button-radius, .65rem);font-size:var(--loro-button-font-size, .82rem)}.loro-button--lg{min-height:var(--loro-button-min-height, 3.65rem);padding:var(--loro-button-padding, .95rem 1.35rem);border-radius:var(--loro-button-radius, 1rem);font-size:var(--loro-button-font-size, 1.08rem)}.loro-button--icon-only{width:var(--loro-button-icon-size, 3rem);min-width:var(--loro-button-icon-size, 3rem);padding:0;aspect-ratio:1}.loro-button:disabled{cursor:not-allowed;opacity:.62;transform:none}.loro-button--loading{cursor:progress}@keyframes loro-button-spin{to{transform:rotate(360deg)}}@media(max-width:767.88px){.loro-button--social.loro-button--social-mobile-compact{width:var(--loro-button-icon-size, 3rem);min-width:var(--loro-button-icon-size, 3rem);min-height:var(--loro-button-icon-size, 3rem);margin-inline:auto;padding:0;aspect-ratio:1}.loro-button--social.loro-button--social-mobile-compact .loro-button__label{display:none}}@media(prefers-reduced-motion:reduce){.loro-button{transition:none}.loro-button__spinner{animation-duration:1.4s}}\n"] }]
|
|
533
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconContent", required: false }] }], iconMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconMode", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconButtonSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconButtonSize", required: false }] }], iconColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColor", required: false }] }], socialMobileCompact: [{ type: i0.Input, args: [{ isSignal: true, alias: "socialMobileCompact", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], typeButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "typeButton", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], buttonWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonWidth", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], formId: [{ type: i0.Input, args: [{ isSignal: true, alias: "formId", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescription", required: false }] }], buttonClick: [{ type: i0.Output, args: ["buttonClick"] }], change: [{ type: i0.Output, args: ["change"] }], sanChange: [{ type: i0.Output, args: ["sanChange"] }] } });
|
|
534
|
+
|
|
535
|
+
class LoroCard {
|
|
536
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
537
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
538
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
539
|
+
iconSize = input(28, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
540
|
+
iconColor = input('default', ...(ngDevMode ? [{ debugName: "iconColor" }] : /* istanbul ignore next */ []));
|
|
541
|
+
link = input('', ...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
|
|
542
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
543
|
+
justify = input('center', ...(ngDevMode ? [{ debugName: "justify" }] : /* istanbul ignore next */ []));
|
|
544
|
+
mobileJustify = input('center', ...(ngDevMode ? [{ debugName: "mobileJustify" }] : /* istanbul ignore next */ []));
|
|
545
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
546
|
+
showArrow = input(false, ...(ngDevMode ? [{ debugName: "showArrow" }] : /* istanbul ignore next */ []));
|
|
547
|
+
arrowSize = input(16, ...(ngDevMode ? [{ debugName: "arrowSize" }] : /* istanbul ignore next */ []));
|
|
548
|
+
heroGreeting = input('', ...(ngDevMode ? [{ debugName: "heroGreeting" }] : /* istanbul ignore next */ []));
|
|
549
|
+
heroSubtitle = input('', ...(ngDevMode ? [{ debugName: "heroSubtitle" }] : /* istanbul ignore next */ []));
|
|
550
|
+
heroAvatarSrc = input(null, ...(ngDevMode ? [{ debugName: "heroAvatarSrc" }] : /* istanbul ignore next */ []));
|
|
551
|
+
heroAvatarAlt = input('Perfil', ...(ngDevMode ? [{ debugName: "heroAvatarAlt" }] : /* istanbul ignore next */ []));
|
|
552
|
+
heroAvatarIcon = input('user', ...(ngDevMode ? [{ debugName: "heroAvatarIcon" }] : /* istanbul ignore next */ []));
|
|
553
|
+
heroAvatarIconSize = input(22, ...(ngDevMode ? [{ debugName: "heroAvatarIconSize" }] : /* istanbul ignore next */ []));
|
|
554
|
+
heroVisualImage = input(null, ...(ngDevMode ? [{ debugName: "heroVisualImage" }] : /* istanbul ignore next */ []));
|
|
555
|
+
heroVisualAlt = input('AlLoro', ...(ngDevMode ? [{ debugName: "heroVisualAlt" }] : /* istanbul ignore next */ []));
|
|
556
|
+
resolvedIconSize = computed(() => {
|
|
557
|
+
const size = this.iconSize();
|
|
558
|
+
const normalizedSize = typeof size === 'number' ? `${size}px` : size;
|
|
559
|
+
return this.variant() === 'benefit' || this.variant() === 'benefit-showcase'
|
|
560
|
+
? `var(--loro-card-benefit-icon-glyph-size, ${normalizedSize})`
|
|
561
|
+
: normalizedSize;
|
|
562
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIconSize" }] : /* istanbul ignore next */ []));
|
|
563
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
564
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroCard, isStandalone: true, selector: "loro-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconColor: { classPropertyName: "iconColor", publicName: "iconColor", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, mobileJustify: { classPropertyName: "mobileJustify", publicName: "mobileJustify", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, showArrow: { classPropertyName: "showArrow", publicName: "showArrow", isSignal: true, isRequired: false, transformFunction: null }, arrowSize: { classPropertyName: "arrowSize", publicName: "arrowSize", isSignal: true, isRequired: false, transformFunction: null }, heroGreeting: { classPropertyName: "heroGreeting", publicName: "heroGreeting", isSignal: true, isRequired: false, transformFunction: null }, heroSubtitle: { classPropertyName: "heroSubtitle", publicName: "heroSubtitle", isSignal: true, isRequired: false, transformFunction: null }, heroAvatarSrc: { classPropertyName: "heroAvatarSrc", publicName: "heroAvatarSrc", isSignal: true, isRequired: false, transformFunction: null }, heroAvatarAlt: { classPropertyName: "heroAvatarAlt", publicName: "heroAvatarAlt", isSignal: true, isRequired: false, transformFunction: null }, heroAvatarIcon: { classPropertyName: "heroAvatarIcon", publicName: "heroAvatarIcon", isSignal: true, isRequired: false, transformFunction: null }, heroAvatarIconSize: { classPropertyName: "heroAvatarIconSize", publicName: "heroAvatarIconSize", isSignal: true, isRequired: false, transformFunction: null }, heroVisualImage: { classPropertyName: "heroVisualImage", publicName: "heroVisualImage", isSignal: true, isRequired: false, transformFunction: null }, heroVisualAlt: { classPropertyName: "heroVisualAlt", publicName: "heroVisualAlt", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
565
|
+
<a
|
|
566
|
+
class="loro-card"
|
|
567
|
+
[routerLink]="link() || null"
|
|
568
|
+
[class.loro-card--tinted]="variant() === 'tinted'"
|
|
569
|
+
[class.loro-card--danger]="variant() === 'danger'"
|
|
570
|
+
[class.loro-card--selectable]="variant() === 'selectable'"
|
|
571
|
+
[class.loro-card--benefit]="variant() === 'benefit'"
|
|
572
|
+
[class.loro-card--benefit-showcase]="variant() === 'benefit-showcase'"
|
|
573
|
+
[class.loro-card--home-hero]="variant() === 'home-hero'"
|
|
574
|
+
[class.loro-card--home-primary]="variant() === 'home-primary'"
|
|
575
|
+
[class.loro-card--home-secondary]="variant() === 'home-secondary'"
|
|
576
|
+
[class.loro-card--interactive]="!!link()"
|
|
577
|
+
[class.loro-card--justify-start]="justify() === 'start'"
|
|
578
|
+
[class.loro-card--justify-center]="justify() === 'center'"
|
|
579
|
+
[class.loro-card--justify-end]="justify() === 'end'"
|
|
580
|
+
[class.loro-card--mobile-justify-start]="mobileJustify() === 'start'"
|
|
581
|
+
[class.loro-card--mobile-justify-center]="mobileJustify() === 'center'"
|
|
582
|
+
[class.loro-card--mobile-justify-end]="mobileJustify() === 'end'"
|
|
583
|
+
[class.loro-card--selected]="selected()">
|
|
584
|
+
@if (variant() === 'home-hero') {
|
|
585
|
+
<div class="loro-card__hero-main">
|
|
586
|
+
<div class="loro-card__hero-avatar" aria-hidden="true">
|
|
587
|
+
@if (heroAvatarSrc()) {
|
|
588
|
+
<img [src]="heroAvatarSrc()!" [alt]="heroAvatarAlt()" />
|
|
589
|
+
} @else {
|
|
590
|
+
<loro-icon [name]="heroAvatarIcon()" [size]="heroAvatarIconSize()" [alt]="heroAvatarAlt()" />
|
|
591
|
+
}
|
|
592
|
+
</div>
|
|
593
|
+
|
|
594
|
+
<div class="loro-card__hero-copy">
|
|
595
|
+
@if (heroGreeting()) {
|
|
596
|
+
<p>{{ heroGreeting() }}</p>
|
|
597
|
+
}
|
|
598
|
+
@if (heroSubtitle()) {
|
|
599
|
+
<span>{{ heroSubtitle() }}</span>
|
|
600
|
+
}
|
|
601
|
+
</div>
|
|
602
|
+
</div>
|
|
603
|
+
|
|
604
|
+
@if (heroVisualImage()) {
|
|
605
|
+
<div class="loro-card__hero-visual" aria-hidden="true">
|
|
606
|
+
<loro-image [name]="heroVisualImage()!" [alt]="heroVisualAlt()" width="100%" />
|
|
607
|
+
</div>
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@if ((title() || icon()) && variant() !== 'home-hero') {
|
|
612
|
+
<header class="loro-card__header">
|
|
613
|
+
@if (icon()) {
|
|
614
|
+
<span class="loro-card__icon">
|
|
615
|
+
<loro-icon
|
|
616
|
+
[name]="icon()!"
|
|
617
|
+
[size]="resolvedIconSize()"
|
|
618
|
+
[alt]="title() || icon()!"
|
|
619
|
+
[color]="iconColor()"
|
|
620
|
+
[decorative]="true"
|
|
621
|
+
/>
|
|
622
|
+
</span>
|
|
623
|
+
}
|
|
624
|
+
<div class="loro-card__copy">
|
|
625
|
+
@if (title()) {
|
|
626
|
+
<h2 class="loro-card__title">{{ title() }}</h2>
|
|
627
|
+
}
|
|
628
|
+
@if (description()) {
|
|
629
|
+
<p class="loro-card__description">{{ description() }}</p>
|
|
630
|
+
}
|
|
631
|
+
</div>
|
|
632
|
+
</header>
|
|
633
|
+
}
|
|
634
|
+
<ng-content />
|
|
635
|
+
@if (showArrow()) {
|
|
636
|
+
<span class="loro-card__arrow" aria-hidden="true">
|
|
637
|
+
<loro-icon name="arrow-right" [size]="arrowSize()" alt="Ir" />
|
|
638
|
+
</span>
|
|
639
|
+
}
|
|
640
|
+
</a>
|
|
641
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand);container-type:inline-size}.loro-card{display:grid;gap:1.25rem;padding:clamp(1.25rem,3vw,1.75rem);border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);text-decoration:none;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background-color .18s ease}.loro-card--interactive{cursor:pointer}.loro-card--interactive:hover,.loro-card--interactive:focus-visible{transform:translateY(-1px);border-color:var(--loro-border-strong);outline:none}.loro-card--tinted{background:var(--loro-surface-tinted)}.loro-card--danger{border-color:#dc262638;background:#dc26260f}.loro-card--selectable{cursor:pointer}.loro-card--selected{border-color:var(--loro-primary-500);background:#6c3cff0d;box-shadow:0 0 0 1px #6c3cff33,var(--loro-shadow-soft)}.loro-card--benefit,.loro-card--benefit-showcase{gap:var(--loro-card-benefit-gap, .7rem);padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;transition:none}.loro-card__header{display:flex;align-items:center;gap:1rem;min-width:0}.loro-card__icon{display:grid;width:3.5rem;height:3.5rem;flex:0 0 auto;place-items:center;border-radius:1rem;background:var(--loro-brand-tint-surface);margin-block-end:.5rem}.loro-card--benefit .loro-card__header,.loro-card--benefit-showcase .loro-card__header{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:var(--loro-card-benefit-header-gap, .75rem);min-width:0}.loro-card--benefit .loro-card__icon,.loro-card--benefit-showcase .loro-card__icon{width:var(--loro-card-benefit-icon-width, var(--loro-card-benefit-icon-size, 2.25rem));height:var(--loro-card-benefit-icon-height, var(--loro-card-benefit-icon-size, 2.25rem));border-radius:999px;background:var(--loro-card-benefit-icon-bg, var(--loro-primary-500));color:#fff}.loro-card__copy{min-width:0}.loro-card__title,.loro-card__description{margin:0}.loro-card__title{color:var(--loro-text-strong);font-size:clamp(1.15rem,2vw,1.45rem);font-weight:900;line-height:1.15}.loro-card__description{margin-top:.35rem;color:var(--loro-muted);font-size:.95rem;line-height:1.45}.loro-card__arrow{display:none;align-items:center;justify-content:center;justify-self:end;width:2.2rem;height:2.2rem;border-radius:999px;line-height:0}.loro-card--benefit .loro-card__title,.loro-card--benefit-showcase .loro-card__title{color:var(--loro-text-strong);font-size:var(--loro-card-benefit-title-font-size, 1rem);font-weight:900;line-height:var(--loro-card-benefit-title-line-height, 1.15);overflow-wrap:anywhere}.loro-card--benefit .loro-card__description,.loro-card--benefit-showcase .loro-card__description{margin-top:.12rem;color:var(--loro-muted);font-size:var(--loro-card-benefit-description-font-size, .82rem);font-weight:var(--loro-card-benefit-description-font-weight, 750);line-height:var(--loro-card-benefit-description-line-height, 1.25);overflow-wrap:anywhere}.loro-card--benefit .loro-card__copy,.loro-card--benefit-showcase .loro-card__copy{min-width:0;width:100%;flex:1 1 auto}.loro-card--benefit-showcase{width:100%;min-width:0}.loro-card--benefit.loro-card--justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-start .loro-card__header{justify-content:flex-start;text-align:left}.loro-card--benefit.loro-card--justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-center .loro-card__header{justify-content:center;text-align:center}.loro-card--benefit.loro-card--justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-end .loro-card__header{justify-content:flex-end;text-align:right}.loro-card--home-primary,.loro-card--home-secondary{position:relative;display:flex;flex-direction:column;align-items:stretch;height:100%;gap:0;min-height:10.5rem;padding:1rem;overflow:hidden;isolation:isolate;border-color:var(--loro-home-card-border);border-radius:1.45rem;background:var(--loro-surface-soft);text-align:left}.loro-card--home-primary:before,.loro-card--home-primary:after,.loro-card--home-secondary:before,.loro-card--home-secondary:after{position:absolute;inset:0;content:\"\";pointer-events:none}.loro-card--home-primary>*,.loro-card--home-secondary>*{position:relative;z-index:1}.loro-card--home-primary .loro-card__header,.loro-card--home-secondary .loro-card__header{display:block;flex:1 1 auto;text-align:left}.loro-card--home-primary .loro-card__icon,.loro-card--home-secondary .loro-card__icon{position:relative;width:3rem;height:3rem;border:1px solid rgba(255,255,255,.2);border-radius:1.15rem;background:var(--loro-home-card-icon-bg);box-shadow:var(--loro-home-card-icon-shadow);color:var(--loro-home-card-icon-color)}.loro-card--home-primary .loro-card__copy,.loro-card--home-secondary .loro-card__copy{min-width:0;display:grid;grid-template-rows:auto auto;justify-items:start;gap:.4rem;min-height:0}.loro-card--home-primary .loro-card__title,.loro-card--home-secondary .loro-card__title{color:var(--loro-home-card-title);font-size:1.16rem;font-weight:800;line-height:1.15;letter-spacing:-.02em;text-align:left}.loro-card--home-primary .loro-card__description,.loro-card--home-secondary .loro-card__description{max-width:none;min-height:0;margin-top:0;color:var(--loro-home-card-description);font-size:.9rem;line-height:1.45;text-align:left}.loro-card--home-primary .loro-card__arrow,.loro-card--home-secondary .loro-card__arrow{display:inline-flex;color:var(--loro-home-card-arrow-color);align-items:center;justify-content:center;align-self:flex-end;margin-top:auto}.loro-card--home-secondary .loro-card__title{font-size:1.08rem}.loro-card--home-secondary .loro-card__description{font-size:.85rem}.loro-card--home-primary:hover,.loro-card--home-primary:focus-visible,.loro-card--home-secondary:hover,.loro-card--home-secondary:focus-visible{transform:translateY(-.24rem) scale(1.01);border-color:var(--loro-home-card-hover-border);box-shadow:var(--loro-home-card-hover-shadow)}.loro-card--home-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.75rem;min-height:6.25rem;overflow:hidden;border-color:var(--loro-home-hero-border);border-radius:1.1rem;background:var(--loro-home-hero-bg);padding:.875rem 1rem;color:var(--loro-home-hero-text)}.loro-card--home-hero .loro-card__header,.loro-card--home-hero .loro-card__copy,.loro-card--home-hero .loro-card__icon{display:none}.loro-card__hero-main{display:flex;align-items:center;gap:.75rem;min-width:0}.loro-card__hero-avatar{display:grid;width:3rem;height:3rem;flex:0 0 3rem;place-items:center;overflow:hidden;border-radius:.95rem;background:var(--loro-home-avatar-bg);color:var(--loro-home-avatar-color)}.loro-card__hero-avatar img{width:100%;height:100%;object-fit:cover}.loro-card__hero-copy{display:grid;gap:.18rem;min-width:0}.loro-card__hero-copy p,.loro-card__hero-copy span{margin:0}.loro-card__hero-copy p{font-size:1rem;font-weight:800;line-height:1.2}.loro-card__hero-copy span{color:var(--loro-home-hero-subtitle);font-size:.875rem;line-height:1.35}.loro-card__hero-visual{width:clamp(4.5rem,24vw,5.75rem);align-self:end}.loro-card--home-hero:hover,.loro-card--home-hero:focus-visible{transform:none;border-color:var(--loro-home-hero-border);box-shadow:var(--loro-shadow-soft)}@media(max-width:1023.88px){.loro-card--benefit.loro-card--mobile-justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-start .loro-card__header{text-align:left}.loro-card--benefit.loro-card--mobile-justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-center .loro-card__header{text-align:center;justify-self:center;width:fit-content;max-width:100%;margin-inline:auto}.loro-card--benefit.loro-card--mobile-justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-end .loro-card__header{text-align:right}.loro-card--benefit.loro-card--mobile-justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-start .loro-card__header{grid-template-columns:auto minmax(0,1fr)}.loro-card--benefit.loro-card--mobile-justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-center .loro-card__header{grid-template-columns:auto auto}.loro-card--benefit.loro-card--mobile-justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-end .loro-card__header{grid-template-columns:auto minmax(0,1fr)}}@container (min-width: 18rem){.loro-card--home-primary,.loro-card--home-secondary{min-height:9.75rem}.loro-card--home-primary .loro-card__header,.loro-card--home-secondary .loro-card__header{display:block}.loro-card--home-hero{min-height:7.25rem;padding:1rem 1.25rem}.loro-card__hero-visual{width:clamp(5.25rem,20vw,7rem)}}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
642
|
+
}
|
|
643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCard, decorators: [{
|
|
644
|
+
type: Component,
|
|
645
|
+
args: [{ selector: 'loro-card', standalone: true, imports: [RouterLink, LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
646
|
+
<a
|
|
647
|
+
class="loro-card"
|
|
648
|
+
[routerLink]="link() || null"
|
|
649
|
+
[class.loro-card--tinted]="variant() === 'tinted'"
|
|
650
|
+
[class.loro-card--danger]="variant() === 'danger'"
|
|
651
|
+
[class.loro-card--selectable]="variant() === 'selectable'"
|
|
652
|
+
[class.loro-card--benefit]="variant() === 'benefit'"
|
|
653
|
+
[class.loro-card--benefit-showcase]="variant() === 'benefit-showcase'"
|
|
654
|
+
[class.loro-card--home-hero]="variant() === 'home-hero'"
|
|
655
|
+
[class.loro-card--home-primary]="variant() === 'home-primary'"
|
|
656
|
+
[class.loro-card--home-secondary]="variant() === 'home-secondary'"
|
|
657
|
+
[class.loro-card--interactive]="!!link()"
|
|
658
|
+
[class.loro-card--justify-start]="justify() === 'start'"
|
|
659
|
+
[class.loro-card--justify-center]="justify() === 'center'"
|
|
660
|
+
[class.loro-card--justify-end]="justify() === 'end'"
|
|
661
|
+
[class.loro-card--mobile-justify-start]="mobileJustify() === 'start'"
|
|
662
|
+
[class.loro-card--mobile-justify-center]="mobileJustify() === 'center'"
|
|
663
|
+
[class.loro-card--mobile-justify-end]="mobileJustify() === 'end'"
|
|
664
|
+
[class.loro-card--selected]="selected()">
|
|
665
|
+
@if (variant() === 'home-hero') {
|
|
666
|
+
<div class="loro-card__hero-main">
|
|
667
|
+
<div class="loro-card__hero-avatar" aria-hidden="true">
|
|
668
|
+
@if (heroAvatarSrc()) {
|
|
669
|
+
<img [src]="heroAvatarSrc()!" [alt]="heroAvatarAlt()" />
|
|
670
|
+
} @else {
|
|
671
|
+
<loro-icon [name]="heroAvatarIcon()" [size]="heroAvatarIconSize()" [alt]="heroAvatarAlt()" />
|
|
672
|
+
}
|
|
673
|
+
</div>
|
|
674
|
+
|
|
675
|
+
<div class="loro-card__hero-copy">
|
|
676
|
+
@if (heroGreeting()) {
|
|
677
|
+
<p>{{ heroGreeting() }}</p>
|
|
678
|
+
}
|
|
679
|
+
@if (heroSubtitle()) {
|
|
680
|
+
<span>{{ heroSubtitle() }}</span>
|
|
681
|
+
}
|
|
682
|
+
</div>
|
|
683
|
+
</div>
|
|
684
|
+
|
|
685
|
+
@if (heroVisualImage()) {
|
|
686
|
+
<div class="loro-card__hero-visual" aria-hidden="true">
|
|
687
|
+
<loro-image [name]="heroVisualImage()!" [alt]="heroVisualAlt()" width="100%" />
|
|
688
|
+
</div>
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
@if ((title() || icon()) && variant() !== 'home-hero') {
|
|
693
|
+
<header class="loro-card__header">
|
|
694
|
+
@if (icon()) {
|
|
695
|
+
<span class="loro-card__icon">
|
|
696
|
+
<loro-icon
|
|
697
|
+
[name]="icon()!"
|
|
698
|
+
[size]="resolvedIconSize()"
|
|
699
|
+
[alt]="title() || icon()!"
|
|
700
|
+
[color]="iconColor()"
|
|
701
|
+
[decorative]="true"
|
|
702
|
+
/>
|
|
703
|
+
</span>
|
|
704
|
+
}
|
|
705
|
+
<div class="loro-card__copy">
|
|
706
|
+
@if (title()) {
|
|
707
|
+
<h2 class="loro-card__title">{{ title() }}</h2>
|
|
708
|
+
}
|
|
709
|
+
@if (description()) {
|
|
710
|
+
<p class="loro-card__description">{{ description() }}</p>
|
|
711
|
+
}
|
|
712
|
+
</div>
|
|
713
|
+
</header>
|
|
714
|
+
}
|
|
715
|
+
<ng-content />
|
|
716
|
+
@if (showArrow()) {
|
|
717
|
+
<span class="loro-card__arrow" aria-hidden="true">
|
|
718
|
+
<loro-icon name="arrow-right" [size]="arrowSize()" alt="Ir" />
|
|
719
|
+
</span>
|
|
720
|
+
}
|
|
721
|
+
</a>
|
|
722
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand);container-type:inline-size}.loro-card{display:grid;gap:1.25rem;padding:clamp(1.25rem,3vw,1.75rem);border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);text-decoration:none;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease,background-color .18s ease}.loro-card--interactive{cursor:pointer}.loro-card--interactive:hover,.loro-card--interactive:focus-visible{transform:translateY(-1px);border-color:var(--loro-border-strong);outline:none}.loro-card--tinted{background:var(--loro-surface-tinted)}.loro-card--danger{border-color:#dc262638;background:#dc26260f}.loro-card--selectable{cursor:pointer}.loro-card--selected{border-color:var(--loro-primary-500);background:#6c3cff0d;box-shadow:0 0 0 1px #6c3cff33,var(--loro-shadow-soft)}.loro-card--benefit,.loro-card--benefit-showcase{gap:var(--loro-card-benefit-gap, .7rem);padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;transition:none}.loro-card__header{display:flex;align-items:center;gap:1rem;min-width:0}.loro-card__icon{display:grid;width:3.5rem;height:3.5rem;flex:0 0 auto;place-items:center;border-radius:1rem;background:var(--loro-brand-tint-surface);margin-block-end:.5rem}.loro-card--benefit .loro-card__header,.loro-card--benefit-showcase .loro-card__header{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:var(--loro-card-benefit-header-gap, .75rem);min-width:0}.loro-card--benefit .loro-card__icon,.loro-card--benefit-showcase .loro-card__icon{width:var(--loro-card-benefit-icon-width, var(--loro-card-benefit-icon-size, 2.25rem));height:var(--loro-card-benefit-icon-height, var(--loro-card-benefit-icon-size, 2.25rem));border-radius:999px;background:var(--loro-card-benefit-icon-bg, var(--loro-primary-500));color:#fff}.loro-card__copy{min-width:0}.loro-card__title,.loro-card__description{margin:0}.loro-card__title{color:var(--loro-text-strong);font-size:clamp(1.15rem,2vw,1.45rem);font-weight:900;line-height:1.15}.loro-card__description{margin-top:.35rem;color:var(--loro-muted);font-size:.95rem;line-height:1.45}.loro-card__arrow{display:none;align-items:center;justify-content:center;justify-self:end;width:2.2rem;height:2.2rem;border-radius:999px;line-height:0}.loro-card--benefit .loro-card__title,.loro-card--benefit-showcase .loro-card__title{color:var(--loro-text-strong);font-size:var(--loro-card-benefit-title-font-size, 1rem);font-weight:900;line-height:var(--loro-card-benefit-title-line-height, 1.15);overflow-wrap:anywhere}.loro-card--benefit .loro-card__description,.loro-card--benefit-showcase .loro-card__description{margin-top:.12rem;color:var(--loro-muted);font-size:var(--loro-card-benefit-description-font-size, .82rem);font-weight:var(--loro-card-benefit-description-font-weight, 750);line-height:var(--loro-card-benefit-description-line-height, 1.25);overflow-wrap:anywhere}.loro-card--benefit .loro-card__copy,.loro-card--benefit-showcase .loro-card__copy{min-width:0;width:100%;flex:1 1 auto}.loro-card--benefit-showcase{width:100%;min-width:0}.loro-card--benefit.loro-card--justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-start .loro-card__header{justify-content:flex-start;text-align:left}.loro-card--benefit.loro-card--justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-center .loro-card__header{justify-content:center;text-align:center}.loro-card--benefit.loro-card--justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--justify-end .loro-card__header{justify-content:flex-end;text-align:right}.loro-card--home-primary,.loro-card--home-secondary{position:relative;display:flex;flex-direction:column;align-items:stretch;height:100%;gap:0;min-height:10.5rem;padding:1rem;overflow:hidden;isolation:isolate;border-color:var(--loro-home-card-border);border-radius:1.45rem;background:var(--loro-surface-soft);text-align:left}.loro-card--home-primary:before,.loro-card--home-primary:after,.loro-card--home-secondary:before,.loro-card--home-secondary:after{position:absolute;inset:0;content:\"\";pointer-events:none}.loro-card--home-primary>*,.loro-card--home-secondary>*{position:relative;z-index:1}.loro-card--home-primary .loro-card__header,.loro-card--home-secondary .loro-card__header{display:block;flex:1 1 auto;text-align:left}.loro-card--home-primary .loro-card__icon,.loro-card--home-secondary .loro-card__icon{position:relative;width:3rem;height:3rem;border:1px solid rgba(255,255,255,.2);border-radius:1.15rem;background:var(--loro-home-card-icon-bg);box-shadow:var(--loro-home-card-icon-shadow);color:var(--loro-home-card-icon-color)}.loro-card--home-primary .loro-card__copy,.loro-card--home-secondary .loro-card__copy{min-width:0;display:grid;grid-template-rows:auto auto;justify-items:start;gap:.4rem;min-height:0}.loro-card--home-primary .loro-card__title,.loro-card--home-secondary .loro-card__title{color:var(--loro-home-card-title);font-size:1.16rem;font-weight:800;line-height:1.15;letter-spacing:-.02em;text-align:left}.loro-card--home-primary .loro-card__description,.loro-card--home-secondary .loro-card__description{max-width:none;min-height:0;margin-top:0;color:var(--loro-home-card-description);font-size:.9rem;line-height:1.45;text-align:left}.loro-card--home-primary .loro-card__arrow,.loro-card--home-secondary .loro-card__arrow{display:inline-flex;color:var(--loro-home-card-arrow-color);align-items:center;justify-content:center;align-self:flex-end;margin-top:auto}.loro-card--home-secondary .loro-card__title{font-size:1.08rem}.loro-card--home-secondary .loro-card__description{font-size:.85rem}.loro-card--home-primary:hover,.loro-card--home-primary:focus-visible,.loro-card--home-secondary:hover,.loro-card--home-secondary:focus-visible{transform:translateY(-.24rem) scale(1.01);border-color:var(--loro-home-card-hover-border);box-shadow:var(--loro-home-card-hover-shadow)}.loro-card--home-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.75rem;min-height:6.25rem;overflow:hidden;border-color:var(--loro-home-hero-border);border-radius:1.1rem;background:var(--loro-home-hero-bg);padding:.875rem 1rem;color:var(--loro-home-hero-text)}.loro-card--home-hero .loro-card__header,.loro-card--home-hero .loro-card__copy,.loro-card--home-hero .loro-card__icon{display:none}.loro-card__hero-main{display:flex;align-items:center;gap:.75rem;min-width:0}.loro-card__hero-avatar{display:grid;width:3rem;height:3rem;flex:0 0 3rem;place-items:center;overflow:hidden;border-radius:.95rem;background:var(--loro-home-avatar-bg);color:var(--loro-home-avatar-color)}.loro-card__hero-avatar img{width:100%;height:100%;object-fit:cover}.loro-card__hero-copy{display:grid;gap:.18rem;min-width:0}.loro-card__hero-copy p,.loro-card__hero-copy span{margin:0}.loro-card__hero-copy p{font-size:1rem;font-weight:800;line-height:1.2}.loro-card__hero-copy span{color:var(--loro-home-hero-subtitle);font-size:.875rem;line-height:1.35}.loro-card__hero-visual{width:clamp(4.5rem,24vw,5.75rem);align-self:end}.loro-card--home-hero:hover,.loro-card--home-hero:focus-visible{transform:none;border-color:var(--loro-home-hero-border);box-shadow:var(--loro-shadow-soft)}@media(max-width:1023.88px){.loro-card--benefit.loro-card--mobile-justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-start .loro-card__header{text-align:left}.loro-card--benefit.loro-card--mobile-justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-center .loro-card__header{text-align:center;justify-self:center;width:fit-content;max-width:100%;margin-inline:auto}.loro-card--benefit.loro-card--mobile-justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-end .loro-card__header{text-align:right}.loro-card--benefit.loro-card--mobile-justify-start .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-start .loro-card__header{grid-template-columns:auto minmax(0,1fr)}.loro-card--benefit.loro-card--mobile-justify-center .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-center .loro-card__header{grid-template-columns:auto auto}.loro-card--benefit.loro-card--mobile-justify-end .loro-card__header,.loro-card--benefit-showcase.loro-card--mobile-justify-end .loro-card__header{grid-template-columns:auto minmax(0,1fr)}}@container (min-width: 18rem){.loro-card--home-primary,.loro-card--home-secondary{min-height:9.75rem}.loro-card--home-primary .loro-card__header,.loro-card--home-secondary .loro-card__header{display:block}.loro-card--home-hero{min-height:7.25rem;padding:1rem 1.25rem}.loro-card__hero-visual{width:clamp(5.25rem,20vw,7rem)}}\n"] }]
|
|
723
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColor", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], justify: [{ type: i0.Input, args: [{ isSignal: true, alias: "justify", required: false }] }], mobileJustify: [{ type: i0.Input, args: [{ isSignal: true, alias: "mobileJustify", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], showArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrow", required: false }] }], arrowSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowSize", required: false }] }], heroGreeting: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroGreeting", required: false }] }], heroSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroSubtitle", required: false }] }], heroAvatarSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroAvatarSrc", required: false }] }], heroAvatarAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroAvatarAlt", required: false }] }], heroAvatarIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroAvatarIcon", required: false }] }], heroAvatarIconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroAvatarIconSize", required: false }] }], heroVisualImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroVisualImage", required: false }] }], heroVisualAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "heroVisualAlt", required: false }] }] } });
|
|
724
|
+
|
|
725
|
+
class LoroCardNav {
|
|
726
|
+
router = inject(Router, { optional: true });
|
|
727
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
728
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
729
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
730
|
+
iconSize = input(25, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
731
|
+
iconColor = input('primary', ...(ngDevMode ? [{ debugName: "iconColor" }] : /* istanbul ignore next */ []));
|
|
732
|
+
route = input('', ...(ngDevMode ? [{ debugName: "route" }] : /* istanbul ignore next */ []));
|
|
733
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
734
|
+
trailing = input('arrow', ...(ngDevMode ? [{ debugName: "trailing" }] : /* istanbul ignore next */ []));
|
|
735
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
736
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
737
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
738
|
+
badgeLabel = input('', ...(ngDevMode ? [{ debugName: "badgeLabel" }] : /* istanbul ignore next */ []));
|
|
739
|
+
badgeVariant = input('info', ...(ngDevMode ? [{ debugName: "badgeVariant" }] : /* istanbul ignore next */ []));
|
|
740
|
+
itemClick = output();
|
|
741
|
+
checkedChange = output();
|
|
742
|
+
selectedChange = output();
|
|
743
|
+
activate() {
|
|
744
|
+
this.itemClick.emit();
|
|
745
|
+
if (this.trailing() === 'toggle') {
|
|
746
|
+
this.checkedChange.emit(!this.checked());
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
if (this.trailing() === 'radio') {
|
|
750
|
+
this.selectedChange.emit(this.value());
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const route = this.route();
|
|
754
|
+
if (route && this.router) {
|
|
755
|
+
void this.router.navigateByUrl(route);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCardNav, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
759
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroCardNav, isStandalone: true, selector: "loro-card-nav", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, iconColor: { classPropertyName: "iconColor", publicName: "iconColor", isSignal: true, isRequired: false, transformFunction: null }, route: { classPropertyName: "route", publicName: "route", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, trailing: { classPropertyName: "trailing", publicName: "trailing", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, badgeLabel: { classPropertyName: "badgeLabel", publicName: "badgeLabel", isSignal: true, isRequired: false, transformFunction: null }, badgeVariant: { classPropertyName: "badgeVariant", publicName: "badgeVariant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", checkedChange: "checkedChange", selectedChange: "selectedChange" }, ngImport: i0, template: `
|
|
760
|
+
<button
|
|
761
|
+
type="button"
|
|
762
|
+
class="loro-card-nav"
|
|
763
|
+
[class.loro-card-nav--danger]="variant() === 'danger'"
|
|
764
|
+
[class.loro-card-nav--soft]="variant() === 'soft'"
|
|
765
|
+
[class.loro-card-nav--selected]="selected()"
|
|
766
|
+
(click)="activate()">
|
|
767
|
+
@if (icon()) {
|
|
768
|
+
<span class="loro-card-nav__icon">
|
|
769
|
+
<loro-icon
|
|
770
|
+
[name]="icon()!"
|
|
771
|
+
[size]="iconSize()"
|
|
772
|
+
[alt]="title()"
|
|
773
|
+
[color]="variant() === 'danger' ? 'danger' : iconColor()" />
|
|
774
|
+
</span>
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
<span class="loro-card-nav__copy">
|
|
778
|
+
<span class="loro-card-nav__title">{{ title() }}</span>
|
|
779
|
+
@if (description()) {
|
|
780
|
+
<span class="loro-card-nav__description">{{ description() }}</span>
|
|
781
|
+
}
|
|
782
|
+
</span>
|
|
783
|
+
|
|
784
|
+
<span class="loro-card-nav__trailing" (click)="$event.stopPropagation()">
|
|
785
|
+
@switch (trailing()) {
|
|
786
|
+
@case ('toggle') {
|
|
787
|
+
<loro-toggle [checked]="checked()" [ariaLabel]="title()" (checkedChange)="checkedChange.emit($event)" />
|
|
788
|
+
}
|
|
789
|
+
@case ('radio') {
|
|
790
|
+
<loro-radio [label]="''" [value]="value()" [checked]="selected()" (selected)="selectedChange.emit($event)" />
|
|
791
|
+
}
|
|
792
|
+
@case ('text') {
|
|
793
|
+
<span class="loro-card-nav__value">{{ value() }}</span>
|
|
794
|
+
}
|
|
795
|
+
@case ('badge') {
|
|
796
|
+
<loro-badge [label]="badgeLabel() || value()" [variant]="badgeVariant()" />
|
|
797
|
+
}
|
|
798
|
+
@case ('arrow') {
|
|
799
|
+
<loro-icon
|
|
800
|
+
class="loro-card-nav__arrow"
|
|
801
|
+
name="chevron-right"
|
|
802
|
+
[size]="22"
|
|
803
|
+
alt="Abrir"
|
|
804
|
+
[color]="variant() === 'danger' ? 'danger' : 'primary'" />
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
</span>
|
|
808
|
+
</button>
|
|
809
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-card-nav{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1rem;width:100%;min-height:4.8rem;padding:.95rem 1.1rem;border:0;border-bottom:1px solid var(--loro-border-subtle);background:transparent;color:var(--loro-text);font:inherit;text-align:left;cursor:pointer}.loro-card-nav:last-child{border-bottom:0}.loro-card-nav--soft,.loro-card-nav--danger{border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-card-nav--danger{border-color:color-mix(in srgb,var(--loro-danger-text) 30%,transparent);background:var(--loro-danger-surface);color:var(--loro-danger-text)}.loro-card-nav--selected{border-color:#6c3cff52;background:#6c3cff0a}.loro-card-nav__icon{display:grid;width:3.15rem;height:3.15rem;place-items:center;border-radius:.9rem;background:var(--loro-brand-tint-surface)}.loro-card-nav--danger .loro-card-nav__icon{background:color-mix(in srgb,var(--loro-danger-text) 12%,transparent)}.loro-card-nav__copy{display:grid;gap:.25rem;min-width:0}.loro-card-nav__title{color:currentColor;font-size:1rem;font-weight:900;line-height:1.2}.loro-card-nav__description{color:var(--loro-muted);font-size:.9rem;font-weight:600;line-height:1.35}.loro-card-nav--danger .loro-card-nav__description{color:color-mix(in srgb,var(--loro-danger-text) 72%,var(--loro-muted))}.loro-card-nav__trailing{display:inline-flex;align-items:center;justify-content:flex-end;min-width:0}.loro-card-nav__value{color:var(--loro-muted-strong);font-weight:800;white-space:nowrap}@media(max-width:520px){.loro-card-nav{gap:.85rem;min-height:5.2rem;padding-inline:1rem}.loro-card-nav__icon{width:3rem;height:3rem}}\n"], dependencies: [{ kind: "component", type: LoroBadge$1, selector: "loro-badge", inputs: ["label", "variant"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroRadio$1, selector: "loro-radio", inputs: ["label", "value", "description", "checked", "variant"], outputs: ["selected"] }, { kind: "component", type: LoroToggle$1, selector: "loro-toggle", inputs: ["checked", "disabled", "ariaLabel"], outputs: ["checkedChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
810
|
+
}
|
|
811
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCardNav, decorators: [{
|
|
812
|
+
type: Component,
|
|
813
|
+
args: [{ selector: 'loro-card-nav', standalone: true, imports: [LoroBadge$1, LoroIcon$1, LoroRadio$1, LoroToggle$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
814
|
+
<button
|
|
815
|
+
type="button"
|
|
816
|
+
class="loro-card-nav"
|
|
817
|
+
[class.loro-card-nav--danger]="variant() === 'danger'"
|
|
818
|
+
[class.loro-card-nav--soft]="variant() === 'soft'"
|
|
819
|
+
[class.loro-card-nav--selected]="selected()"
|
|
820
|
+
(click)="activate()">
|
|
821
|
+
@if (icon()) {
|
|
822
|
+
<span class="loro-card-nav__icon">
|
|
823
|
+
<loro-icon
|
|
824
|
+
[name]="icon()!"
|
|
825
|
+
[size]="iconSize()"
|
|
826
|
+
[alt]="title()"
|
|
827
|
+
[color]="variant() === 'danger' ? 'danger' : iconColor()" />
|
|
828
|
+
</span>
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
<span class="loro-card-nav__copy">
|
|
832
|
+
<span class="loro-card-nav__title">{{ title() }}</span>
|
|
833
|
+
@if (description()) {
|
|
834
|
+
<span class="loro-card-nav__description">{{ description() }}</span>
|
|
835
|
+
}
|
|
836
|
+
</span>
|
|
837
|
+
|
|
838
|
+
<span class="loro-card-nav__trailing" (click)="$event.stopPropagation()">
|
|
839
|
+
@switch (trailing()) {
|
|
840
|
+
@case ('toggle') {
|
|
841
|
+
<loro-toggle [checked]="checked()" [ariaLabel]="title()" (checkedChange)="checkedChange.emit($event)" />
|
|
842
|
+
}
|
|
843
|
+
@case ('radio') {
|
|
844
|
+
<loro-radio [label]="''" [value]="value()" [checked]="selected()" (selected)="selectedChange.emit($event)" />
|
|
845
|
+
}
|
|
846
|
+
@case ('text') {
|
|
847
|
+
<span class="loro-card-nav__value">{{ value() }}</span>
|
|
848
|
+
}
|
|
849
|
+
@case ('badge') {
|
|
850
|
+
<loro-badge [label]="badgeLabel() || value()" [variant]="badgeVariant()" />
|
|
851
|
+
}
|
|
852
|
+
@case ('arrow') {
|
|
853
|
+
<loro-icon
|
|
854
|
+
class="loro-card-nav__arrow"
|
|
855
|
+
name="chevron-right"
|
|
856
|
+
[size]="22"
|
|
857
|
+
alt="Abrir"
|
|
858
|
+
[color]="variant() === 'danger' ? 'danger' : 'primary'" />
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
</span>
|
|
862
|
+
</button>
|
|
863
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-card-nav{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1rem;width:100%;min-height:4.8rem;padding:.95rem 1.1rem;border:0;border-bottom:1px solid var(--loro-border-subtle);background:transparent;color:var(--loro-text);font:inherit;text-align:left;cursor:pointer}.loro-card-nav:last-child{border-bottom:0}.loro-card-nav--soft,.loro-card-nav--danger{border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-card-nav--danger{border-color:color-mix(in srgb,var(--loro-danger-text) 30%,transparent);background:var(--loro-danger-surface);color:var(--loro-danger-text)}.loro-card-nav--selected{border-color:#6c3cff52;background:#6c3cff0a}.loro-card-nav__icon{display:grid;width:3.15rem;height:3.15rem;place-items:center;border-radius:.9rem;background:var(--loro-brand-tint-surface)}.loro-card-nav--danger .loro-card-nav__icon{background:color-mix(in srgb,var(--loro-danger-text) 12%,transparent)}.loro-card-nav__copy{display:grid;gap:.25rem;min-width:0}.loro-card-nav__title{color:currentColor;font-size:1rem;font-weight:900;line-height:1.2}.loro-card-nav__description{color:var(--loro-muted);font-size:.9rem;font-weight:600;line-height:1.35}.loro-card-nav--danger .loro-card-nav__description{color:color-mix(in srgb,var(--loro-danger-text) 72%,var(--loro-muted))}.loro-card-nav__trailing{display:inline-flex;align-items:center;justify-content:flex-end;min-width:0}.loro-card-nav__value{color:var(--loro-muted-strong);font-weight:800;white-space:nowrap}@media(max-width:520px){.loro-card-nav{gap:.85rem;min-height:5.2rem;padding-inline:1rem}.loro-card-nav__icon{width:3rem;height:3rem}}\n"] }]
|
|
864
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], iconColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconColor", required: false }] }], route: [{ type: i0.Input, args: [{ isSignal: true, alias: "route", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], trailing: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailing", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], badgeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeLabel", required: false }] }], badgeVariant: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeVariant", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
865
|
+
|
|
866
|
+
class LoroDashboardCard {
|
|
867
|
+
haptics = inject(LoroHapticsService$1);
|
|
868
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
869
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
870
|
+
link = input('/', ...(ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []));
|
|
871
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
872
|
+
illustration = input(null, ...(ngDevMode ? [{ debugName: "illustration" }] : /* istanbul ignore next */ []));
|
|
873
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
874
|
+
showArrow = input(true, ...(ngDevMode ? [{ debugName: "showArrow" }] : /* istanbul ignore next */ []));
|
|
875
|
+
iconSize = input(88, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
876
|
+
arrowSize = input(24, ...(ngDevMode ? [{ debugName: "arrowSize" }] : /* istanbul ignore next */ []));
|
|
877
|
+
onCardClick() {
|
|
878
|
+
this.haptics.impact('light');
|
|
879
|
+
}
|
|
880
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDashboardCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
881
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroDashboardCard, isStandalone: true, selector: "loro-dashboard-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, illustration: { classPropertyName: "illustration", publicName: "illustration", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, showArrow: { classPropertyName: "showArrow", publicName: "showArrow", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, arrowSize: { classPropertyName: "arrowSize", publicName: "arrowSize", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<a\n class=\"loro-dashboard-card\"\n [class.loro-dashboard-card--home]=\"variant() === 'home'\"\n data-touch-hover\n [routerLink]=\"link()\"\n (click)=\"onCardClick()\"\n>\n <div class=\"loro-dashboard-card__media\" aria-hidden=\"true\">\n @if (illustration()) {\n <loro-image\n [name]=\"illustration()!\"\n [alt]=\"title()\"\n width=\"100%\"\n />\n } @else if (icon()) {\n <loro-icon\n [name]=\"icon()!\"\n [size]=\"iconSize()\"\n [alt]=\"title()\"\n />\n }\n </div>\n\n <div class=\"loro-dashboard-card__content\">\n <h3>{{ title() }}</h3>\n\n @if (description()) {\n <p>{{ description() }}</p>\n }\n </div>\n\n @if (showArrow()) {\n <div class=\"loro-dashboard-card__arrow\" aria-hidden=\"true\">\n <loro-icon name=\"arrow-right\" [size]=\"arrowSize()\" alt=\"Ir\" />\n </div>\n }\n</a>\n", styles: [":host{display:block;width:100%;min-width:0;height:100%;container-type:inline-size}.loro-dashboard-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--loro-dashboard-card-media-size, 5rem) minmax(var(--loro-dashboard-card-content-min-height, 5.25rem),auto);align-content:center;align-items:start;justify-items:center;gap:var(--loro-dashboard-card-gap, 1rem);width:100%;min-width:0;height:100%;min-height:var(--loro-dashboard-card-min-height, 14.5rem);overflow:hidden;border:1px solid var(--loro-dashboard-card-border, var(--loro-border-subtle));border-radius:var(--loro-dashboard-card-radius, var(--loro-radius-card));background:var(--loro-surface-soft);padding:var(--loro-dashboard-card-padding, 1.625rem 1.25rem);box-shadow:var(--loro-dashboard-card-shadow, var(--loro-shadow-soft));color:inherit;font-family:var(--loro-font-brand);text-align:center;text-decoration:none;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.loro-dashboard-card:hover,.loro-dashboard-card.is-touch-hover{transform:translateY(-.125rem);border-color:var(--loro-dashboard-card-hover-border, var(--loro-border-strong));box-shadow:var(--loro-dashboard-card-hover-shadow, var(--loro-shadow-panel))}.loro-dashboard-card:active{transform:translateY(0)}.loro-dashboard-card:focus-visible{outline:.1875rem solid var(--loro-focus-ring);outline-offset:.1875rem}.loro-dashboard-card__media{display:grid;width:var(--loro-dashboard-card-media-size, 5rem);height:var(--loro-dashboard-card-media-size, 5rem);place-items:center;min-width:0;color:var(--loro-dashboard-card-icon-color, var(--loro-primary-500));line-height:0}.loro-dashboard-card__media loro-icon,.loro-dashboard-card__media loro-image{display:block;max-width:100%;max-height:100%}.loro-dashboard-card__content{display:grid;grid-template-rows:minmax(var(--loro-dashboard-card-title-min-height, 1.375rem),auto) minmax(var(--loro-dashboard-card-description-min-height, 3.25rem),auto);align-content:start;gap:var(--loro-dashboard-card-content-gap, .5rem);min-width:0;min-height:var(--loro-dashboard-card-content-min-height, 5.25rem);justify-items:center}.loro-dashboard-card__content h3{display:flex;align-items:end;justify-content:center;min-height:var(--loro-dashboard-card-title-min-height, 1.375rem);margin:0;max-width:100%;color:var(--loro-dashboard-card-title-color, var(--loro-primary-900));font-size:var(--loro-dashboard-card-title-size, clamp(1rem, 4.8cqi, 1.25rem));font-weight:var(--loro-dashboard-card-title-weight, 800);line-height:1.1;letter-spacing:-.035em;text-align:center;overflow-wrap:anywhere}.loro-dashboard-card__content p{margin:0;max-width:var(--loro-dashboard-card-description-width, 13.5rem);min-height:var(--loro-dashboard-card-description-min-height, 3.25rem);color:var(--loro-dashboard-card-description-color, var(--loro-muted));font-size:var(--loro-dashboard-card-description-size, clamp(.8125rem, 3.8cqi, .975rem));font-weight:500;line-height:1.35;text-align:center;overflow-wrap:anywhere}.loro-dashboard-card__arrow{display:none;color:var(--loro-dashboard-card-arrow-color, var(--loro-primary-500));line-height:0}.loro-dashboard-card--home{grid-template-rows:var(--loro-dashboard-card-home-media-size, 3rem) minmax(0,1fr) auto;align-content:start;justify-items:stretch;gap:.9rem;min-height:9.75rem;isolation:isolate;border-color:var(--loro-home-card-border);border-radius:1.45rem;background:var(--loro-surface-soft);padding:1rem;text-align:left}.loro-dashboard-card--home .loro-dashboard-card__media{position:relative;width:var(--loro-dashboard-card-home-media-size, 3rem);height:var(--loro-dashboard-card-home-media-size, 3rem);border:1px solid rgba(255,255,255,.2);border-radius:1.15rem;background:var(--loro-home-card-icon-bg);box-shadow:var(--loro-home-card-icon-shadow);color:var(--loro-home-card-icon-color)}.loro-dashboard-card--home .loro-dashboard-card__content{grid-template-rows:auto auto;justify-items:start;gap:.4rem;min-height:0}.loro-dashboard-card--home .loro-dashboard-card__content h3,.loro-dashboard-card--home .loro-dashboard-card__content p{text-align:left}.loro-dashboard-card--home .loro-dashboard-card__content h3{color:var(--loro-home-card-title);font-size:1.16rem;font-weight:800;letter-spacing:-.02em}.loro-dashboard-card--home .loro-dashboard-card__content p{max-width:none;min-height:0;color:var(--loro-home-card-description);font-size:.9rem;line-height:1.45}.loro-dashboard-card--home .loro-dashboard-card__arrow{display:inline-flex;justify-self:end;color:var(--loro-home-card-arrow-color)}.loro-dashboard-card--home:hover,.loro-dashboard-card--home.is-touch-hover{transform:translateY(-.24rem) scale(1.01);border-color:var(--loro-home-card-hover-border);box-shadow:var(--loro-home-card-hover-shadow)}.loro-dashboard-card--home:before,.loro-dashboard-card--home:after{position:absolute;inset:0;content:\"\";pointer-events:none}.loro-dashboard-card--home>*{position:relative;z-index:1}@container (min-width: 18rem){.loro-dashboard-card{grid-template-columns:var(--loro-dashboard-card-desktop-media-size, 5.25rem) minmax(0,1fr) auto;grid-template-rows:auto;align-content:center;align-items:center;justify-items:start;gap:var(--loro-dashboard-card-desktop-gap, 1.5rem);min-height:var(--loro-dashboard-card-row-min-height, 6.75rem);padding:var(--loro-dashboard-card-desktop-padding, 1.25rem 1.5rem);border-radius:var(--loro-dashboard-card-desktop-radius, 1rem);text-align:left}.loro-dashboard-card__media{width:var(--loro-dashboard-card-desktop-media-size, 5.25rem);height:var(--loro-dashboard-card-desktop-media-size, 5.25rem);justify-self:start}.loro-dashboard-card__content{grid-template-rows:auto auto;gap:var(--loro-dashboard-card-desktop-content-gap, .5rem);min-height:0;justify-items:start}.loro-dashboard-card__content h3,.loro-dashboard-card__content p{min-height:0;text-align:left}.loro-dashboard-card__content h3{font-size:var(--loro-dashboard-card-desktop-title-size, 1rem)}.loro-dashboard-card__content p{max-width:var(--loro-dashboard-card-desktop-description-width, 18rem);font-size:var(--loro-dashboard-card-desktop-description-size, .8125rem)}.loro-dashboard-card__arrow{display:flex;align-items:center;justify-content:flex-end;justify-self:end;margin-top:auto}.loro-dashboard-card--home{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--loro-dashboard-card-home-media-size, 3rem) minmax(0,1fr) auto;align-items:start;justify-items:stretch;gap:.9rem;min-height:9.75rem;padding:1rem}.loro-dashboard-card--home .loro-dashboard-card__media{justify-self:start;width:var(--loro-dashboard-card-home-media-size, 3rem);height:var(--loro-dashboard-card-home-media-size, 3rem)}.loro-dashboard-card--home .loro-dashboard-card__content{justify-items:start}.loro-dashboard-card--home .loro-dashboard-card__arrow{display:inline-flex}}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
882
|
+
}
|
|
883
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDashboardCard, decorators: [{
|
|
884
|
+
type: Component,
|
|
885
|
+
args: [{ selector: 'loro-dashboard-card', standalone: true, imports: [RouterLink, LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"loro-dashboard-card\"\n [class.loro-dashboard-card--home]=\"variant() === 'home'\"\n data-touch-hover\n [routerLink]=\"link()\"\n (click)=\"onCardClick()\"\n>\n <div class=\"loro-dashboard-card__media\" aria-hidden=\"true\">\n @if (illustration()) {\n <loro-image\n [name]=\"illustration()!\"\n [alt]=\"title()\"\n width=\"100%\"\n />\n } @else if (icon()) {\n <loro-icon\n [name]=\"icon()!\"\n [size]=\"iconSize()\"\n [alt]=\"title()\"\n />\n }\n </div>\n\n <div class=\"loro-dashboard-card__content\">\n <h3>{{ title() }}</h3>\n\n @if (description()) {\n <p>{{ description() }}</p>\n }\n </div>\n\n @if (showArrow()) {\n <div class=\"loro-dashboard-card__arrow\" aria-hidden=\"true\">\n <loro-icon name=\"arrow-right\" [size]=\"arrowSize()\" alt=\"Ir\" />\n </div>\n }\n</a>\n", styles: [":host{display:block;width:100%;min-width:0;height:100%;container-type:inline-size}.loro-dashboard-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:var(--loro-dashboard-card-media-size, 5rem) minmax(var(--loro-dashboard-card-content-min-height, 5.25rem),auto);align-content:center;align-items:start;justify-items:center;gap:var(--loro-dashboard-card-gap, 1rem);width:100%;min-width:0;height:100%;min-height:var(--loro-dashboard-card-min-height, 14.5rem);overflow:hidden;border:1px solid var(--loro-dashboard-card-border, var(--loro-border-subtle));border-radius:var(--loro-dashboard-card-radius, var(--loro-radius-card));background:var(--loro-surface-soft);padding:var(--loro-dashboard-card-padding, 1.625rem 1.25rem);box-shadow:var(--loro-dashboard-card-shadow, var(--loro-shadow-soft));color:inherit;font-family:var(--loro-font-brand);text-align:center;text-decoration:none;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.loro-dashboard-card:hover,.loro-dashboard-card.is-touch-hover{transform:translateY(-.125rem);border-color:var(--loro-dashboard-card-hover-border, var(--loro-border-strong));box-shadow:var(--loro-dashboard-card-hover-shadow, var(--loro-shadow-panel))}.loro-dashboard-card:active{transform:translateY(0)}.loro-dashboard-card:focus-visible{outline:.1875rem solid var(--loro-focus-ring);outline-offset:.1875rem}.loro-dashboard-card__media{display:grid;width:var(--loro-dashboard-card-media-size, 5rem);height:var(--loro-dashboard-card-media-size, 5rem);place-items:center;min-width:0;color:var(--loro-dashboard-card-icon-color, var(--loro-primary-500));line-height:0}.loro-dashboard-card__media loro-icon,.loro-dashboard-card__media loro-image{display:block;max-width:100%;max-height:100%}.loro-dashboard-card__content{display:grid;grid-template-rows:minmax(var(--loro-dashboard-card-title-min-height, 1.375rem),auto) minmax(var(--loro-dashboard-card-description-min-height, 3.25rem),auto);align-content:start;gap:var(--loro-dashboard-card-content-gap, .5rem);min-width:0;min-height:var(--loro-dashboard-card-content-min-height, 5.25rem);justify-items:center}.loro-dashboard-card__content h3{display:flex;align-items:end;justify-content:center;min-height:var(--loro-dashboard-card-title-min-height, 1.375rem);margin:0;max-width:100%;color:var(--loro-dashboard-card-title-color, var(--loro-primary-900));font-size:var(--loro-dashboard-card-title-size, clamp(1rem, 4.8cqi, 1.25rem));font-weight:var(--loro-dashboard-card-title-weight, 800);line-height:1.1;letter-spacing:-.035em;text-align:center;overflow-wrap:anywhere}.loro-dashboard-card__content p{margin:0;max-width:var(--loro-dashboard-card-description-width, 13.5rem);min-height:var(--loro-dashboard-card-description-min-height, 3.25rem);color:var(--loro-dashboard-card-description-color, var(--loro-muted));font-size:var(--loro-dashboard-card-description-size, clamp(.8125rem, 3.8cqi, .975rem));font-weight:500;line-height:1.35;text-align:center;overflow-wrap:anywhere}.loro-dashboard-card__arrow{display:none;color:var(--loro-dashboard-card-arrow-color, var(--loro-primary-500));line-height:0}.loro-dashboard-card--home{grid-template-rows:var(--loro-dashboard-card-home-media-size, 3rem) minmax(0,1fr) auto;align-content:start;justify-items:stretch;gap:.9rem;min-height:9.75rem;isolation:isolate;border-color:var(--loro-home-card-border);border-radius:1.45rem;background:var(--loro-surface-soft);padding:1rem;text-align:left}.loro-dashboard-card--home .loro-dashboard-card__media{position:relative;width:var(--loro-dashboard-card-home-media-size, 3rem);height:var(--loro-dashboard-card-home-media-size, 3rem);border:1px solid rgba(255,255,255,.2);border-radius:1.15rem;background:var(--loro-home-card-icon-bg);box-shadow:var(--loro-home-card-icon-shadow);color:var(--loro-home-card-icon-color)}.loro-dashboard-card--home .loro-dashboard-card__content{grid-template-rows:auto auto;justify-items:start;gap:.4rem;min-height:0}.loro-dashboard-card--home .loro-dashboard-card__content h3,.loro-dashboard-card--home .loro-dashboard-card__content p{text-align:left}.loro-dashboard-card--home .loro-dashboard-card__content h3{color:var(--loro-home-card-title);font-size:1.16rem;font-weight:800;letter-spacing:-.02em}.loro-dashboard-card--home .loro-dashboard-card__content p{max-width:none;min-height:0;color:var(--loro-home-card-description);font-size:.9rem;line-height:1.45}.loro-dashboard-card--home .loro-dashboard-card__arrow{display:inline-flex;justify-self:end;color:var(--loro-home-card-arrow-color)}.loro-dashboard-card--home:hover,.loro-dashboard-card--home.is-touch-hover{transform:translateY(-.24rem) scale(1.01);border-color:var(--loro-home-card-hover-border);box-shadow:var(--loro-home-card-hover-shadow)}.loro-dashboard-card--home:before,.loro-dashboard-card--home:after{position:absolute;inset:0;content:\"\";pointer-events:none}.loro-dashboard-card--home>*{position:relative;z-index:1}@container (min-width: 18rem){.loro-dashboard-card{grid-template-columns:var(--loro-dashboard-card-desktop-media-size, 5.25rem) minmax(0,1fr) auto;grid-template-rows:auto;align-content:center;align-items:center;justify-items:start;gap:var(--loro-dashboard-card-desktop-gap, 1.5rem);min-height:var(--loro-dashboard-card-row-min-height, 6.75rem);padding:var(--loro-dashboard-card-desktop-padding, 1.25rem 1.5rem);border-radius:var(--loro-dashboard-card-desktop-radius, 1rem);text-align:left}.loro-dashboard-card__media{width:var(--loro-dashboard-card-desktop-media-size, 5.25rem);height:var(--loro-dashboard-card-desktop-media-size, 5.25rem);justify-self:start}.loro-dashboard-card__content{grid-template-rows:auto auto;gap:var(--loro-dashboard-card-desktop-content-gap, .5rem);min-height:0;justify-items:start}.loro-dashboard-card__content h3,.loro-dashboard-card__content p{min-height:0;text-align:left}.loro-dashboard-card__content h3{font-size:var(--loro-dashboard-card-desktop-title-size, 1rem)}.loro-dashboard-card__content p{max-width:var(--loro-dashboard-card-desktop-description-width, 18rem);font-size:var(--loro-dashboard-card-desktop-description-size, .8125rem)}.loro-dashboard-card__arrow{display:flex;align-items:center;justify-content:flex-end;justify-self:end;margin-top:auto}.loro-dashboard-card--home{grid-template-columns:minmax(0,1fr);grid-template-rows:var(--loro-dashboard-card-home-media-size, 3rem) minmax(0,1fr) auto;align-items:start;justify-items:stretch;gap:.9rem;min-height:9.75rem;padding:1rem}.loro-dashboard-card--home .loro-dashboard-card__media{justify-self:start;width:var(--loro-dashboard-card-home-media-size, 3rem);height:var(--loro-dashboard-card-home-media-size, 3rem)}.loro-dashboard-card--home .loro-dashboard-card__content{justify-items:start}.loro-dashboard-card--home .loro-dashboard-card__arrow{display:inline-flex}}\n"] }]
|
|
886
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], illustration: [{ type: i0.Input, args: [{ isSignal: true, alias: "illustration", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], showArrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "showArrow", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], arrowSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "arrowSize", required: false }] }] } });
|
|
887
|
+
|
|
888
|
+
class LoroDivider {
|
|
889
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
890
|
+
align = input('center', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
891
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDivider, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
892
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroDivider, isStandalone: true, selector: "loro-divider", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
893
|
+
<div
|
|
894
|
+
class="loro-divider"
|
|
895
|
+
role="presentation"
|
|
896
|
+
[class.loro-divider--left]="align() === 'left'"
|
|
897
|
+
[class.loro-divider--right]="align() === 'right'"
|
|
898
|
+
>
|
|
899
|
+
<span class="loro-divider__line"></span>
|
|
900
|
+
@if (text()) {
|
|
901
|
+
<p class="loro-divider__text">{{ text() }}</p>
|
|
902
|
+
}
|
|
903
|
+
<span class="loro-divider__line"></span>
|
|
904
|
+
</div>
|
|
905
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-divider{display:flex;align-items:center;gap:.9rem;color:var(--loro-muted)}.loro-divider__line{height:1px;flex:1;background:color-mix(in srgb,var(--loro-muted) 30%,transparent)}.loro-divider__text{margin:0;font-size:.9rem;font-weight:850;line-height:1;white-space:nowrap}.loro-divider--left .loro-divider__line:last-child{flex:999}.loro-divider--right .loro-divider__line:first-child{flex:999}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
906
|
+
}
|
|
907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDivider, decorators: [{
|
|
908
|
+
type: Component,
|
|
909
|
+
args: [{ selector: 'loro-divider', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
910
|
+
<div
|
|
911
|
+
class="loro-divider"
|
|
912
|
+
role="presentation"
|
|
913
|
+
[class.loro-divider--left]="align() === 'left'"
|
|
914
|
+
[class.loro-divider--right]="align() === 'right'"
|
|
915
|
+
>
|
|
916
|
+
<span class="loro-divider__line"></span>
|
|
917
|
+
@if (text()) {
|
|
918
|
+
<p class="loro-divider__text">{{ text() }}</p>
|
|
919
|
+
}
|
|
920
|
+
<span class="loro-divider__line"></span>
|
|
921
|
+
</div>
|
|
922
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-divider{display:flex;align-items:center;gap:.9rem;color:var(--loro-muted)}.loro-divider__line{height:1px;flex:1;background:color-mix(in srgb,var(--loro-muted) 30%,transparent)}.loro-divider__text{margin:0;font-size:.9rem;font-weight:850;line-height:1;white-space:nowrap}.loro-divider--left .loro-divider__line:last-child{flex:999}.loro-divider--right .loro-divider__line:first-child{flex:999}\n"] }]
|
|
923
|
+
}], propDecorators: { text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }] } });
|
|
924
|
+
|
|
925
|
+
const TOUCH_TAP_TOLERANCE_PX = 10;
|
|
926
|
+
const TOUCH_SWIPE_START_PX = 8;
|
|
927
|
+
const SWIPE_REVEAL_PX = 104;
|
|
928
|
+
const SWIPE_MAX_PX = 176;
|
|
929
|
+
const SWIPE_DELETE_EXTRA_PX = 48;
|
|
930
|
+
const REMOVE_ANIMATION_MS = 180;
|
|
931
|
+
class LoroProductRow {
|
|
932
|
+
variant = input('basket', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
933
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
934
|
+
meta = input('', ...(ngDevMode ? [{ debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
935
|
+
imageName = input(null, ...(ngDevMode ? [{ debugName: "imageName" }] : /* istanbul ignore next */ []));
|
|
936
|
+
quantityLabel = input('', ...(ngDevMode ? [{ debugName: "quantityLabel" }] : /* istanbul ignore next */ []));
|
|
937
|
+
quantity = input(null, ...(ngDevMode ? [{ debugName: "quantity" }] : /* istanbul ignore next */ []));
|
|
938
|
+
unit = input('ud', ...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
|
|
939
|
+
total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
940
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
941
|
+
divider = input(false, ...(ngDevMode ? [{ debugName: "divider" }] : /* istanbul ignore next */ []));
|
|
942
|
+
status = input('ok', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
943
|
+
prices = input([], ...(ngDevMode ? [{ debugName: "prices" }] : /* istanbul ignore next */ []));
|
|
944
|
+
checkedChange = output();
|
|
945
|
+
quantityChange = output();
|
|
946
|
+
increment = output();
|
|
947
|
+
decrement = output();
|
|
948
|
+
rowRemove = output();
|
|
949
|
+
swipeDragging = signal(false, ...(ngDevMode ? [{ debugName: "swipeDragging" }] : /* istanbul ignore next */ []));
|
|
950
|
+
swipeArmed = signal(false, ...(ngDevMode ? [{ debugName: "swipeArmed" }] : /* istanbul ignore next */ []));
|
|
951
|
+
swipeRemoving = signal(false, ...(ngDevMode ? [{ debugName: "swipeRemoving" }] : /* istanbul ignore next */ []));
|
|
952
|
+
swipeOffsetX = signal(0, ...(ngDevMode ? [{ debugName: "swipeOffsetX" }] : /* istanbul ignore next */ []));
|
|
953
|
+
touchStartX = 0;
|
|
954
|
+
touchStartY = 0;
|
|
955
|
+
touchStartedOnInteractive = false;
|
|
956
|
+
touchMoved = false;
|
|
957
|
+
suppressNextClick = false;
|
|
958
|
+
swipeTransform() {
|
|
959
|
+
const offset = this.swipeOffsetX();
|
|
960
|
+
return offset === 0 ? null : `translateX(${offset}px)`;
|
|
961
|
+
}
|
|
962
|
+
deleteActionTransform() {
|
|
963
|
+
if (!this.isSwipeRemovable()) {
|
|
964
|
+
return null;
|
|
965
|
+
}
|
|
966
|
+
const offset = Math.abs(this.swipeOffsetX());
|
|
967
|
+
const progress = Math.min(offset / SWIPE_REVEAL_PX, 1);
|
|
968
|
+
const translateX = (1 - progress) * 2.5;
|
|
969
|
+
return `translateX(${translateX}rem)`;
|
|
970
|
+
}
|
|
971
|
+
isSwipeRemovable() {
|
|
972
|
+
return this.variant() === 'basket' || this.variant() === 'pantry';
|
|
973
|
+
}
|
|
974
|
+
quantityValue() {
|
|
975
|
+
const quantity = this.quantity();
|
|
976
|
+
if (quantity !== null) {
|
|
977
|
+
return this.formatQuantity(quantity);
|
|
978
|
+
}
|
|
979
|
+
return this.quantityLabel().replace(this.normalizedUnit(), '').trim();
|
|
980
|
+
}
|
|
981
|
+
updateQuantity(value) {
|
|
982
|
+
const parsed = Number(value.replace(',', '.'));
|
|
983
|
+
if (!Number.isFinite(parsed)) {
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
this.quantityChange.emit(this.normalizedUnit() === 'ud'
|
|
987
|
+
? Math.min(100, Math.max(1, Math.round(parsed)))
|
|
988
|
+
: Math.min(100, Math.max(0.5, parsed)));
|
|
989
|
+
}
|
|
990
|
+
onRowTouchStart(event) {
|
|
991
|
+
if (!this.isSwipeRemovable() || !this.isMobileViewport() || event.touches.length !== 1) {
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
if (this.swipeRemoving()) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
const touch = event.touches[0];
|
|
998
|
+
this.touchStartX = touch.clientX;
|
|
999
|
+
this.touchStartY = touch.clientY;
|
|
1000
|
+
this.touchMoved = false;
|
|
1001
|
+
this.touchStartedOnInteractive = this.isInteractiveTarget(event.target);
|
|
1002
|
+
this.swipeDragging.set(false);
|
|
1003
|
+
}
|
|
1004
|
+
onRowTouchMove(event) {
|
|
1005
|
+
if (!this.isSwipeRemovable() ||
|
|
1006
|
+
!this.isMobileViewport() ||
|
|
1007
|
+
this.touchStartedOnInteractive ||
|
|
1008
|
+
event.touches.length !== 1) {
|
|
1009
|
+
return;
|
|
1010
|
+
}
|
|
1011
|
+
const touch = event.touches[0];
|
|
1012
|
+
const deltaX = touch.clientX - this.touchStartX;
|
|
1013
|
+
const deltaY = touch.clientY - this.touchStartY;
|
|
1014
|
+
const movedDistance = Math.hypot(deltaX, deltaY);
|
|
1015
|
+
if (movedDistance > TOUCH_TAP_TOLERANCE_PX) {
|
|
1016
|
+
this.touchMoved = true;
|
|
1017
|
+
}
|
|
1018
|
+
if (Math.abs(deltaY) > Math.abs(deltaX) && !this.swipeDragging()) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
const nextOffset = this.swipeArmed()
|
|
1022
|
+
? Math.max(-SWIPE_MAX_PX, Math.min(-SWIPE_REVEAL_PX, -SWIPE_REVEAL_PX + deltaX))
|
|
1023
|
+
: Math.max(deltaX, -SWIPE_MAX_PX);
|
|
1024
|
+
if (nextOffset < -TOUCH_SWIPE_START_PX || (this.swipeArmed() && nextOffset !== -SWIPE_REVEAL_PX)) {
|
|
1025
|
+
this.touchMoved = true;
|
|
1026
|
+
this.swipeDragging.set(true);
|
|
1027
|
+
this.swipeOffsetX.set(nextOffset);
|
|
1028
|
+
event.preventDefault();
|
|
1029
|
+
event.stopPropagation();
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
onRowTouchEnd(event) {
|
|
1033
|
+
if (!this.isSwipeRemovable() || !this.isMobileViewport() || this.touchStartedOnInteractive) {
|
|
1034
|
+
this.resetSwipe();
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
const offset = this.swipeOffsetX();
|
|
1038
|
+
if (this.swipeArmed()) {
|
|
1039
|
+
if (offset <= -(SWIPE_REVEAL_PX + SWIPE_DELETE_EXTRA_PX)) {
|
|
1040
|
+
this.triggerRemove(event);
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
if (offset > -(SWIPE_REVEAL_PX - 20)) {
|
|
1044
|
+
this.suppressNextClick = true;
|
|
1045
|
+
event.preventDefault();
|
|
1046
|
+
event.stopPropagation();
|
|
1047
|
+
this.swipeArmed.set(false);
|
|
1048
|
+
this.resetSwipe();
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
this.suppressNextClick = true;
|
|
1052
|
+
event.preventDefault();
|
|
1053
|
+
event.stopPropagation();
|
|
1054
|
+
this.swipeDragging.set(false);
|
|
1055
|
+
this.swipeOffsetX.set(-SWIPE_REVEAL_PX);
|
|
1056
|
+
return;
|
|
1057
|
+
}
|
|
1058
|
+
if (offset <= -SWIPE_REVEAL_PX) {
|
|
1059
|
+
this.suppressNextClick = true;
|
|
1060
|
+
event.preventDefault();
|
|
1061
|
+
event.stopPropagation();
|
|
1062
|
+
this.swipeArmed.set(true);
|
|
1063
|
+
this.swipeDragging.set(false);
|
|
1064
|
+
this.swipeOffsetX.set(-SWIPE_REVEAL_PX);
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
if (this.variant() === 'basket' && !this.touchMoved && !this.isInteractiveTarget(event.target)) {
|
|
1068
|
+
this.suppressNextClick = true;
|
|
1069
|
+
event.preventDefault();
|
|
1070
|
+
event.stopPropagation();
|
|
1071
|
+
this.checkedChange.emit(!this.checked());
|
|
1072
|
+
}
|
|
1073
|
+
else if (this.touchMoved) {
|
|
1074
|
+
this.suppressNextClick = true;
|
|
1075
|
+
event.preventDefault();
|
|
1076
|
+
event.stopPropagation();
|
|
1077
|
+
}
|
|
1078
|
+
this.resetSwipe();
|
|
1079
|
+
}
|
|
1080
|
+
onRowTouchCancel() {
|
|
1081
|
+
this.resetSwipe();
|
|
1082
|
+
}
|
|
1083
|
+
onBasketClick(event) {
|
|
1084
|
+
if (this.variant() !== 'basket') {
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
if (this.isMobileViewport()) {
|
|
1088
|
+
if (this.suppressNextClick || this.swipeArmed() || !this.isInteractiveTarget(event.target)) {
|
|
1089
|
+
event.preventDefault();
|
|
1090
|
+
event.stopPropagation();
|
|
1091
|
+
this.suppressNextClick = false;
|
|
1092
|
+
}
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
if (!this.isInteractiveTarget(event.target)) {
|
|
1096
|
+
event.preventDefault();
|
|
1097
|
+
event.stopPropagation();
|
|
1098
|
+
this.checkedChange.emit(!this.checked());
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
formatQuantity(quantity) {
|
|
1102
|
+
if (this.normalizedUnit() === 'ud') {
|
|
1103
|
+
return Math.round(quantity).toString();
|
|
1104
|
+
}
|
|
1105
|
+
return Number(quantity.toFixed(1)).toLocaleString('es-ES', {
|
|
1106
|
+
minimumFractionDigits: Number.isInteger(quantity) ? 0 : 1,
|
|
1107
|
+
maximumFractionDigits: 1
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
normalizedUnit() {
|
|
1111
|
+
return this.unit() === 'kg' ? 'kg' : 'ud';
|
|
1112
|
+
}
|
|
1113
|
+
formatCurrency(value) {
|
|
1114
|
+
return value.toLocaleString('es-ES', {
|
|
1115
|
+
minimumFractionDigits: 2,
|
|
1116
|
+
maximumFractionDigits: 2
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
resetSwipe() {
|
|
1120
|
+
if (this.swipeRemoving()) {
|
|
1121
|
+
return;
|
|
1122
|
+
}
|
|
1123
|
+
this.swipeDragging.set(false);
|
|
1124
|
+
this.swipeOffsetX.set(this.swipeArmed() ? -SWIPE_REVEAL_PX : 0);
|
|
1125
|
+
}
|
|
1126
|
+
triggerRemove(event) {
|
|
1127
|
+
this.suppressNextClick = true;
|
|
1128
|
+
event?.preventDefault();
|
|
1129
|
+
event?.stopPropagation();
|
|
1130
|
+
this.swipeDragging.set(false);
|
|
1131
|
+
this.swipeArmed.set(false);
|
|
1132
|
+
this.swipeRemoving.set(true);
|
|
1133
|
+
this.swipeOffsetX.set(-SWIPE_MAX_PX);
|
|
1134
|
+
window.setTimeout(() => this.rowRemove.emit(), REMOVE_ANIMATION_MS);
|
|
1135
|
+
}
|
|
1136
|
+
isMobileViewport() {
|
|
1137
|
+
return window.matchMedia('(max-width: 640px)').matches;
|
|
1138
|
+
}
|
|
1139
|
+
isInteractiveTarget(target) {
|
|
1140
|
+
return target instanceof HTMLElement && !!target.closest('button, input, textarea, select, loro-input, a');
|
|
1141
|
+
}
|
|
1142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProductRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroProductRow, isStandalone: true, selector: "loro-product-row", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, imageName: { classPropertyName: "imageName", publicName: "imageName", isSignal: true, isRequired: false, transformFunction: null }, quantityLabel: { classPropertyName: "quantityLabel", publicName: "quantityLabel", isSignal: true, isRequired: false, transformFunction: null }, quantity: { classPropertyName: "quantity", publicName: "quantity", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, divider: { classPropertyName: "divider", publicName: "divider", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, prices: { classPropertyName: "prices", publicName: "prices", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange", quantityChange: "quantityChange", increment: "increment", decrement: "decrement", rowRemove: "rowRemove" }, ngImport: i0, template: "<article\n class=\"loro-product-row\"\n [class.loro-product-row--basket]=\"variant() === 'basket'\"\n [class.loro-product-row--pantry]=\"variant() === 'pantry'\"\n [class.loro-product-row--compare]=\"variant() === 'compare'\"\n [class.loro-product-row--divider]=\"divider()\"\n [class.loro-product-row--checked]=\"checked()\"\n [class.loro-product-row--dragging]=\"swipeDragging()\"\n [class.loro-product-row--swipe-armed]=\"swipeArmed()\"\n [class.loro-product-row--removing]=\"swipeRemoving()\"\n [class.loro-product-row--swipe-removable]=\"isSwipeRemovable()\"\n [class.loro-product-row--no-image]=\"!imageName()\"\n [style.transform]=\"swipeTransform()\"\n (touchstart)=\"onRowTouchStart($event)\"\n (touchmove)=\"onRowTouchMove($event)\"\n (touchend)=\"onRowTouchEnd($event)\"\n (touchcancel)=\"onRowTouchCancel()\"\n (click)=\"onBasketClick($event)\">\n @if (variant() === 'basket') {\n <button\n type=\"button\"\n class=\"loro-product-row__check\"\n [class.loro-product-row__check--checked]=\"checked()\"\n [attr.aria-label]=\"'Marcar ' + name()\"\n (click)=\"checkedChange.emit(!checked())\">\n @if (checked()) {\n <loro-icon name=\"check\" [size]=\"18\" alt=\"Comprado\" color=\"inverse\" />\n }\n </button>\n <span class=\"loro-product-row__selected-mark\" aria-hidden=\"true\">\n <loro-icon name=\"tick-circle\" [size]=\"16\" alt=\"Seleccionado\" color=\"primary\" />\n </span>\n }\n\n @if (imageName()) {\n <span class=\"loro-product-row__image\">\n <loro-image [name]=\"imageName()!\" [alt]=\"name()\" width=\"100%\" />\n </span>\n }\n\n <span class=\"loro-product-row__copy\">\n <strong>{{ name() }}</strong>\n @if (variant() !== 'basket') {\n <small>{{ meta() }}</small>\n }\n </span>\n\n @if (variant() === 'basket') {\n <loro-input\n class=\"loro-product-row__stepper\"\n variant=\"stepper\"\n [label]=\"'Cantidad de ' + name()\"\n [value]=\"quantityValue()\"\n [unit]=\"unit()\"\n [step]=\"unit() === 'kg' ? 0.5 : 1\"\n [min]=\"unit() === 'kg' ? 0.5 : 1\"\n [max]=\"100\"\n (valueChange)=\"updateQuantity($event)\" />\n }\n\n @if (variant() === 'compare') {\n <span class=\"loro-product-row__prices\">\n @for (price of prices(); track price.store) {\n <span [class.loro-product-row__price--best]=\"price.best\" class=\"loro-product-row__price\">\n @if (price.logoName) {\n <loro-image [name]=\"price.logoName\" [alt]=\"price.store\" width=\"100%\" height=\"100%\" fit=\"contain\" />\n } @else {\n <b>{{ price.store }}</b>\n }\n <span>{{ formatCurrency(price.value) }} \u20AC</span>\n </span>\n }\n </span>\n } @else if (variant() === 'basket') {\n <span class=\"loro-product-row__total-stack\">\n <small class=\"loro-product-row__unit-price\">{{ meta() }}</small>\n <strong class=\"loro-product-row__total\">{{ formatCurrency(total()) }} \u20AC</strong>\n </span>\n } @else {\n <strong class=\"loro-product-row__total\">{{ formatCurrency(total()) }} \u20AC</strong>\n }\n\n @if (variant() === 'pantry') {\n <span\n class=\"loro-product-row__status\"\n [class.loro-product-row__status--warning]=\"status() === 'warning'\"\n [class.loro-product-row__status--expiring]=\"status() === 'expiring'\">\n <loro-icon\n [name]=\"status() === 'ok' ? 'check' : 'warning'\"\n [size]=\"status() === 'ok' ? 15 : 12\"\n [alt]=\"status()\"\n [color]=\"status() === 'ok' ? 'success' : status() === 'expiring' ? 'warning' : 'danger'\" />\n </span>\n } @else if (variant() === 'basket') {\n <button\n type=\"button\"\n class=\"loro-product-row__delete-button\"\n data-touch-hover\n [attr.aria-label]=\"'Eliminar ' + name()\"\n (click)=\"rowRemove.emit()\">\n <loro-icon name=\"trash\" [size]=\"18\" alt=\"\" [decorative]=\"true\" color=\"danger\" />\n </button>\n }\n</article>\n@if (isSwipeRemovable()) {\n <span class=\"loro-product-row__delete-action\" aria-hidden=\"true\" [style.transform]=\"deleteActionTransform()\">\n <loro-icon name=\"trash-white\" [size]=\"24\" alt=\"Eliminar\" color=\"inverse\" />\n <span>Eliminar</span>\n </span>\n}\n", styles: [":host{display:block;position:relative;overflow:hidden;font-family:var(--loro-font-brand);--loro-product-row-selected-bg: #f4f0ff;--loro-product-row-selected-shadow: 0 .75rem 1.8rem rgba(77, 45, 183, .08)}:host-context([data-theme=dark]){--loro-product-row-selected-bg: color-mix(in srgb, var(--loro-primary-500) 18%, var(--loro-surface) 82%)}.loro-product-row{position:relative;z-index:1;display:grid;grid-template-columns:2.6rem 5.6rem minmax(0,1fr) minmax(7.8rem,auto) minmax(4.8rem,auto) 2rem;align-items:center;gap:1.2rem;min-width:0;min-height:5.35rem;padding:.55rem 1rem;background:var(--loro-surface-soft);color:var(--loro-text);transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease;touch-action:pan-y;-webkit-user-select:none;user-select:none}.loro-product-row--dragging{transition:none}.loro-product-row--removing{opacity:.18;pointer-events:none;transform:translate3d(calc(-100% - 2rem),0,0)!important}.loro-product-row__delete-action{display:none}.loro-product-row--divider:after{position:absolute;right:0;bottom:0;left:0;height:1px;background:var(--loro-border-subtle);content:\"\"}.loro-product-row--pantry{grid-template-columns:4.6rem minmax(0,1fr) auto auto;gap:.9rem}.loro-product-row--compare{grid-template-columns:5.2rem minmax(8rem,1fr) minmax(14rem,2fr);border:1px solid var(--loro-border-subtle);border-radius:1rem;box-shadow:var(--loro-shadow-soft)}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.6rem minmax(0,1fr) minmax(7.8rem,auto) minmax(4.8rem,auto) 2rem}.loro-product-row--pantry.loro-product-row--no-image{grid-template-columns:minmax(0,1fr) auto auto}.loro-product-row--compare.loro-product-row--no-image{grid-template-columns:minmax(8rem,1fr) minmax(14rem,2fr)}.loro-product-row__check{display:grid;width:1.9rem;height:1.9rem;place-items:center;border:2px solid rgba(98,88,130,.45);border-radius:.45rem;background:var(--loro-surface);cursor:pointer}.loro-product-row__check--checked{border-color:transparent;background:var(--loro-primary-500)}.loro-product-row__selected-mark{display:none}.loro-product-row__image{display:grid;width:5.2rem;height:3.6rem;place-items:center;overflow:hidden;border-radius:.65rem;background:color-mix(in srgb,var(--loro-primary-500) 4%,var(--loro-surface-soft) 96%)}.loro-product-row__copy{display:grid;gap:.18rem;min-width:0;align-content:center}strong{color:var(--loro-text-strong);line-height:1.1;overflow-wrap:anywhere;font-weight:950}small{color:var(--loro-muted);line-height:1.2;font-weight:750}.loro-product-row__delete-button{display:grid;width:2.25rem;height:2.25rem;place-items:center;align-self:center;border:0;border-radius:.7rem;background:transparent;color:var(--loro-danger-text);font:inherit;font-weight:950;cursor:pointer;opacity:.64;transition:opacity .16s ease,background .16s ease,box-shadow .16s ease,transform .16s ease}.loro-product-row__delete-button:hover,.loro-product-row__delete-button.is-touch-hover,.loro-product-row__delete-button:focus-visible{opacity:1;background:color-mix(in srgb,var(--loro-danger-text) 9%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-danger-text) 14%,transparent);transform:translateY(-1px)}.loro-product-row__delete-button:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-danger-text) 22%,transparent);outline-offset:2px}.loro-product-row__delete-button:active{transform:translateY(0)}.loro-product-row__total{color:var(--loro-primary-700);font-size:1.2rem;text-align:right;white-space:nowrap;min-width:0}.loro-product-row__total-stack{display:grid;justify-items:end;gap:.08rem;min-width:0;align-content:center;text-align:right}.loro-product-row__unit-price{color:var(--loro-muted-strong);font-size:.78rem;line-height:1;white-space:nowrap;font-weight:850}.loro-product-row__prices{display:grid;grid-template-columns:repeat(3,minmax(4.5rem,1fr));gap:.5rem;align-items:center;justify-items:stretch}.loro-product-row__price{display:grid;justify-items:center;gap:.2rem;color:var(--loro-primary-700);min-width:0;text-align:center;font-weight:850}.loro-product-row__price loro-image{display:block;width:2.25rem;height:1.5rem}.loro-product-row__price ::ng-deep img{width:100%;height:100%;object-fit:contain}.loro-product-row__price span{overflow-wrap:anywhere;font-size:clamp(1rem,2vw,1.1rem);line-height:1.1}.loro-product-row__price--best span{padding:.25rem .85rem;border-radius:var(--loro-radius-pill);background:color-mix(in srgb,#15803d 12%,var(--loro-surface-soft) 88%);color:#15803d}.loro-product-row__status{display:grid;width:1.55rem;height:1.55rem;place-items:center;border:1.5px solid rgba(31,157,85,.42);border-radius:50%}.loro-product-row__status--warning{border-color:#dc262661}.loro-product-row__status--expiring{border-color:color-mix(in srgb,var(--loro-warning) 58%,transparent);background:color-mix(in srgb,var(--loro-warning) 7%,transparent)}@media(min-width:1024px){.loro-product-row--basket{border:1px solid transparent;cursor:pointer}.loro-product-row--basket.loro-product-row--checked{border-color:var(--loro-primary-500);background:var(--loro-product-row-selected-bg);box-shadow:var(--loro-product-row-selected-shadow)}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__delete-button,.loro-product-row--basket .loro-product-row__stepper{cursor:auto}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__delete-button{cursor:pointer}}@media(max-width:479.99px)and (orientation:portrait){.loro-product-row{grid-template-columns:2.4rem 6rem minmax(8rem,1fr) minmax(8.8rem,auto) minmax(4.9rem,auto) 1.8rem;gap:.9rem;min-height:4.8rem;padding:.55rem .85rem}.loro-product-row__image{width:5.4rem;height:3.65rem}.loro-product-row--basket{grid-template-columns:2.4rem 5.4rem minmax(0,1fr) minmax(4.9rem,auto) 1.8rem;grid-template-rows:auto auto;column-gap:.75rem;row-gap:.38rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.4rem minmax(0,1fr) minmax(4.9rem,auto) 1.8rem}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__selected-mark{grid-column:1;grid-row:1/span 2;align-self:center}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center;width:5.4rem;height:3.65rem}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy{grid-column:2}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start;min-width:min(10rem,100%);width:min(10rem,100%);max-width:100%}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__delete-button{grid-column:5;grid-row:1/span 2}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__delete-button{grid-column:4}.loro-product-row--pantry{grid-template-columns:4.5rem minmax(0,1fr) auto auto}.loro-product-row--compare{grid-template-columns:4.5rem minmax(6rem,1fr) minmax(10rem,1.6fr)}.loro-product-row__stepper{min-width:8rem;width:8rem}.loro-product-row__total{font-size:1.25rem}}@media(max-width:640px){.loro-product-row{grid-template-columns:2.1rem 4.45rem minmax(5.6rem,1fr) minmax(8rem,auto) minmax(4.2rem,auto);gap:.65rem;min-height:4.8rem;padding:.55rem}.loro-product-row--basket{grid-template-columns:2.1rem 4.45rem minmax(0,1fr) minmax(4.2rem,auto);grid-template-rows:auto auto;border:1px solid var(--loro-surface);border-radius:.85rem;background:var(--loro-surface);overflow:hidden}.loro-product-row--basket .loro-product-row__check{display:grid;grid-column:1;grid-row:1/span 2;align-self:center;justify-self:center;width:1.8rem;height:1.8rem;border-radius:.55rem}.loro-product-row--basket .loro-product-row__selected-mark{display:none}.loro-product-row--basket .loro-product-row__image,.loro-product-row--basket .loro-product-row__copy,.loro-product-row--basket .loro-product-row__stepper,.loro-product-row--basket .loro-product-row__total-stack{grid-area:auto}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.1rem minmax(0,1fr) minmax(4.2rem,auto)}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy{grid-column:2}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__delete-button{display:none}.loro-product-row--basket.loro-product-row--checked{border-color:var(--loro-primary-500);background:var(--loro-product-row-selected-bg);box-shadow:var(--loro-product-row-selected-shadow)}.loro-product-row--basket.loro-product-row--dragging{box-shadow:0 1rem 2.2rem #4d2db71f}.loro-product-row__delete-action{position:absolute;inset:0 0 0 auto;z-index:0;display:grid;width:10rem;align-content:center;justify-items:center;gap:.35rem;place-items:center;padding-inline-start:1.75rem;border-radius:0 .85rem .85rem 0;background:linear-gradient(135deg,#ff4d5f,#dc2626);color:#fff;font-size:.82rem;font-weight:900;opacity:0;transition:opacity .16s ease,transform .16s ease}.loro-product-row__delete-action span{color:inherit;line-height:1}.loro-product-row--dragging+.loro-product-row__delete-action,.loro-product-row--swipe-armed+.loro-product-row__delete-action,.loro-product-row--removing+.loro-product-row__delete-action{opacity:1}.loro-product-row__image{width:4.45rem;height:3.35rem}.loro-product-row--basket .loro-product-row__stepper{min-width:min(10rem,100%);width:min(10rem,100%)}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.45rem minmax(3.15rem,1fr) 1.45rem;min-height:2.05rem;border-radius:.72rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value{min-width:0;overflow:hidden;gap:.14rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.75rem;max-width:2.35rem;overflow:hidden;text-overflow:clip;white-space:nowrap}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper-kg input{min-width:2.05rem;max-width:2.35rem}.loro-product-row__total{align-self:center;font-size:clamp(.92rem,3.4vw,1.05rem);letter-spacing:0}.loro-product-row__unit-price{font-size:clamp(.62rem,2.4vw,.72rem)}.loro-product-row--basket .loro-product-row__copy strong{overflow-wrap:normal;word-break:normal;font-size:clamp(.82rem,3.6vw,.95rem);line-height:1.05}.loro-product-row--basket .loro-product-row__copy small{font-size:clamp(.7rem,3vw,.82rem);line-height:1.05}.loro-product-row--pantry{grid-template-columns:4.8rem minmax(0,1fr) auto auto;gap:.7rem;min-height:5.8rem}.loro-product-row--pantry .loro-product-row__image{width:4.8rem;height:3.5rem}.loro-product-row--pantry .loro-product-row__copy strong{font-size:.96rem}.loro-product-row--pantry .loro-product-row__copy small{font-size:.82rem}.loro-product-row--pantry .loro-product-row__total{font-size:.98rem}.loro-product-row--compare{grid-template-columns:4.35rem minmax(6.2rem,1fr) minmax(9rem,1.55fr);gap:.6rem;min-height:5.8rem;padding:.75rem .8rem}.loro-product-row--compare .loro-product-row__image{width:4.35rem;height:3.35rem;border-radius:.8rem}.loro-product-row--compare .loro-product-row__copy strong{font-size:clamp(.88rem,3.6vw,1rem)}.loro-product-row--compare .loro-product-row__copy small{font-size:clamp(.74rem,2.9vw,.84rem)}.loro-product-row--compare .loro-product-row__prices{grid-template-columns:repeat(3,minmax(0,1fr));gap:.35rem;align-self:stretch;align-items:center}.loro-product-row--compare .loro-product-row__price{gap:.15rem;align-content:center}.loro-product-row--compare .loro-product-row__price loro-image{width:2rem;height:1.2rem}.loro-product-row--compare .loro-product-row__price span{font-size:clamp(.78rem,3.2vw,.92rem)}.loro-product-row--compare .loro-product-row__price--best span{padding:.22rem .5rem}}@media(max-width:430px){.loro-product-row--basket{grid-template-columns:1.9rem 3.3rem minmax(0,1fr) minmax(3.35rem,auto);gap:.45rem;min-height:4.3rem;padding:.45rem}.loro-product-row--basket .loro-product-row__check{width:1.6rem;height:1.6rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:1.9rem minmax(0,1fr) minmax(3.35rem,auto)}.loro-product-row--basket .loro-product-row__image{width:3.3rem;height:2.75rem;border-radius:.55rem}.loro-product-row--basket .loro-product-row__stepper{min-width:min(10rem,100%);width:min(10rem,100%)}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.28rem minmax(3.05rem,1fr) 1.28rem;min-height:2rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value{min-width:0;gap:.1rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.65rem;max-width:2.2rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper-kg input{min-width:1.95rem;max-width:2.2rem}.loro-product-row--basket .loro-product-row__copy strong{font-size:.78rem}.loro-product-row--basket .loro-product-row__copy small{font-size:.68rem}.loro-product-row--basket .loro-product-row__total{font-size:.98rem}.loro-product-row--compare{grid-template-columns:4rem minmax(5.2rem,1fr) minmax(8.1rem,1.45fr);gap:.5rem;padding:.7rem}.loro-product-row--compare .loro-product-row__image{width:4rem;height:3.1rem}.loro-product-row--compare .loro-product-row__copy strong{font-size:clamp(.82rem,3.8vw,.94rem)}.loro-product-row--compare .loro-product-row__copy small{font-size:clamp(.7rem,3vw,.8rem)}.loro-product-row--compare .loro-product-row__price span{font-size:clamp(.74rem,3.2vw,.86rem)}.loro-product-row--compare .loro-product-row__price loro-image{width:1.9rem;height:1.1rem}}@media(max-width:380px){.loro-product-row--basket{grid-template-columns:1.85rem 3.15rem minmax(0,1fr) minmax(3.25rem,auto);grid-template-rows:auto auto;column-gap:.32rem;row-gap:.28rem;min-height:4.75rem;padding:.5rem}.loro-product-row--basket .loro-product-row__check{grid-column:1;grid-row:1/span 2;align-self:center;width:1.55rem;height:1.55rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:1.85rem minmax(0,1fr) minmax(3.25rem,auto)}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy,.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center;width:3.15rem;height:2.65rem}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end;padding-inline-end:.25rem}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start;min-width:min(10rem,100%);width:min(10rem,100%)}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.35rem minmax(3.25rem,1fr) 1.35rem;min-height:1.85rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.55rem;max-width:2rem;font-size:.82rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value span{min-width:.95rem;font-size:.78rem}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }, { kind: "component", type: LoroInput$1, selector: "loro-input", inputs: ["label", "placeholder", "helperText", "value", "type", "name", "autocomplete", "inputmode", "icon", "iconSize", "trailingIcon", "trailingIconSize", "trailingAriaLabel", "variant", "state", "errorMessage", "errors", "invalid", "disabled", "readonly", "required", "touched", "unit", "step", "min", "max"], outputs: ["valueChange", "touchedChange", "trailingClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1144
|
+
}
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProductRow, decorators: [{
|
|
1146
|
+
type: Component,
|
|
1147
|
+
args: [{ selector: 'loro-product-row', standalone: true, imports: [LoroIcon$1, LoroImage$1, LoroInput$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article\n class=\"loro-product-row\"\n [class.loro-product-row--basket]=\"variant() === 'basket'\"\n [class.loro-product-row--pantry]=\"variant() === 'pantry'\"\n [class.loro-product-row--compare]=\"variant() === 'compare'\"\n [class.loro-product-row--divider]=\"divider()\"\n [class.loro-product-row--checked]=\"checked()\"\n [class.loro-product-row--dragging]=\"swipeDragging()\"\n [class.loro-product-row--swipe-armed]=\"swipeArmed()\"\n [class.loro-product-row--removing]=\"swipeRemoving()\"\n [class.loro-product-row--swipe-removable]=\"isSwipeRemovable()\"\n [class.loro-product-row--no-image]=\"!imageName()\"\n [style.transform]=\"swipeTransform()\"\n (touchstart)=\"onRowTouchStart($event)\"\n (touchmove)=\"onRowTouchMove($event)\"\n (touchend)=\"onRowTouchEnd($event)\"\n (touchcancel)=\"onRowTouchCancel()\"\n (click)=\"onBasketClick($event)\">\n @if (variant() === 'basket') {\n <button\n type=\"button\"\n class=\"loro-product-row__check\"\n [class.loro-product-row__check--checked]=\"checked()\"\n [attr.aria-label]=\"'Marcar ' + name()\"\n (click)=\"checkedChange.emit(!checked())\">\n @if (checked()) {\n <loro-icon name=\"check\" [size]=\"18\" alt=\"Comprado\" color=\"inverse\" />\n }\n </button>\n <span class=\"loro-product-row__selected-mark\" aria-hidden=\"true\">\n <loro-icon name=\"tick-circle\" [size]=\"16\" alt=\"Seleccionado\" color=\"primary\" />\n </span>\n }\n\n @if (imageName()) {\n <span class=\"loro-product-row__image\">\n <loro-image [name]=\"imageName()!\" [alt]=\"name()\" width=\"100%\" />\n </span>\n }\n\n <span class=\"loro-product-row__copy\">\n <strong>{{ name() }}</strong>\n @if (variant() !== 'basket') {\n <small>{{ meta() }}</small>\n }\n </span>\n\n @if (variant() === 'basket') {\n <loro-input\n class=\"loro-product-row__stepper\"\n variant=\"stepper\"\n [label]=\"'Cantidad de ' + name()\"\n [value]=\"quantityValue()\"\n [unit]=\"unit()\"\n [step]=\"unit() === 'kg' ? 0.5 : 1\"\n [min]=\"unit() === 'kg' ? 0.5 : 1\"\n [max]=\"100\"\n (valueChange)=\"updateQuantity($event)\" />\n }\n\n @if (variant() === 'compare') {\n <span class=\"loro-product-row__prices\">\n @for (price of prices(); track price.store) {\n <span [class.loro-product-row__price--best]=\"price.best\" class=\"loro-product-row__price\">\n @if (price.logoName) {\n <loro-image [name]=\"price.logoName\" [alt]=\"price.store\" width=\"100%\" height=\"100%\" fit=\"contain\" />\n } @else {\n <b>{{ price.store }}</b>\n }\n <span>{{ formatCurrency(price.value) }} \u20AC</span>\n </span>\n }\n </span>\n } @else if (variant() === 'basket') {\n <span class=\"loro-product-row__total-stack\">\n <small class=\"loro-product-row__unit-price\">{{ meta() }}</small>\n <strong class=\"loro-product-row__total\">{{ formatCurrency(total()) }} \u20AC</strong>\n </span>\n } @else {\n <strong class=\"loro-product-row__total\">{{ formatCurrency(total()) }} \u20AC</strong>\n }\n\n @if (variant() === 'pantry') {\n <span\n class=\"loro-product-row__status\"\n [class.loro-product-row__status--warning]=\"status() === 'warning'\"\n [class.loro-product-row__status--expiring]=\"status() === 'expiring'\">\n <loro-icon\n [name]=\"status() === 'ok' ? 'check' : 'warning'\"\n [size]=\"status() === 'ok' ? 15 : 12\"\n [alt]=\"status()\"\n [color]=\"status() === 'ok' ? 'success' : status() === 'expiring' ? 'warning' : 'danger'\" />\n </span>\n } @else if (variant() === 'basket') {\n <button\n type=\"button\"\n class=\"loro-product-row__delete-button\"\n data-touch-hover\n [attr.aria-label]=\"'Eliminar ' + name()\"\n (click)=\"rowRemove.emit()\">\n <loro-icon name=\"trash\" [size]=\"18\" alt=\"\" [decorative]=\"true\" color=\"danger\" />\n </button>\n }\n</article>\n@if (isSwipeRemovable()) {\n <span class=\"loro-product-row__delete-action\" aria-hidden=\"true\" [style.transform]=\"deleteActionTransform()\">\n <loro-icon name=\"trash-white\" [size]=\"24\" alt=\"Eliminar\" color=\"inverse\" />\n <span>Eliminar</span>\n </span>\n}\n", styles: [":host{display:block;position:relative;overflow:hidden;font-family:var(--loro-font-brand);--loro-product-row-selected-bg: #f4f0ff;--loro-product-row-selected-shadow: 0 .75rem 1.8rem rgba(77, 45, 183, .08)}:host-context([data-theme=dark]){--loro-product-row-selected-bg: color-mix(in srgb, var(--loro-primary-500) 18%, var(--loro-surface) 82%)}.loro-product-row{position:relative;z-index:1;display:grid;grid-template-columns:2.6rem 5.6rem minmax(0,1fr) minmax(7.8rem,auto) minmax(4.8rem,auto) 2rem;align-items:center;gap:1.2rem;min-width:0;min-height:5.35rem;padding:.55rem 1rem;background:var(--loro-surface-soft);color:var(--loro-text);transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease;touch-action:pan-y;-webkit-user-select:none;user-select:none}.loro-product-row--dragging{transition:none}.loro-product-row--removing{opacity:.18;pointer-events:none;transform:translate3d(calc(-100% - 2rem),0,0)!important}.loro-product-row__delete-action{display:none}.loro-product-row--divider:after{position:absolute;right:0;bottom:0;left:0;height:1px;background:var(--loro-border-subtle);content:\"\"}.loro-product-row--pantry{grid-template-columns:4.6rem minmax(0,1fr) auto auto;gap:.9rem}.loro-product-row--compare{grid-template-columns:5.2rem minmax(8rem,1fr) minmax(14rem,2fr);border:1px solid var(--loro-border-subtle);border-radius:1rem;box-shadow:var(--loro-shadow-soft)}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.6rem minmax(0,1fr) minmax(7.8rem,auto) minmax(4.8rem,auto) 2rem}.loro-product-row--pantry.loro-product-row--no-image{grid-template-columns:minmax(0,1fr) auto auto}.loro-product-row--compare.loro-product-row--no-image{grid-template-columns:minmax(8rem,1fr) minmax(14rem,2fr)}.loro-product-row__check{display:grid;width:1.9rem;height:1.9rem;place-items:center;border:2px solid rgba(98,88,130,.45);border-radius:.45rem;background:var(--loro-surface);cursor:pointer}.loro-product-row__check--checked{border-color:transparent;background:var(--loro-primary-500)}.loro-product-row__selected-mark{display:none}.loro-product-row__image{display:grid;width:5.2rem;height:3.6rem;place-items:center;overflow:hidden;border-radius:.65rem;background:color-mix(in srgb,var(--loro-primary-500) 4%,var(--loro-surface-soft) 96%)}.loro-product-row__copy{display:grid;gap:.18rem;min-width:0;align-content:center}strong{color:var(--loro-text-strong);line-height:1.1;overflow-wrap:anywhere;font-weight:950}small{color:var(--loro-muted);line-height:1.2;font-weight:750}.loro-product-row__delete-button{display:grid;width:2.25rem;height:2.25rem;place-items:center;align-self:center;border:0;border-radius:.7rem;background:transparent;color:var(--loro-danger-text);font:inherit;font-weight:950;cursor:pointer;opacity:.64;transition:opacity .16s ease,background .16s ease,box-shadow .16s ease,transform .16s ease}.loro-product-row__delete-button:hover,.loro-product-row__delete-button.is-touch-hover,.loro-product-row__delete-button:focus-visible{opacity:1;background:color-mix(in srgb,var(--loro-danger-text) 9%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-danger-text) 14%,transparent);transform:translateY(-1px)}.loro-product-row__delete-button:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-danger-text) 22%,transparent);outline-offset:2px}.loro-product-row__delete-button:active{transform:translateY(0)}.loro-product-row__total{color:var(--loro-primary-700);font-size:1.2rem;text-align:right;white-space:nowrap;min-width:0}.loro-product-row__total-stack{display:grid;justify-items:end;gap:.08rem;min-width:0;align-content:center;text-align:right}.loro-product-row__unit-price{color:var(--loro-muted-strong);font-size:.78rem;line-height:1;white-space:nowrap;font-weight:850}.loro-product-row__prices{display:grid;grid-template-columns:repeat(3,minmax(4.5rem,1fr));gap:.5rem;align-items:center;justify-items:stretch}.loro-product-row__price{display:grid;justify-items:center;gap:.2rem;color:var(--loro-primary-700);min-width:0;text-align:center;font-weight:850}.loro-product-row__price loro-image{display:block;width:2.25rem;height:1.5rem}.loro-product-row__price ::ng-deep img{width:100%;height:100%;object-fit:contain}.loro-product-row__price span{overflow-wrap:anywhere;font-size:clamp(1rem,2vw,1.1rem);line-height:1.1}.loro-product-row__price--best span{padding:.25rem .85rem;border-radius:var(--loro-radius-pill);background:color-mix(in srgb,#15803d 12%,var(--loro-surface-soft) 88%);color:#15803d}.loro-product-row__status{display:grid;width:1.55rem;height:1.55rem;place-items:center;border:1.5px solid rgba(31,157,85,.42);border-radius:50%}.loro-product-row__status--warning{border-color:#dc262661}.loro-product-row__status--expiring{border-color:color-mix(in srgb,var(--loro-warning) 58%,transparent);background:color-mix(in srgb,var(--loro-warning) 7%,transparent)}@media(min-width:1024px){.loro-product-row--basket{border:1px solid transparent;cursor:pointer}.loro-product-row--basket.loro-product-row--checked{border-color:var(--loro-primary-500);background:var(--loro-product-row-selected-bg);box-shadow:var(--loro-product-row-selected-shadow)}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__delete-button,.loro-product-row--basket .loro-product-row__stepper{cursor:auto}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__delete-button{cursor:pointer}}@media(max-width:479.99px)and (orientation:portrait){.loro-product-row{grid-template-columns:2.4rem 6rem minmax(8rem,1fr) minmax(8.8rem,auto) minmax(4.9rem,auto) 1.8rem;gap:.9rem;min-height:4.8rem;padding:.55rem .85rem}.loro-product-row__image{width:5.4rem;height:3.65rem}.loro-product-row--basket{grid-template-columns:2.4rem 5.4rem minmax(0,1fr) minmax(4.9rem,auto) 1.8rem;grid-template-rows:auto auto;column-gap:.75rem;row-gap:.38rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.4rem minmax(0,1fr) minmax(4.9rem,auto) 1.8rem}.loro-product-row--basket .loro-product-row__check,.loro-product-row--basket .loro-product-row__selected-mark{grid-column:1;grid-row:1/span 2;align-self:center}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center;width:5.4rem;height:3.65rem}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy{grid-column:2}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start;min-width:min(10rem,100%);width:min(10rem,100%);max-width:100%}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__delete-button{grid-column:5;grid-row:1/span 2}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__delete-button{grid-column:4}.loro-product-row--pantry{grid-template-columns:4.5rem minmax(0,1fr) auto auto}.loro-product-row--compare{grid-template-columns:4.5rem minmax(6rem,1fr) minmax(10rem,1.6fr)}.loro-product-row__stepper{min-width:8rem;width:8rem}.loro-product-row__total{font-size:1.25rem}}@media(max-width:640px){.loro-product-row{grid-template-columns:2.1rem 4.45rem minmax(5.6rem,1fr) minmax(8rem,auto) minmax(4.2rem,auto);gap:.65rem;min-height:4.8rem;padding:.55rem}.loro-product-row--basket{grid-template-columns:2.1rem 4.45rem minmax(0,1fr) minmax(4.2rem,auto);grid-template-rows:auto auto;border:1px solid var(--loro-surface);border-radius:.85rem;background:var(--loro-surface);overflow:hidden}.loro-product-row--basket .loro-product-row__check{display:grid;grid-column:1;grid-row:1/span 2;align-self:center;justify-self:center;width:1.8rem;height:1.8rem;border-radius:.55rem}.loro-product-row--basket .loro-product-row__selected-mark{display:none}.loro-product-row--basket .loro-product-row__image,.loro-product-row--basket .loro-product-row__copy,.loro-product-row--basket .loro-product-row__stepper,.loro-product-row--basket .loro-product-row__total-stack{grid-area:auto}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:2.1rem minmax(0,1fr) minmax(4.2rem,auto)}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy{grid-column:2}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__delete-button{display:none}.loro-product-row--basket.loro-product-row--checked{border-color:var(--loro-primary-500);background:var(--loro-product-row-selected-bg);box-shadow:var(--loro-product-row-selected-shadow)}.loro-product-row--basket.loro-product-row--dragging{box-shadow:0 1rem 2.2rem #4d2db71f}.loro-product-row__delete-action{position:absolute;inset:0 0 0 auto;z-index:0;display:grid;width:10rem;align-content:center;justify-items:center;gap:.35rem;place-items:center;padding-inline-start:1.75rem;border-radius:0 .85rem .85rem 0;background:linear-gradient(135deg,#ff4d5f,#dc2626);color:#fff;font-size:.82rem;font-weight:900;opacity:0;transition:opacity .16s ease,transform .16s ease}.loro-product-row__delete-action span{color:inherit;line-height:1}.loro-product-row--dragging+.loro-product-row__delete-action,.loro-product-row--swipe-armed+.loro-product-row__delete-action,.loro-product-row--removing+.loro-product-row__delete-action{opacity:1}.loro-product-row__image{width:4.45rem;height:3.35rem}.loro-product-row--basket .loro-product-row__stepper{min-width:min(10rem,100%);width:min(10rem,100%)}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.45rem minmax(3.15rem,1fr) 1.45rem;min-height:2.05rem;border-radius:.72rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value{min-width:0;overflow:hidden;gap:.14rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.75rem;max-width:2.35rem;overflow:hidden;text-overflow:clip;white-space:nowrap}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper-kg input{min-width:2.05rem;max-width:2.35rem}.loro-product-row__total{align-self:center;font-size:clamp(.92rem,3.4vw,1.05rem);letter-spacing:0}.loro-product-row__unit-price{font-size:clamp(.62rem,2.4vw,.72rem)}.loro-product-row--basket .loro-product-row__copy strong{overflow-wrap:normal;word-break:normal;font-size:clamp(.82rem,3.6vw,.95rem);line-height:1.05}.loro-product-row--basket .loro-product-row__copy small{font-size:clamp(.7rem,3vw,.82rem);line-height:1.05}.loro-product-row--pantry{grid-template-columns:4.8rem minmax(0,1fr) auto auto;gap:.7rem;min-height:5.8rem}.loro-product-row--pantry .loro-product-row__image{width:4.8rem;height:3.5rem}.loro-product-row--pantry .loro-product-row__copy strong{font-size:.96rem}.loro-product-row--pantry .loro-product-row__copy small{font-size:.82rem}.loro-product-row--pantry .loro-product-row__total{font-size:.98rem}.loro-product-row--compare{grid-template-columns:4.35rem minmax(6.2rem,1fr) minmax(9rem,1.55fr);gap:.6rem;min-height:5.8rem;padding:.75rem .8rem}.loro-product-row--compare .loro-product-row__image{width:4.35rem;height:3.35rem;border-radius:.8rem}.loro-product-row--compare .loro-product-row__copy strong{font-size:clamp(.88rem,3.6vw,1rem)}.loro-product-row--compare .loro-product-row__copy small{font-size:clamp(.74rem,2.9vw,.84rem)}.loro-product-row--compare .loro-product-row__prices{grid-template-columns:repeat(3,minmax(0,1fr));gap:.35rem;align-self:stretch;align-items:center}.loro-product-row--compare .loro-product-row__price{gap:.15rem;align-content:center}.loro-product-row--compare .loro-product-row__price loro-image{width:2rem;height:1.2rem}.loro-product-row--compare .loro-product-row__price span{font-size:clamp(.78rem,3.2vw,.92rem)}.loro-product-row--compare .loro-product-row__price--best span{padding:.22rem .5rem}}@media(max-width:430px){.loro-product-row--basket{grid-template-columns:1.9rem 3.3rem minmax(0,1fr) minmax(3.35rem,auto);gap:.45rem;min-height:4.3rem;padding:.45rem}.loro-product-row--basket .loro-product-row__check{width:1.6rem;height:1.6rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:1.9rem minmax(0,1fr) minmax(3.35rem,auto)}.loro-product-row--basket .loro-product-row__image{width:3.3rem;height:2.75rem;border-radius:.55rem}.loro-product-row--basket .loro-product-row__stepper{min-width:min(10rem,100%);width:min(10rem,100%)}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.28rem minmax(3.05rem,1fr) 1.28rem;min-height:2rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value{min-width:0;gap:.1rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.65rem;max-width:2.2rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper-kg input{min-width:1.95rem;max-width:2.2rem}.loro-product-row--basket .loro-product-row__copy strong{font-size:.78rem}.loro-product-row--basket .loro-product-row__copy small{font-size:.68rem}.loro-product-row--basket .loro-product-row__total{font-size:.98rem}.loro-product-row--compare{grid-template-columns:4rem minmax(5.2rem,1fr) minmax(8.1rem,1.45fr);gap:.5rem;padding:.7rem}.loro-product-row--compare .loro-product-row__image{width:4rem;height:3.1rem}.loro-product-row--compare .loro-product-row__copy strong{font-size:clamp(.82rem,3.8vw,.94rem)}.loro-product-row--compare .loro-product-row__copy small{font-size:clamp(.7rem,3vw,.8rem)}.loro-product-row--compare .loro-product-row__price span{font-size:clamp(.74rem,3.2vw,.86rem)}.loro-product-row--compare .loro-product-row__price loro-image{width:1.9rem;height:1.1rem}}@media(max-width:380px){.loro-product-row--basket{grid-template-columns:1.85rem 3.15rem minmax(0,1fr) minmax(3.25rem,auto);grid-template-rows:auto auto;column-gap:.32rem;row-gap:.28rem;min-height:4.75rem;padding:.5rem}.loro-product-row--basket .loro-product-row__check{grid-column:1;grid-row:1/span 2;align-self:center;width:1.55rem;height:1.55rem}.loro-product-row--basket.loro-product-row--no-image{grid-template-columns:1.85rem minmax(0,1fr) minmax(3.25rem,auto)}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__copy,.loro-product-row--basket.loro-product-row--no-image .loro-product-row__stepper{grid-column:2}.loro-product-row--basket.loro-product-row--no-image .loro-product-row__total-stack{grid-column:3}.loro-product-row--basket .loro-product-row__image{grid-column:2;grid-row:1/span 2;align-self:center;width:3.15rem;height:2.65rem}.loro-product-row--basket .loro-product-row__copy{grid-column:3;grid-row:1;align-self:end;padding-inline-end:.25rem}.loro-product-row--basket .loro-product-row__stepper{grid-column:3;grid-row:2;align-self:start;min-width:min(10rem,100%);width:min(10rem,100%)}.loro-product-row--basket .loro-product-row__total-stack{grid-column:4;grid-row:1/span 2;align-self:center}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input--stepper{grid-template-columns:1.35rem minmax(3.25rem,1fr) 1.35rem;min-height:1.85rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper input{min-width:1.55rem;max-width:2rem;font-size:.82rem}:host ::ng-deep .loro-product-row--basket .loro-product-row__stepper .loro-input__stepper-value span{min-width:.95rem;font-size:.78rem}}\n"] }]
|
|
1148
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], imageName: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageName", required: false }] }], quantityLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "quantityLabel", required: false }] }], quantity: [{ type: i0.Input, args: [{ isSignal: true, alias: "quantity", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], divider: [{ type: i0.Input, args: [{ isSignal: true, alias: "divider", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], prices: [{ type: i0.Input, args: [{ isSignal: true, alias: "prices", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }], quantityChange: [{ type: i0.Output, args: ["quantityChange"] }], increment: [{ type: i0.Output, args: ["increment"] }], decrement: [{ type: i0.Output, args: ["decrement"] }], rowRemove: [{ type: i0.Output, args: ["rowRemove"] }] } });
|
|
1149
|
+
|
|
1150
|
+
class LoroProductSection {
|
|
1151
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1152
|
+
icon = input('leaf', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1153
|
+
collapsible = input(true, ...(ngDevMode ? [{ debugName: "collapsible" }] : /* istanbul ignore next */ []));
|
|
1154
|
+
expanded = signal(true, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
1155
|
+
toggle() {
|
|
1156
|
+
if (!this.collapsible()) {
|
|
1157
|
+
return;
|
|
1158
|
+
}
|
|
1159
|
+
this.expanded.update((expanded) => !expanded);
|
|
1160
|
+
}
|
|
1161
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProductSection, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroProductSection, isStandalone: true, selector: "loro-product-section", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1163
|
+
<section class="loro-product-section">
|
|
1164
|
+
<header
|
|
1165
|
+
class="loro-product-section__header"
|
|
1166
|
+
[class.loro-product-section__header--collapsible]="collapsible()"
|
|
1167
|
+
[attr.role]="collapsible() ? 'button' : null"
|
|
1168
|
+
[attr.tabindex]="collapsible() ? 0 : null"
|
|
1169
|
+
[attr.aria-expanded]="collapsible() ? expanded() : null"
|
|
1170
|
+
(click)="toggle()"
|
|
1171
|
+
(keydown.enter)="toggle()"
|
|
1172
|
+
(keydown.space)="toggle()">
|
|
1173
|
+
<span class="loro-product-section__icon">
|
|
1174
|
+
<loro-icon [name]="icon()" [size]="18" [alt]="title()" color="inverse" />
|
|
1175
|
+
</span>
|
|
1176
|
+
<h2>{{ title() }}</h2>
|
|
1177
|
+
@if (collapsible()) {
|
|
1178
|
+
<span class="loro-product-section__toggle" aria-hidden="true">
|
|
1179
|
+
<loro-icon
|
|
1180
|
+
[name]="expanded() ? 'chevron-up' : 'chevron-down'"
|
|
1181
|
+
[size]="18"
|
|
1182
|
+
[alt]="expanded() ? 'Contraer' : 'Expandir'"
|
|
1183
|
+
color="primary-strong" />
|
|
1184
|
+
</span>
|
|
1185
|
+
}
|
|
1186
|
+
</header>
|
|
1187
|
+
@if (!collapsible() || expanded()) {
|
|
1188
|
+
<div class="loro-product-section__body">
|
|
1189
|
+
<ng-content />
|
|
1190
|
+
</div>
|
|
1191
|
+
}
|
|
1192
|
+
</section>
|
|
1193
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-product-section{display:grid;gap:.7rem}.loro-product-section__header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.8rem;margin-inline:-.35rem;padding:.25rem .35rem;border-radius:.75rem;color:var(--loro-text-strong);transition:background .15s ease,transform .15s ease}.loro-product-section__header--collapsible{cursor:pointer;-webkit-tap-highlight-color:transparent}.loro-product-section__header--collapsible:hover{background:#6c3cff0e}.loro-product-section__header--collapsible:focus-visible{outline:2px solid rgba(108,60,255,.32);outline-offset:2px}.loro-product-section__header--collapsible:active{transform:scale(.995);background:#6c3cff14}.loro-product-section__icon{display:grid;width:2.1rem;height:2.1rem;place-items:center;border-radius:50%;background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700))}h2{margin:0;font-size:1.12rem;font-weight:950;line-height:1.2}.loro-product-section__toggle{display:grid;width:2.25rem;height:2.25rem;place-items:center;border-radius:50%}.loro-product-section__body{overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:.8rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}@media(max-width:640px){.loro-product-section{gap:.25rem}.loro-product-section__header{grid-template-columns:1.2rem minmax(0,1fr) 1.35rem;gap:.35rem;margin-inline:0;padding:.08rem 0}.loro-product-section__icon{width:1.2rem;height:1.2rem}.loro-product-section__icon loro-icon,.loro-product-section__toggle loro-icon{transform:scale(.72)}h2{font-size:.72rem;line-height:1.05}.loro-product-section__toggle{display:grid;width:1.35rem;height:1.35rem;place-items:center;border:1px solid color-mix(in srgb,var(--loro-primary-500) 18%,transparent);background:color-mix(in srgb,var(--loro-primary-500) 6%,transparent)}.loro-product-section__body{border-radius:.58rem}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1194
|
+
}
|
|
1195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProductSection, decorators: [{
|
|
1196
|
+
type: Component,
|
|
1197
|
+
args: [{ selector: 'loro-product-section', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1198
|
+
<section class="loro-product-section">
|
|
1199
|
+
<header
|
|
1200
|
+
class="loro-product-section__header"
|
|
1201
|
+
[class.loro-product-section__header--collapsible]="collapsible()"
|
|
1202
|
+
[attr.role]="collapsible() ? 'button' : null"
|
|
1203
|
+
[attr.tabindex]="collapsible() ? 0 : null"
|
|
1204
|
+
[attr.aria-expanded]="collapsible() ? expanded() : null"
|
|
1205
|
+
(click)="toggle()"
|
|
1206
|
+
(keydown.enter)="toggle()"
|
|
1207
|
+
(keydown.space)="toggle()">
|
|
1208
|
+
<span class="loro-product-section__icon">
|
|
1209
|
+
<loro-icon [name]="icon()" [size]="18" [alt]="title()" color="inverse" />
|
|
1210
|
+
</span>
|
|
1211
|
+
<h2>{{ title() }}</h2>
|
|
1212
|
+
@if (collapsible()) {
|
|
1213
|
+
<span class="loro-product-section__toggle" aria-hidden="true">
|
|
1214
|
+
<loro-icon
|
|
1215
|
+
[name]="expanded() ? 'chevron-up' : 'chevron-down'"
|
|
1216
|
+
[size]="18"
|
|
1217
|
+
[alt]="expanded() ? 'Contraer' : 'Expandir'"
|
|
1218
|
+
color="primary-strong" />
|
|
1219
|
+
</span>
|
|
1220
|
+
}
|
|
1221
|
+
</header>
|
|
1222
|
+
@if (!collapsible() || expanded()) {
|
|
1223
|
+
<div class="loro-product-section__body">
|
|
1224
|
+
<ng-content />
|
|
1225
|
+
</div>
|
|
1226
|
+
}
|
|
1227
|
+
</section>
|
|
1228
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-product-section{display:grid;gap:.7rem}.loro-product-section__header{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.8rem;margin-inline:-.35rem;padding:.25rem .35rem;border-radius:.75rem;color:var(--loro-text-strong);transition:background .15s ease,transform .15s ease}.loro-product-section__header--collapsible{cursor:pointer;-webkit-tap-highlight-color:transparent}.loro-product-section__header--collapsible:hover{background:#6c3cff0e}.loro-product-section__header--collapsible:focus-visible{outline:2px solid rgba(108,60,255,.32);outline-offset:2px}.loro-product-section__header--collapsible:active{transform:scale(.995);background:#6c3cff14}.loro-product-section__icon{display:grid;width:2.1rem;height:2.1rem;place-items:center;border-radius:50%;background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700))}h2{margin:0;font-size:1.12rem;font-weight:950;line-height:1.2}.loro-product-section__toggle{display:grid;width:2.25rem;height:2.25rem;place-items:center;border-radius:50%}.loro-product-section__body{overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:.8rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}@media(max-width:640px){.loro-product-section{gap:.25rem}.loro-product-section__header{grid-template-columns:1.2rem minmax(0,1fr) 1.35rem;gap:.35rem;margin-inline:0;padding:.08rem 0}.loro-product-section__icon{width:1.2rem;height:1.2rem}.loro-product-section__icon loro-icon,.loro-product-section__toggle loro-icon{transform:scale(.72)}h2{font-size:.72rem;line-height:1.05}.loro-product-section__toggle{display:grid;width:1.35rem;height:1.35rem;place-items:center;border:1px solid color-mix(in srgb,var(--loro-primary-500) 18%,transparent);background:color-mix(in srgb,var(--loro-primary-500) 6%,transparent)}.loro-product-section__body{border-radius:.58rem}}\n"] }]
|
|
1229
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }] } });
|
|
1230
|
+
|
|
1231
|
+
class LoroProfileCard {
|
|
1232
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1233
|
+
email = input.required(...(ngDevMode ? [{ debugName: "email" }] : /* istanbul ignore next */ []));
|
|
1234
|
+
imageSrc = input(null, ...(ngDevMode ? [{ debugName: "imageSrc" }] : /* istanbul ignore next */ []));
|
|
1235
|
+
changePhotoClick = output();
|
|
1236
|
+
imageFailed = signal(false, ...(ngDevMode ? [{ debugName: "imageFailed" }] : /* istanbul ignore next */ []));
|
|
1237
|
+
constructor() {
|
|
1238
|
+
effect(() => {
|
|
1239
|
+
this.imageSrc();
|
|
1240
|
+
this.imageFailed.set(false);
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
resolvedImageSrc() {
|
|
1244
|
+
return this.imageFailed() ? null : this.imageSrc();
|
|
1245
|
+
}
|
|
1246
|
+
onImageError() {
|
|
1247
|
+
this.imageFailed.set(true);
|
|
1248
|
+
}
|
|
1249
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProfileCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1250
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroProfileCard, isStandalone: true, selector: "loro-profile-card", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, email: { classPropertyName: "email", publicName: "email", isSignal: true, isRequired: true, transformFunction: null }, imageSrc: { classPropertyName: "imageSrc", publicName: "imageSrc", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changePhotoClick: "changePhotoClick" }, ngImport: i0, template: `
|
|
1251
|
+
<section class="loro-profile-card">
|
|
1252
|
+
<div class="loro-profile-card__avatar">
|
|
1253
|
+
@if (resolvedImageSrc()) {
|
|
1254
|
+
<img [src]="resolvedImageSrc()!" [alt]="name()" (error)="onImageError()" />
|
|
1255
|
+
} @else {
|
|
1256
|
+
<loro-icon name="user" [size]="72" [alt]="name()" color="primary" />
|
|
1257
|
+
}
|
|
1258
|
+
</div>
|
|
1259
|
+
<div class="loro-profile-card__copy">
|
|
1260
|
+
<h2>{{ name() }}</h2>
|
|
1261
|
+
<p>{{ email() }}</p>
|
|
1262
|
+
<loro-button
|
|
1263
|
+
label="Cambiar foto"
|
|
1264
|
+
icon="camera"
|
|
1265
|
+
variant="outline"
|
|
1266
|
+
(buttonClick)="changePhotoClick.emit()" />
|
|
1267
|
+
</div>
|
|
1268
|
+
</section>
|
|
1269
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-profile-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:1.5rem;padding:clamp(1.25rem,3vw,2rem);border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-profile-card__avatar{display:grid;width:clamp(7rem,16vw,9.5rem);aspect-ratio:1;place-items:center;overflow:hidden;border-radius:50%;background:linear-gradient(180deg,#6c3cff24,#6c3cff0a)}img{width:100%;height:100%;object-fit:cover}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:clamp(2rem,4vw,2.7rem);font-weight:900;line-height:1}p{margin:.4rem 0 1rem;color:var(--loro-muted);font-size:1.05rem;font-weight:650}@media(max-width:520px){.loro-profile-card{grid-template-columns:max-content minmax(0,1fr);gap:1rem}}\n"], dependencies: [{ kind: "component", type: LoroButton$1, selector: "loro-button", inputs: ["label", "text", "icon", "iconContent", "iconMode", "iconSize", "iconButtonSize", "iconColor", "socialMobileCompact", "selected", "variant", "typeButton", "color", "size", "fullWidth", "buttonWidth", "disabled", "loading", "type", "formId", "ariaLabel", "ariaDescription"], outputs: ["buttonClick", "change", "sanChange"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1270
|
+
}
|
|
1271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProfileCard, decorators: [{
|
|
1272
|
+
type: Component,
|
|
1273
|
+
args: [{ selector: 'loro-profile-card', standalone: true, imports: [LoroButton$1, LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1274
|
+
<section class="loro-profile-card">
|
|
1275
|
+
<div class="loro-profile-card__avatar">
|
|
1276
|
+
@if (resolvedImageSrc()) {
|
|
1277
|
+
<img [src]="resolvedImageSrc()!" [alt]="name()" (error)="onImageError()" />
|
|
1278
|
+
} @else {
|
|
1279
|
+
<loro-icon name="user" [size]="72" [alt]="name()" color="primary" />
|
|
1280
|
+
}
|
|
1281
|
+
</div>
|
|
1282
|
+
<div class="loro-profile-card__copy">
|
|
1283
|
+
<h2>{{ name() }}</h2>
|
|
1284
|
+
<p>{{ email() }}</p>
|
|
1285
|
+
<loro-button
|
|
1286
|
+
label="Cambiar foto"
|
|
1287
|
+
icon="camera"
|
|
1288
|
+
variant="outline"
|
|
1289
|
+
(buttonClick)="changePhotoClick.emit()" />
|
|
1290
|
+
</div>
|
|
1291
|
+
</section>
|
|
1292
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-profile-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:1.5rem;padding:clamp(1.25rem,3vw,2rem);border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft)}.loro-profile-card__avatar{display:grid;width:clamp(7rem,16vw,9.5rem);aspect-ratio:1;place-items:center;overflow:hidden;border-radius:50%;background:linear-gradient(180deg,#6c3cff24,#6c3cff0a)}img{width:100%;height:100%;object-fit:cover}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:clamp(2rem,4vw,2.7rem);font-weight:900;line-height:1}p{margin:.4rem 0 1rem;color:var(--loro-muted);font-size:1.05rem;font-weight:650}@media(max-width:520px){.loro-profile-card{grid-template-columns:max-content minmax(0,1fr);gap:1rem}}\n"] }]
|
|
1293
|
+
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], email: [{ type: i0.Input, args: [{ isSignal: true, alias: "email", required: true }] }], imageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageSrc", required: false }] }], changePhotoClick: [{ type: i0.Output, args: ["changePhotoClick"] }] } });
|
|
1294
|
+
|
|
1295
|
+
class LoroProfileHero {
|
|
1296
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1297
|
+
firstName = input('Patricia', ...(ngDevMode ? [{ debugName: "firstName" }] : /* istanbul ignore next */ []));
|
|
1298
|
+
eyebrow = input('Mi perfil', ...(ngDevMode ? [{ debugName: "eyebrow" }] : /* istanbul ignore next */ []));
|
|
1299
|
+
greeting = input('¡Qué bien verte por aquí!', ...(ngDevMode ? [{ debugName: "greeting" }] : /* istanbul ignore next */ []));
|
|
1300
|
+
profileImageSrc = input(null, ...(ngDevMode ? [{ debugName: "profileImageSrc" }] : /* istanbul ignore next */ []));
|
|
1301
|
+
profileImageAlt = input('Imagen de perfil', ...(ngDevMode ? [{ debugName: "profileImageAlt" }] : /* istanbul ignore next */ []));
|
|
1302
|
+
avatarIconName = input('user', ...(ngDevMode ? [{ debugName: "avatarIconName" }] : /* istanbul ignore next */ []));
|
|
1303
|
+
avatarIconSize = input(24, ...(ngDevMode ? [{ debugName: "avatarIconSize" }] : /* istanbul ignore next */ []));
|
|
1304
|
+
avatarAlt = input('Perfil', ...(ngDevMode ? [{ debugName: "avatarAlt" }] : /* istanbul ignore next */ []));
|
|
1305
|
+
avatarSize = input('2.75rem', ...(ngDevMode ? [{ debugName: "avatarSize" }] : /* istanbul ignore next */ []));
|
|
1306
|
+
avatarRadius = input('0.625rem', ...(ngDevMode ? [{ debugName: "avatarRadius" }] : /* istanbul ignore next */ []));
|
|
1307
|
+
parrotImageName = input('profile', ...(ngDevMode ? [{ debugName: "parrotImageName" }] : /* istanbul ignore next */ []));
|
|
1308
|
+
parrotImageAlt = input('Mascota de perfil AlLoro', ...(ngDevMode ? [{ debugName: "parrotImageAlt" }] : /* istanbul ignore next */ []));
|
|
1309
|
+
parrotMobileWidth = input('34%', ...(ngDevMode ? [{ debugName: "parrotMobileWidth" }] : /* istanbul ignore next */ []));
|
|
1310
|
+
parrotWebWidth = input('34%', ...(ngDevMode ? [{ debugName: "parrotWebWidth" }] : /* istanbul ignore next */ []));
|
|
1311
|
+
eyebrowFontSize = input('clamp(0.75rem, 2.8cqi, 0.95rem)', ...(ngDevMode ? [{ debugName: "eyebrowFontSize" }] : /* istanbul ignore next */ []));
|
|
1312
|
+
titleFontSize = input('clamp(1.5rem, 6.4cqi, 2.45rem)', ...(ngDevMode ? [{ debugName: "titleFontSize" }] : /* istanbul ignore next */ []));
|
|
1313
|
+
greetingFontSize = input('clamp(0.8rem, 3.2cqi, 1.05rem)', ...(ngDevMode ? [{ debugName: "greetingFontSize" }] : /* istanbul ignore next */ []));
|
|
1314
|
+
elevated = input(true, ...(ngDevMode ? [{ debugName: "elevated" }] : /* istanbul ignore next */ []));
|
|
1315
|
+
avatarIconCssSize() {
|
|
1316
|
+
return `${this.avatarIconSize()}px`;
|
|
1317
|
+
}
|
|
1318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProfileHero, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroProfileHero, isStandalone: true, selector: "loro-profile-hero", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, firstName: { classPropertyName: "firstName", publicName: "firstName", isSignal: true, isRequired: false, transformFunction: null }, eyebrow: { classPropertyName: "eyebrow", publicName: "eyebrow", isSignal: true, isRequired: false, transformFunction: null }, greeting: { classPropertyName: "greeting", publicName: "greeting", isSignal: true, isRequired: false, transformFunction: null }, profileImageSrc: { classPropertyName: "profileImageSrc", publicName: "profileImageSrc", isSignal: true, isRequired: false, transformFunction: null }, profileImageAlt: { classPropertyName: "profileImageAlt", publicName: "profileImageAlt", isSignal: true, isRequired: false, transformFunction: null }, avatarIconName: { classPropertyName: "avatarIconName", publicName: "avatarIconName", isSignal: true, isRequired: false, transformFunction: null }, avatarIconSize: { classPropertyName: "avatarIconSize", publicName: "avatarIconSize", isSignal: true, isRequired: false, transformFunction: null }, avatarAlt: { classPropertyName: "avatarAlt", publicName: "avatarAlt", isSignal: true, isRequired: false, transformFunction: null }, avatarSize: { classPropertyName: "avatarSize", publicName: "avatarSize", isSignal: true, isRequired: false, transformFunction: null }, avatarRadius: { classPropertyName: "avatarRadius", publicName: "avatarRadius", isSignal: true, isRequired: false, transformFunction: null }, parrotImageName: { classPropertyName: "parrotImageName", publicName: "parrotImageName", isSignal: true, isRequired: false, transformFunction: null }, parrotImageAlt: { classPropertyName: "parrotImageAlt", publicName: "parrotImageAlt", isSignal: true, isRequired: false, transformFunction: null }, parrotMobileWidth: { classPropertyName: "parrotMobileWidth", publicName: "parrotMobileWidth", isSignal: true, isRequired: false, transformFunction: null }, parrotWebWidth: { classPropertyName: "parrotWebWidth", publicName: "parrotWebWidth", isSignal: true, isRequired: false, transformFunction: null }, eyebrowFontSize: { classPropertyName: "eyebrowFontSize", publicName: "eyebrowFontSize", isSignal: true, isRequired: false, transformFunction: null }, titleFontSize: { classPropertyName: "titleFontSize", publicName: "titleFontSize", isSignal: true, isRequired: false, transformFunction: null }, greetingFontSize: { classPropertyName: "greetingFontSize", publicName: "greetingFontSize", isSignal: true, isRequired: false, transformFunction: null }, elevated: { classPropertyName: "elevated", publicName: "elevated", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--loro-profile-hero-eyebrow-size": "eyebrowFontSize()", "style.--loro-profile-hero-title-size": "titleFontSize()", "style.--loro-profile-hero-greeting-size": "greetingFontSize()", "style.--loro-profile-hero-avatar-size": "avatarSize()", "style.--loro-profile-hero-avatar-radius": "avatarRadius()", "style.--loro-profile-hero-avatar-icon-size": "avatarIconCssSize()", "style.--loro-profile-hero-parrot-mobile-width": "parrotMobileWidth()", "style.--loro-profile-hero-parrot-desktop-width": "parrotWebWidth()" } }, ngImport: i0, template: "<section\n class=\"loro-profile-hero\"\n [class.loro-profile-hero--flat]=\"!elevated()\"\n [class.loro-profile-hero--compact]=\"variant() === 'compact'\"\n [class.loro-profile-hero--large]=\"variant() === 'large'\"\n [class.loro-profile-hero--support]=\"variant() === 'support'\"\n aria-label=\"Perfil de usuario\"\n>\n @if (variant() === 'support') {\n <div class=\"loro-profile-hero__support-art\" aria-hidden=\"true\">\n <loro-image [name]=\"parrotImageName()\" [alt]=\"parrotImageAlt()\" width=\"100%\" />\n </div>\n }\n\n <div class=\"loro-profile-hero__content\">\n @if (variant() !== 'support') {\n <div class=\"loro-profile-hero__avatar\">\n @if (profileImageSrc()) {\n <img\n class=\"loro-profile-hero__profile-image\"\n [src]=\"profileImageSrc()!\"\n [alt]=\"profileImageAlt()\"\n loading=\"lazy\"\n />\n } @else {\n <loro-icon\n [name]=\"avatarIconName()\"\n class=\"loro-profile-hero__avatar-icon\"\n [size]=\"avatarIconSize()\"\n [alt]=\"avatarAlt()\"\n />\n }\n </div>\n }\n\n <div class=\"loro-profile-hero__copy\">\n @if (variant() !== 'support' && eyebrow()) {\n <p class=\"loro-profile-hero__eyebrow\">\n {{ eyebrow() }}\n </p>\n }\n\n <h1 class=\"loro-profile-hero__title\">\n {{ firstName() }}\n </h1>\n\n <p class=\"loro-profile-hero__greeting\">\n {{ greeting() }}\n </p>\n </div>\n </div>\n\n @if (variant() !== 'support') {\n <div class=\"loro-profile-hero__art\" aria-hidden=\"true\">\n <loro-image\n [name]=\"parrotImageName()\"\n [alt]=\"parrotImageAlt()\"\n width=\"100%\"\n height=\"100%\"\n fit=\"contain\"\n />\n </div>\n }\n</section>\n", styles: [":host{display:block;width:100%;container-type:inline-size;--loro-profile-hero-eyebrow-size: clamp(.75rem, 2.8cqi, .95rem);--loro-profile-hero-title-size: clamp(1.5rem, 6.4cqi, 2.45rem);--loro-profile-hero-greeting-size: clamp(.8rem, 3.2cqi, 1.05rem);--loro-profile-hero-avatar-size: 2.75rem;--loro-profile-hero-avatar-radius: .625rem;--loro-profile-hero-avatar-icon-size: 1.5rem;--loro-profile-hero-parrot-mobile-width: 34%;--loro-profile-hero-parrot-desktop-width: 34%}.loro-profile-hero{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr) minmax(6.5rem,var(--loro-profile-hero-parrot-mobile-width));align-items:stretch;min-height:8.5rem;overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:.875rem;background:var(--loro-surface-elevated);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font-family:var(--loro-font-brand)}.loro-profile-hero--flat{box-shadow:none}.loro-profile-hero__content{position:relative;z-index:2;display:grid;grid-template-columns:min-content minmax(0,1fr);align-items:center;gap:.875rem;min-width:0;padding:1rem 2rem}.loro-profile-hero__avatar{display:grid;width:var(--loro-profile-hero-avatar-size);height:var(--loro-profile-hero-avatar-size);place-items:center;overflow:hidden;border-radius:var(--loro-profile-hero-avatar-radius);background:var(--loro-brand-tint-surface);box-shadow:var(--loro-shadow-soft)}.loro-profile-hero__avatar-icon{width:var(--loro-profile-hero-avatar-icon-size);height:var(--loro-profile-hero-avatar-icon-size)}.loro-profile-hero__profile-image{display:block;width:100%;height:100%;object-fit:cover}.loro-profile-hero__copy{min-width:0}.loro-profile-hero__eyebrow,.loro-profile-hero__title,.loro-profile-hero__greeting{margin:0}.loro-profile-hero__eyebrow{color:var(--loro-muted-strong);font-size:var(--loro-profile-hero-eyebrow-size);font-weight:500;line-height:1.15;letter-spacing:-.01em}.loro-profile-hero__title{max-width:100%;margin-top:.35rem;overflow-wrap:anywhere;color:var(--loro-text-strong);font-size:var(--loro-profile-hero-title-size);font-weight:800;line-height:.95;letter-spacing:-.04em}.loro-profile-hero__greeting{max-width:11rem;margin-top:.45rem;color:var(--loro-muted);font-size:var(--loro-profile-hero-greeting-size);font-weight:500;line-height:1.2;letter-spacing:-.025em}.loro-profile-hero__art{position:relative;z-index:1;display:flex;align-items:flex-end;justify-content:flex-end;min-width:0;height:100%;overflow:hidden;pointer-events:none}.loro-profile-hero__art loro-image{display:block;align-self:stretch;width:100%;height:100%;max-width:100%;max-height:100%}.loro-profile-hero__art ::ng-deep img,.loro-profile-hero__art ::ng-deep picture,.loro-profile-hero__art ::ng-deep svg{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:right bottom}.loro-profile-hero--compact{min-height:7.5rem}.loro-profile-hero--large{min-height:10rem}.loro-profile-hero--support{grid-template-columns:minmax(6rem,11rem) minmax(0,1fr);min-height:9rem}.loro-profile-hero--support .loro-profile-hero__content{grid-template-columns:minmax(0,1fr);padding-left:0}.loro-profile-hero--support .loro-profile-hero__greeting{max-width:none}.loro-profile-hero__support-art{display:grid;align-items:end;min-width:0;overflow:hidden;padding-left:1rem}.loro-profile-hero__support-art ::ng-deep img{width:100%;height:100%;object-fit:contain;object-position:left bottom}@container (min-width: 42rem){.loro-profile-hero{min-height:11rem;border-radius:.875rem}.loro-profile-hero__avatar{width:4.25rem;height:4.25rem;border-radius:.875rem}.loro-profile-hero__avatar-icon{width:1.875rem;height:1.875rem}.loro-profile-hero__greeting{max-width:none}.loro-profile-hero--compact{min-height:9.25rem}.loro-profile-hero--large{min-height:12.5rem}}@container (max-width: 27rem){.loro-profile-hero{grid-template-columns:minmax(0,1fr) minmax(5.75rem,32%);min-height:7.15rem}.loro-profile-hero__avatar{width:2.25rem;height:2.25rem;border-radius:.5rem}.loro-profile-hero__avatar-icon{width:1.25rem;height:1.25rem}.loro-profile-hero__title{margin-top:.25rem}.loro-profile-hero__greeting{max-width:7.4rem;margin-top:.3rem}.loro-profile-hero--compact{min-height:6.75rem}.loro-profile-hero--large{min-height:8.5rem}.loro-profile-hero--support{grid-template-columns:6.6rem minmax(0,1fr);min-height:7.75rem}.loro-profile-hero--support .loro-profile-hero__content{padding:1rem 1rem 1rem 0}}@container (max-width: 21rem){.loro-profile-hero{grid-template-columns:minmax(0,1fr) 5.5rem}.loro-profile-hero__avatar{width:2rem;height:2rem}.loro-profile-hero__greeting{max-width:6.8rem}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1320
|
+
}
|
|
1321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroProfileHero, decorators: [{
|
|
1322
|
+
type: Component,
|
|
1323
|
+
args: [{ selector: 'loro-profile-hero', standalone: true, imports: [LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1324
|
+
'[style.--loro-profile-hero-eyebrow-size]': 'eyebrowFontSize()',
|
|
1325
|
+
'[style.--loro-profile-hero-title-size]': 'titleFontSize()',
|
|
1326
|
+
'[style.--loro-profile-hero-greeting-size]': 'greetingFontSize()',
|
|
1327
|
+
'[style.--loro-profile-hero-avatar-size]': 'avatarSize()',
|
|
1328
|
+
'[style.--loro-profile-hero-avatar-radius]': 'avatarRadius()',
|
|
1329
|
+
'[style.--loro-profile-hero-avatar-icon-size]': 'avatarIconCssSize()',
|
|
1330
|
+
'[style.--loro-profile-hero-parrot-mobile-width]': 'parrotMobileWidth()',
|
|
1331
|
+
'[style.--loro-profile-hero-parrot-desktop-width]': 'parrotWebWidth()'
|
|
1332
|
+
}, template: "<section\n class=\"loro-profile-hero\"\n [class.loro-profile-hero--flat]=\"!elevated()\"\n [class.loro-profile-hero--compact]=\"variant() === 'compact'\"\n [class.loro-profile-hero--large]=\"variant() === 'large'\"\n [class.loro-profile-hero--support]=\"variant() === 'support'\"\n aria-label=\"Perfil de usuario\"\n>\n @if (variant() === 'support') {\n <div class=\"loro-profile-hero__support-art\" aria-hidden=\"true\">\n <loro-image [name]=\"parrotImageName()\" [alt]=\"parrotImageAlt()\" width=\"100%\" />\n </div>\n }\n\n <div class=\"loro-profile-hero__content\">\n @if (variant() !== 'support') {\n <div class=\"loro-profile-hero__avatar\">\n @if (profileImageSrc()) {\n <img\n class=\"loro-profile-hero__profile-image\"\n [src]=\"profileImageSrc()!\"\n [alt]=\"profileImageAlt()\"\n loading=\"lazy\"\n />\n } @else {\n <loro-icon\n [name]=\"avatarIconName()\"\n class=\"loro-profile-hero__avatar-icon\"\n [size]=\"avatarIconSize()\"\n [alt]=\"avatarAlt()\"\n />\n }\n </div>\n }\n\n <div class=\"loro-profile-hero__copy\">\n @if (variant() !== 'support' && eyebrow()) {\n <p class=\"loro-profile-hero__eyebrow\">\n {{ eyebrow() }}\n </p>\n }\n\n <h1 class=\"loro-profile-hero__title\">\n {{ firstName() }}\n </h1>\n\n <p class=\"loro-profile-hero__greeting\">\n {{ greeting() }}\n </p>\n </div>\n </div>\n\n @if (variant() !== 'support') {\n <div class=\"loro-profile-hero__art\" aria-hidden=\"true\">\n <loro-image\n [name]=\"parrotImageName()\"\n [alt]=\"parrotImageAlt()\"\n width=\"100%\"\n height=\"100%\"\n fit=\"contain\"\n />\n </div>\n }\n</section>\n", styles: [":host{display:block;width:100%;container-type:inline-size;--loro-profile-hero-eyebrow-size: clamp(.75rem, 2.8cqi, .95rem);--loro-profile-hero-title-size: clamp(1.5rem, 6.4cqi, 2.45rem);--loro-profile-hero-greeting-size: clamp(.8rem, 3.2cqi, 1.05rem);--loro-profile-hero-avatar-size: 2.75rem;--loro-profile-hero-avatar-radius: .625rem;--loro-profile-hero-avatar-icon-size: 1.5rem;--loro-profile-hero-parrot-mobile-width: 34%;--loro-profile-hero-parrot-desktop-width: 34%}.loro-profile-hero{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr) minmax(6.5rem,var(--loro-profile-hero-parrot-mobile-width));align-items:stretch;min-height:8.5rem;overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:.875rem;background:var(--loro-surface-elevated);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font-family:var(--loro-font-brand)}.loro-profile-hero--flat{box-shadow:none}.loro-profile-hero__content{position:relative;z-index:2;display:grid;grid-template-columns:min-content minmax(0,1fr);align-items:center;gap:.875rem;min-width:0;padding:1rem 2rem}.loro-profile-hero__avatar{display:grid;width:var(--loro-profile-hero-avatar-size);height:var(--loro-profile-hero-avatar-size);place-items:center;overflow:hidden;border-radius:var(--loro-profile-hero-avatar-radius);background:var(--loro-brand-tint-surface);box-shadow:var(--loro-shadow-soft)}.loro-profile-hero__avatar-icon{width:var(--loro-profile-hero-avatar-icon-size);height:var(--loro-profile-hero-avatar-icon-size)}.loro-profile-hero__profile-image{display:block;width:100%;height:100%;object-fit:cover}.loro-profile-hero__copy{min-width:0}.loro-profile-hero__eyebrow,.loro-profile-hero__title,.loro-profile-hero__greeting{margin:0}.loro-profile-hero__eyebrow{color:var(--loro-muted-strong);font-size:var(--loro-profile-hero-eyebrow-size);font-weight:500;line-height:1.15;letter-spacing:-.01em}.loro-profile-hero__title{max-width:100%;margin-top:.35rem;overflow-wrap:anywhere;color:var(--loro-text-strong);font-size:var(--loro-profile-hero-title-size);font-weight:800;line-height:.95;letter-spacing:-.04em}.loro-profile-hero__greeting{max-width:11rem;margin-top:.45rem;color:var(--loro-muted);font-size:var(--loro-profile-hero-greeting-size);font-weight:500;line-height:1.2;letter-spacing:-.025em}.loro-profile-hero__art{position:relative;z-index:1;display:flex;align-items:flex-end;justify-content:flex-end;min-width:0;height:100%;overflow:hidden;pointer-events:none}.loro-profile-hero__art loro-image{display:block;align-self:stretch;width:100%;height:100%;max-width:100%;max-height:100%}.loro-profile-hero__art ::ng-deep img,.loro-profile-hero__art ::ng-deep picture,.loro-profile-hero__art ::ng-deep svg{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:right bottom}.loro-profile-hero--compact{min-height:7.5rem}.loro-profile-hero--large{min-height:10rem}.loro-profile-hero--support{grid-template-columns:minmax(6rem,11rem) minmax(0,1fr);min-height:9rem}.loro-profile-hero--support .loro-profile-hero__content{grid-template-columns:minmax(0,1fr);padding-left:0}.loro-profile-hero--support .loro-profile-hero__greeting{max-width:none}.loro-profile-hero__support-art{display:grid;align-items:end;min-width:0;overflow:hidden;padding-left:1rem}.loro-profile-hero__support-art ::ng-deep img{width:100%;height:100%;object-fit:contain;object-position:left bottom}@container (min-width: 42rem){.loro-profile-hero{min-height:11rem;border-radius:.875rem}.loro-profile-hero__avatar{width:4.25rem;height:4.25rem;border-radius:.875rem}.loro-profile-hero__avatar-icon{width:1.875rem;height:1.875rem}.loro-profile-hero__greeting{max-width:none}.loro-profile-hero--compact{min-height:9.25rem}.loro-profile-hero--large{min-height:12.5rem}}@container (max-width: 27rem){.loro-profile-hero{grid-template-columns:minmax(0,1fr) minmax(5.75rem,32%);min-height:7.15rem}.loro-profile-hero__avatar{width:2.25rem;height:2.25rem;border-radius:.5rem}.loro-profile-hero__avatar-icon{width:1.25rem;height:1.25rem}.loro-profile-hero__title{margin-top:.25rem}.loro-profile-hero__greeting{max-width:7.4rem;margin-top:.3rem}.loro-profile-hero--compact{min-height:6.75rem}.loro-profile-hero--large{min-height:8.5rem}.loro-profile-hero--support{grid-template-columns:6.6rem minmax(0,1fr);min-height:7.75rem}.loro-profile-hero--support .loro-profile-hero__content{padding:1rem 1rem 1rem 0}}@container (max-width: 21rem){.loro-profile-hero{grid-template-columns:minmax(0,1fr) 5.5rem}.loro-profile-hero__avatar{width:2rem;height:2rem}.loro-profile-hero__greeting{max-width:6.8rem}}\n"] }]
|
|
1333
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], firstName: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstName", required: false }] }], eyebrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrow", required: false }] }], greeting: [{ type: i0.Input, args: [{ isSignal: true, alias: "greeting", required: false }] }], profileImageSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "profileImageSrc", required: false }] }], profileImageAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "profileImageAlt", required: false }] }], avatarIconName: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarIconName", required: false }] }], avatarIconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarIconSize", required: false }] }], avatarAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarAlt", required: false }] }], avatarSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarSize", required: false }] }], avatarRadius: [{ type: i0.Input, args: [{ isSignal: true, alias: "avatarRadius", required: false }] }], parrotImageName: [{ type: i0.Input, args: [{ isSignal: true, alias: "parrotImageName", required: false }] }], parrotImageAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "parrotImageAlt", required: false }] }], parrotMobileWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "parrotMobileWidth", required: false }] }], parrotWebWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "parrotWebWidth", required: false }] }], eyebrowFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrowFontSize", required: false }] }], titleFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "titleFontSize", required: false }] }], greetingFontSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "greetingFontSize", required: false }] }], elevated: [{ type: i0.Input, args: [{ isSignal: true, alias: "elevated", required: false }] }] } });
|
|
1334
|
+
|
|
1335
|
+
class LoroStatCard {
|
|
1336
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1337
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1338
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
1339
|
+
eyebrow = input('', ...(ngDevMode ? [{ debugName: "eyebrow" }] : /* istanbul ignore next */ []));
|
|
1340
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1341
|
+
iconSize = input(30, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1342
|
+
image = input(null, ...(ngDevMode ? [{ debugName: "image" }] : /* istanbul ignore next */ []));
|
|
1343
|
+
topImage = input(null, ...(ngDevMode ? [{ debugName: "topImage" }] : /* istanbul ignore next */ []));
|
|
1344
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1345
|
+
total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
1346
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroStatCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1347
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroStatCard, isStandalone: true, selector: "loro-stat-card", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, eyebrow: { classPropertyName: "eyebrow", publicName: "eyebrow", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, topImage: { classPropertyName: "topImage", publicName: "topImage", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1348
|
+
@if (variant() === 'image-corner' || variant() === 'card-basket') {
|
|
1349
|
+
<loro-image class="loro-stat-card__top-image" [name]="topImage() || 'loro-despensa'" [alt]="title()" width="6rem" />
|
|
1350
|
+
}
|
|
1351
|
+
<article class="loro-stat-card" [class]="'loro-stat-card loro-stat-card--' + variant()">
|
|
1352
|
+
@if (icon()) {
|
|
1353
|
+
<span class="loro-stat-card__icon">
|
|
1354
|
+
<loro-icon [name]="icon()!" [size]="iconSize()" [alt]="title()" [color]="variant() === 'danger' ? 'danger' : 'primary'" />
|
|
1355
|
+
</span>
|
|
1356
|
+
}
|
|
1357
|
+
<div class="loro-stat-card__copy">
|
|
1358
|
+
@if (eyebrow() || variant() === 'image-corner') {
|
|
1359
|
+
<p class="loro-stat-card__eyebrow">{{ eyebrow() || title() }}</p>
|
|
1360
|
+
<h2>{{ value() || title() }}</h2>
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
@if (value() && variant() !== 'image-corner') {
|
|
1364
|
+
<p class="loro-stat-card__title">{{ title() }}</p>
|
|
1365
|
+
}
|
|
1366
|
+
@if (description()) {
|
|
1367
|
+
<p class="loro-stat-card__description">{{ description() }}</p>
|
|
1368
|
+
}
|
|
1369
|
+
</div>
|
|
1370
|
+
@if (variant() === 'card-basket') {
|
|
1371
|
+
<div class="shopping-summary-card__total">
|
|
1372
|
+
<small>Total estimado</small>
|
|
1373
|
+
<strong>{{ total().toLocaleString('es-ES', { minimumFractionDigits: 2 }) }} €</strong>
|
|
1374
|
+
</div>
|
|
1375
|
+
}
|
|
1376
|
+
@if (image()) {
|
|
1377
|
+
<loro-image class="loro-stat-card__image" [name]="image()!" [alt]="title()" width="5.8rem" />
|
|
1378
|
+
}
|
|
1379
|
+
</article>
|
|
1380
|
+
|
|
1381
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-stat-card__top-image{display:flex;justify-content:center;pointer-events:none}.loro-stat-card{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1rem;min-height:6.8rem;padding:1.1rem 1.25rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);isolation:isolate}.loro-stat-card--tinted{background:var(--loro-surface-tinted)}.loro-stat-card--danger{background:#dc26260f}.loro-stat-card--compare-summary{grid-template-columns:3.85rem minmax(0,1fr);gap:.95rem;min-height:6rem;padding:.95rem 1.1rem;border-radius:1.35rem;background:var(--loro-surface)}.loro-stat-card--compare-inline{grid-template-columns:2.5rem minmax(0,1fr);gap:.65rem;min-height:3.7rem;padding:.7rem .9rem;border-radius:1rem;background:var(--loro-surface);box-shadow:none}.loro-stat-card--image-corner{grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.85rem;min-height:11.5rem;padding:1.2rem 6.9rem 1.2rem 1.2rem;border-radius:1.35rem;background:color-mix(in srgb,var(--loro-primary-500) 4%,var(--loro-surface))}.loro-stat-card__icon{position:relative;z-index:1;display:grid;width:3.7rem;height:3.7rem;place-items:center;border-radius:1rem;background:var(--loro-brand-tint-surface)}.loro-stat-card--danger .loro-stat-card__icon{background:#dc262617}.loro-stat-card--compare-summary .loro-stat-card__icon{width:3.55rem;height:3.55rem;border-radius:1rem}.loro-stat-card--compare-inline .loro-stat-card__icon{width:2.5rem;height:2.5rem;border-radius:.85rem}.loro-stat-card--image-corner .loro-stat-card__icon{width:3rem;height:3rem;border-radius:50%}.loro-stat-card__copy{position:relative;z-index:1;display:grid;align-content:center;min-width:0}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:clamp(1.45rem,4vw,2.15rem);font-weight:950;line-height:1.05;overflow-wrap:anywhere}.loro-stat-card__title{color:var(--loro-text-strong);font-size:1rem;font-weight:900}.loro-stat-card--compare-summary h2{font-size:clamp(1.25rem,4.8vw,1.75rem);line-height:.98}.loro-stat-card--compare-summary .loro-stat-card__title{font-size:clamp(.95rem,3.6vw,1.1rem);line-height:1.05}.loro-stat-card--compare-inline h2{font-size:clamp(.95rem,1.7vw,1.15rem);line-height:1}.loro-stat-card--compare-inline .loro-stat-card__title{color:var(--loro-muted-strong);font-size:.78rem;font-weight:850;line-height:1.05}.loro-stat-card--image-corner h2{font-size:clamp(1.45rem,3vw,2.1rem);line-height:1.02}.loro-stat-card--image-corner .loro-stat-card__title,.loro-stat-card--image-corner .loro-stat-card__eyebrow{color:var(--loro-text-strong);font-size:1.05rem;font-weight:900;line-height:1.12}.loro-stat-card__description,.loro-stat-card__eyebrow{margin-top:.35rem;color:var(--loro-muted);font-weight:700;line-height:1.35}.loro-stat-card__image{align-self:end}.loro-stat-card--image-corner .loro-stat-card__copy{align-content:start;gap:.5rem}.loro-stat-card--image-corner .loro-stat-card__eyebrow{margin-top:.15rem}.loro-stat-card--image-corner .loro-stat-card__description{margin-top:0;white-space:pre-line;max-width:18ch}.loro-stat-card--image-corner .loro-stat-card__image{position:absolute;top:1.55rem;right:1.2rem;align-self:start;width:4.95rem;pointer-events:none}.shopping-summary-card__total{display:grid;justify-items:end;color:var(--loro-muted);font-weight:750}.shopping-summary-card__total strong{color:var(--loro-primary-700);font-size:2rem;font-weight:950}@media(max-width:640px){.loro-stat-card{gap:.8rem;min-height:5.5rem;padding:.9rem 1rem}.loro-stat-card__icon{width:3rem;height:3rem;border-radius:.85rem}h2{font-size:clamp(1.2rem,5vw,1.55rem);line-height:1}.loro-stat-card__title{font-size:clamp(.84rem,3vw,.95rem);line-height:1.15}.loro-stat-card--compare-summary{grid-template-columns:3.1rem minmax(0,1fr);gap:.75rem;min-height:5.35rem;padding:.8rem .9rem;border-radius:1.2rem}.loro-stat-card--compare-summary .loro-stat-card__icon{width:3rem;height:3rem}.loro-stat-card--compare-summary h2{font-size:clamp(1.1rem,5vw,1.45rem)}.loro-stat-card--compare-summary .loro-stat-card__title{font-size:clamp(.88rem,3.4vw,1rem)}.loro-stat-card--compare-inline{grid-template-columns:2.2rem minmax(0,1fr);gap:.55rem;min-height:3.3rem;padding:.55rem .75rem}.loro-stat-card--compare-inline .loro-stat-card__icon{width:2.2rem;height:2.2rem;border-radius:.75rem}.loro-stat-card--compare-inline h2{font-size:1rem}.loro-stat-card--compare-inline .loro-stat-card__title{font-size:.74rem}.loro-stat-card--image-corner{min-height:8.25rem;gap:.65rem;padding:.95rem 4.6rem .95rem .95rem;border-radius:1.15rem}.loro-stat-card--image-corner .loro-stat-card__icon{width:2.45rem;height:2.45rem}.loro-stat-card--image-corner h2{font-size:clamp(1.05rem,4.8vw,1.65rem);line-height:1}.loro-stat-card--image-corner .loro-stat-card__title,.loro-stat-card--image-corner .loro-stat-card__eyebrow{font-size:.88rem;line-height:1.05}.loro-stat-card--image-corner .loro-stat-card__description{font-size:.78rem;line-height:1.16;max-width:16ch}.loro-stat-card--image-corner .loro-stat-card__image{top:1.15rem;right:.9rem;width:3.55rem}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1382
|
+
}
|
|
1383
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroStatCard, decorators: [{
|
|
1384
|
+
type: Component,
|
|
1385
|
+
args: [{ selector: 'loro-stat-card', standalone: true, imports: [LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1386
|
+
@if (variant() === 'image-corner' || variant() === 'card-basket') {
|
|
1387
|
+
<loro-image class="loro-stat-card__top-image" [name]="topImage() || 'loro-despensa'" [alt]="title()" width="6rem" />
|
|
1388
|
+
}
|
|
1389
|
+
<article class="loro-stat-card" [class]="'loro-stat-card loro-stat-card--' + variant()">
|
|
1390
|
+
@if (icon()) {
|
|
1391
|
+
<span class="loro-stat-card__icon">
|
|
1392
|
+
<loro-icon [name]="icon()!" [size]="iconSize()" [alt]="title()" [color]="variant() === 'danger' ? 'danger' : 'primary'" />
|
|
1393
|
+
</span>
|
|
1394
|
+
}
|
|
1395
|
+
<div class="loro-stat-card__copy">
|
|
1396
|
+
@if (eyebrow() || variant() === 'image-corner') {
|
|
1397
|
+
<p class="loro-stat-card__eyebrow">{{ eyebrow() || title() }}</p>
|
|
1398
|
+
<h2>{{ value() || title() }}</h2>
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
@if (value() && variant() !== 'image-corner') {
|
|
1402
|
+
<p class="loro-stat-card__title">{{ title() }}</p>
|
|
1403
|
+
}
|
|
1404
|
+
@if (description()) {
|
|
1405
|
+
<p class="loro-stat-card__description">{{ description() }}</p>
|
|
1406
|
+
}
|
|
1407
|
+
</div>
|
|
1408
|
+
@if (variant() === 'card-basket') {
|
|
1409
|
+
<div class="shopping-summary-card__total">
|
|
1410
|
+
<small>Total estimado</small>
|
|
1411
|
+
<strong>{{ total().toLocaleString('es-ES', { minimumFractionDigits: 2 }) }} €</strong>
|
|
1412
|
+
</div>
|
|
1413
|
+
}
|
|
1414
|
+
@if (image()) {
|
|
1415
|
+
<loro-image class="loro-stat-card__image" [name]="image()!" [alt]="title()" width="5.8rem" />
|
|
1416
|
+
}
|
|
1417
|
+
</article>
|
|
1418
|
+
|
|
1419
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-stat-card__top-image{display:flex;justify-content:center;pointer-events:none}.loro-stat-card{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1rem;min-height:6.8rem;padding:1.1rem 1.25rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-card);background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);color:var(--loro-text);isolation:isolate}.loro-stat-card--tinted{background:var(--loro-surface-tinted)}.loro-stat-card--danger{background:#dc26260f}.loro-stat-card--compare-summary{grid-template-columns:3.85rem minmax(0,1fr);gap:.95rem;min-height:6rem;padding:.95rem 1.1rem;border-radius:1.35rem;background:var(--loro-surface)}.loro-stat-card--compare-inline{grid-template-columns:2.5rem minmax(0,1fr);gap:.65rem;min-height:3.7rem;padding:.7rem .9rem;border-radius:1rem;background:var(--loro-surface);box-shadow:none}.loro-stat-card--image-corner{grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.85rem;min-height:11.5rem;padding:1.2rem 6.9rem 1.2rem 1.2rem;border-radius:1.35rem;background:color-mix(in srgb,var(--loro-primary-500) 4%,var(--loro-surface))}.loro-stat-card__icon{position:relative;z-index:1;display:grid;width:3.7rem;height:3.7rem;place-items:center;border-radius:1rem;background:var(--loro-brand-tint-surface)}.loro-stat-card--danger .loro-stat-card__icon{background:#dc262617}.loro-stat-card--compare-summary .loro-stat-card__icon{width:3.55rem;height:3.55rem;border-radius:1rem}.loro-stat-card--compare-inline .loro-stat-card__icon{width:2.5rem;height:2.5rem;border-radius:.85rem}.loro-stat-card--image-corner .loro-stat-card__icon{width:3rem;height:3rem;border-radius:50%}.loro-stat-card__copy{position:relative;z-index:1;display:grid;align-content:center;min-width:0}h2,p{margin:0}h2{color:var(--loro-text-strong);font-size:clamp(1.45rem,4vw,2.15rem);font-weight:950;line-height:1.05;overflow-wrap:anywhere}.loro-stat-card__title{color:var(--loro-text-strong);font-size:1rem;font-weight:900}.loro-stat-card--compare-summary h2{font-size:clamp(1.25rem,4.8vw,1.75rem);line-height:.98}.loro-stat-card--compare-summary .loro-stat-card__title{font-size:clamp(.95rem,3.6vw,1.1rem);line-height:1.05}.loro-stat-card--compare-inline h2{font-size:clamp(.95rem,1.7vw,1.15rem);line-height:1}.loro-stat-card--compare-inline .loro-stat-card__title{color:var(--loro-muted-strong);font-size:.78rem;font-weight:850;line-height:1.05}.loro-stat-card--image-corner h2{font-size:clamp(1.45rem,3vw,2.1rem);line-height:1.02}.loro-stat-card--image-corner .loro-stat-card__title,.loro-stat-card--image-corner .loro-stat-card__eyebrow{color:var(--loro-text-strong);font-size:1.05rem;font-weight:900;line-height:1.12}.loro-stat-card__description,.loro-stat-card__eyebrow{margin-top:.35rem;color:var(--loro-muted);font-weight:700;line-height:1.35}.loro-stat-card__image{align-self:end}.loro-stat-card--image-corner .loro-stat-card__copy{align-content:start;gap:.5rem}.loro-stat-card--image-corner .loro-stat-card__eyebrow{margin-top:.15rem}.loro-stat-card--image-corner .loro-stat-card__description{margin-top:0;white-space:pre-line;max-width:18ch}.loro-stat-card--image-corner .loro-stat-card__image{position:absolute;top:1.55rem;right:1.2rem;align-self:start;width:4.95rem;pointer-events:none}.shopping-summary-card__total{display:grid;justify-items:end;color:var(--loro-muted);font-weight:750}.shopping-summary-card__total strong{color:var(--loro-primary-700);font-size:2rem;font-weight:950}@media(max-width:640px){.loro-stat-card{gap:.8rem;min-height:5.5rem;padding:.9rem 1rem}.loro-stat-card__icon{width:3rem;height:3rem;border-radius:.85rem}h2{font-size:clamp(1.2rem,5vw,1.55rem);line-height:1}.loro-stat-card__title{font-size:clamp(.84rem,3vw,.95rem);line-height:1.15}.loro-stat-card--compare-summary{grid-template-columns:3.1rem minmax(0,1fr);gap:.75rem;min-height:5.35rem;padding:.8rem .9rem;border-radius:1.2rem}.loro-stat-card--compare-summary .loro-stat-card__icon{width:3rem;height:3rem}.loro-stat-card--compare-summary h2{font-size:clamp(1.1rem,5vw,1.45rem)}.loro-stat-card--compare-summary .loro-stat-card__title{font-size:clamp(.88rem,3.4vw,1rem)}.loro-stat-card--compare-inline{grid-template-columns:2.2rem minmax(0,1fr);gap:.55rem;min-height:3.3rem;padding:.55rem .75rem}.loro-stat-card--compare-inline .loro-stat-card__icon{width:2.2rem;height:2.2rem;border-radius:.75rem}.loro-stat-card--compare-inline h2{font-size:1rem}.loro-stat-card--compare-inline .loro-stat-card__title{font-size:.74rem}.loro-stat-card--image-corner{min-height:8.25rem;gap:.65rem;padding:.95rem 4.6rem .95rem .95rem;border-radius:1.15rem}.loro-stat-card--image-corner .loro-stat-card__icon{width:2.45rem;height:2.45rem}.loro-stat-card--image-corner h2{font-size:clamp(1.05rem,4.8vw,1.65rem);line-height:1}.loro-stat-card--image-corner .loro-stat-card__title,.loro-stat-card--image-corner .loro-stat-card__eyebrow{font-size:.88rem;line-height:1.05}.loro-stat-card--image-corner .loro-stat-card__description{font-size:.78rem;line-height:1.16;max-width:16ch}.loro-stat-card--image-corner .loro-stat-card__image{top:1.15rem;right:.9rem;width:3.55rem}}\n"] }]
|
|
1420
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], eyebrow: [{ type: i0.Input, args: [{ isSignal: true, alias: "eyebrow", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], topImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "topImage", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }] } });
|
|
1421
|
+
|
|
1422
|
+
class LoroStoreRankCard {
|
|
1423
|
+
rank = input.required(...(ngDevMode ? [{ debugName: "rank" }] : /* istanbul ignore next */ []));
|
|
1424
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1425
|
+
price = input.required(...(ngDevMode ? [{ debugName: "price" }] : /* istanbul ignore next */ []));
|
|
1426
|
+
delta = input(0, ...(ngDevMode ? [{ debugName: "delta" }] : /* istanbul ignore next */ []));
|
|
1427
|
+
logoName = input(null, ...(ngDevMode ? [{ debugName: "logoName" }] : /* istanbul ignore next */ []));
|
|
1428
|
+
best = input(false, ...(ngDevMode ? [{ debugName: "best" }] : /* istanbul ignore next */ []));
|
|
1429
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1430
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroStoreRankCard, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1431
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroStoreRankCard, isStandalone: true, selector: "loro-store-rank-card", inputs: { rank: { classPropertyName: "rank", publicName: "rank", isSignal: true, isRequired: true, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, price: { classPropertyName: "price", publicName: "price", isSignal: true, isRequired: true, transformFunction: null }, delta: { classPropertyName: "delta", publicName: "delta", isSignal: true, isRequired: false, transformFunction: null }, logoName: { classPropertyName: "logoName", publicName: "logoName", isSignal: true, isRequired: false, transformFunction: null }, best: { classPropertyName: "best", publicName: "best", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1432
|
+
<article
|
|
1433
|
+
class="loro-store-rank-card"
|
|
1434
|
+
[class.loro-store-rank-card--best]="best()"
|
|
1435
|
+
[class.loro-store-rank-card--compact]="variant() === 'compact'">
|
|
1436
|
+
@if (variant() !== 'compact') {
|
|
1437
|
+
<span class="loro-store-rank-card__rank">{{ rank() }}</span>
|
|
1438
|
+
}
|
|
1439
|
+
@if (logoName()) {
|
|
1440
|
+
<loro-image class="loro-store-rank-card__logo" [name]="logoName()!" [alt]="name()" width="100%" height="100%" fit="contain" />
|
|
1441
|
+
} @else {
|
|
1442
|
+
<span class="loro-store-rank-card__mark">{{ name().slice(0, 3) }}</span>
|
|
1443
|
+
}
|
|
1444
|
+
@if (variant() !== 'compact') {
|
|
1445
|
+
<h3>{{ name() }}</h3>
|
|
1446
|
+
}
|
|
1447
|
+
<strong>{{ price() | number: '1.2-2' }} €</strong>
|
|
1448
|
+
@if (variant() !== 'compact') {
|
|
1449
|
+
<loro-badge [label]="best() ? 'Mejor precio' : '+' + (delta() | number: '1.2-2') + ' €'" [variant]="best() ? 'success' : 'info'" />
|
|
1450
|
+
}
|
|
1451
|
+
</article>
|
|
1452
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-store-rank-card{position:relative;display:grid;justify-items:center;align-content:center;gap:.45rem;min-height:10.8rem;padding:1.4rem 1rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);text-align:center}.loro-store-rank-card--compact{gap:.25rem;min-height:4.9rem;padding:.7rem .8rem;border-radius:.95rem;box-shadow:none}.loro-store-rank-card__rank{position:absolute;top:.85rem;left:.85rem;display:grid;width:2rem;height:2rem;place-items:center;border-radius:50%;background:var(--loro-surface-muted);color:var(--loro-primary-700);font-weight:950}.loro-store-rank-card--best .loro-store-rank-card__rank{background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff}.loro-store-rank-card__logo{display:block;width:4.5rem;height:2.6rem}.loro-store-rank-card--compact .loro-store-rank-card__logo{width:3rem;height:1.8rem}.loro-store-rank-card__logo ::ng-deep img{width:100%;height:100%;object-fit:contain}.loro-store-rank-card__mark{color:var(--loro-primary-700);font-size:1.5rem;font-weight:950}h3,strong{margin:0;color:var(--loro-text-strong)}h3{font-size:1.05rem;font-weight:900;line-height:1.12;overflow-wrap:anywhere}strong{color:var(--loro-primary-700);font-size:clamp(1.35rem,3vw,1.8rem);font-weight:950;line-height:1;white-space:nowrap}.loro-store-rank-card--compact strong{font-size:clamp(1rem,2.1vw,1.2rem);line-height:1}@media(max-width:640px){.loro-store-rank-card{gap:.35rem;min-height:8.9rem;padding:1rem .65rem .85rem;border-radius:.9rem}.loro-store-rank-card__rank{top:.6rem;left:.6rem;width:1.75rem;height:1.75rem;font-size:.95rem}.loro-store-rank-card__logo{width:3.25rem;height:2rem}.loro-store-rank-card--compact{min-height:4.55rem;padding:.55rem .65rem}.loro-store-rank-card--compact .loro-store-rank-card__logo{width:2.7rem;height:1.6rem}.loro-store-rank-card--compact strong{font-size:clamp(.92rem,3.8vw,1.08rem)}h3{font-size:clamp(.9rem,3.6vw,1rem)}strong{font-size:clamp(1.15rem,5vw,1.55rem)}}\n"], dependencies: [{ kind: "component", type: LoroBadge$1, selector: "loro-badge", inputs: ["label", "variant"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }, { kind: "pipe", type: DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1453
|
+
}
|
|
1454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroStoreRankCard, decorators: [{
|
|
1455
|
+
type: Component,
|
|
1456
|
+
args: [{ selector: 'loro-store-rank-card', standalone: true, imports: [DecimalPipe, LoroBadge$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1457
|
+
<article
|
|
1458
|
+
class="loro-store-rank-card"
|
|
1459
|
+
[class.loro-store-rank-card--best]="best()"
|
|
1460
|
+
[class.loro-store-rank-card--compact]="variant() === 'compact'">
|
|
1461
|
+
@if (variant() !== 'compact') {
|
|
1462
|
+
<span class="loro-store-rank-card__rank">{{ rank() }}</span>
|
|
1463
|
+
}
|
|
1464
|
+
@if (logoName()) {
|
|
1465
|
+
<loro-image class="loro-store-rank-card__logo" [name]="logoName()!" [alt]="name()" width="100%" height="100%" fit="contain" />
|
|
1466
|
+
} @else {
|
|
1467
|
+
<span class="loro-store-rank-card__mark">{{ name().slice(0, 3) }}</span>
|
|
1468
|
+
}
|
|
1469
|
+
@if (variant() !== 'compact') {
|
|
1470
|
+
<h3>{{ name() }}</h3>
|
|
1471
|
+
}
|
|
1472
|
+
<strong>{{ price() | number: '1.2-2' }} €</strong>
|
|
1473
|
+
@if (variant() !== 'compact') {
|
|
1474
|
+
<loro-badge [label]="best() ? 'Mejor precio' : '+' + (delta() | number: '1.2-2') + ' €'" [variant]="best() ? 'success' : 'info'" />
|
|
1475
|
+
}
|
|
1476
|
+
</article>
|
|
1477
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-store-rank-card{position:relative;display:grid;justify-items:center;align-content:center;gap:.45rem;min-height:10.8rem;padding:1.4rem 1rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-soft);text-align:center}.loro-store-rank-card--compact{gap:.25rem;min-height:4.9rem;padding:.7rem .8rem;border-radius:.95rem;box-shadow:none}.loro-store-rank-card__rank{position:absolute;top:.85rem;left:.85rem;display:grid;width:2rem;height:2rem;place-items:center;border-radius:50%;background:var(--loro-surface-muted);color:var(--loro-primary-700);font-weight:950}.loro-store-rank-card--best .loro-store-rank-card__rank{background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff}.loro-store-rank-card__logo{display:block;width:4.5rem;height:2.6rem}.loro-store-rank-card--compact .loro-store-rank-card__logo{width:3rem;height:1.8rem}.loro-store-rank-card__logo ::ng-deep img{width:100%;height:100%;object-fit:contain}.loro-store-rank-card__mark{color:var(--loro-primary-700);font-size:1.5rem;font-weight:950}h3,strong{margin:0;color:var(--loro-text-strong)}h3{font-size:1.05rem;font-weight:900;line-height:1.12;overflow-wrap:anywhere}strong{color:var(--loro-primary-700);font-size:clamp(1.35rem,3vw,1.8rem);font-weight:950;line-height:1;white-space:nowrap}.loro-store-rank-card--compact strong{font-size:clamp(1rem,2.1vw,1.2rem);line-height:1}@media(max-width:640px){.loro-store-rank-card{gap:.35rem;min-height:8.9rem;padding:1rem .65rem .85rem;border-radius:.9rem}.loro-store-rank-card__rank{top:.6rem;left:.6rem;width:1.75rem;height:1.75rem;font-size:.95rem}.loro-store-rank-card__logo{width:3.25rem;height:2rem}.loro-store-rank-card--compact{min-height:4.55rem;padding:.55rem .65rem}.loro-store-rank-card--compact .loro-store-rank-card__logo{width:2.7rem;height:1.6rem}.loro-store-rank-card--compact strong{font-size:clamp(.92rem,3.8vw,1.08rem)}h3{font-size:clamp(.9rem,3.6vw,1rem)}strong{font-size:clamp(1.15rem,5vw,1.55rem)}}\n"] }]
|
|
1478
|
+
}], propDecorators: { rank: [{ type: i0.Input, args: [{ isSignal: true, alias: "rank", required: true }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], price: [{ type: i0.Input, args: [{ isSignal: true, alias: "price", required: true }] }], delta: [{ type: i0.Input, args: [{ isSignal: true, alias: "delta", required: false }] }], logoName: [{ type: i0.Input, args: [{ isSignal: true, alias: "logoName", required: false }] }], best: [{ type: i0.Input, args: [{ isSignal: true, alias: "best", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }] } });
|
|
1479
|
+
|
|
1480
|
+
class LoroSummaryBar {
|
|
1481
|
+
totalLabel = input('Total estimado', ...(ngDevMode ? [{ debugName: "totalLabel" }] : /* istanbul ignore next */ []));
|
|
1482
|
+
total = input.required(...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
1483
|
+
primaryLabel = input('Ya lo he comprado', ...(ngDevMode ? [{ debugName: "primaryLabel" }] : /* istanbul ignore next */ []));
|
|
1484
|
+
secondaryLabel = input('Comparar precios', ...(ngDevMode ? [{ debugName: "secondaryLabel" }] : /* istanbul ignore next */ []));
|
|
1485
|
+
helper = input('Los productos marcados se anadiran a tu despensa.', ...(ngDevMode ? [{ debugName: "helper" }] : /* istanbul ignore next */ []));
|
|
1486
|
+
leftImage = input('loro-buy', ...(ngDevMode ? [{ debugName: "leftImage" }] : /* istanbul ignore next */ []));
|
|
1487
|
+
rightImage = input('pantry-cabinet', ...(ngDevMode ? [{ debugName: "rightImage" }] : /* istanbul ignore next */ []));
|
|
1488
|
+
primaryDisabled = input(false, ...(ngDevMode ? [{ debugName: "primaryDisabled" }] : /* istanbul ignore next */ []));
|
|
1489
|
+
secondaryDisabled = input(false, ...(ngDevMode ? [{ debugName: "secondaryDisabled" }] : /* istanbul ignore next */ []));
|
|
1490
|
+
primaryAction = output();
|
|
1491
|
+
secondaryAction = output();
|
|
1492
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSummaryBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1493
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroSummaryBar, isStandalone: true, selector: "loro-summary-bar", inputs: { totalLabel: { classPropertyName: "totalLabel", publicName: "totalLabel", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, primaryLabel: { classPropertyName: "primaryLabel", publicName: "primaryLabel", isSignal: true, isRequired: false, transformFunction: null }, secondaryLabel: { classPropertyName: "secondaryLabel", publicName: "secondaryLabel", isSignal: true, isRequired: false, transformFunction: null }, helper: { classPropertyName: "helper", publicName: "helper", isSignal: true, isRequired: false, transformFunction: null }, leftImage: { classPropertyName: "leftImage", publicName: "leftImage", isSignal: true, isRequired: false, transformFunction: null }, rightImage: { classPropertyName: "rightImage", publicName: "rightImage", isSignal: true, isRequired: false, transformFunction: null }, primaryDisabled: { classPropertyName: "primaryDisabled", publicName: "primaryDisabled", isSignal: true, isRequired: false, transformFunction: null }, secondaryDisabled: { classPropertyName: "secondaryDisabled", publicName: "secondaryDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { primaryAction: "primaryAction", secondaryAction: "secondaryAction" }, ngImport: i0, template: `
|
|
1494
|
+
<aside class="loro-summary-bar">
|
|
1495
|
+
<div class="loro-summary-bar__total">
|
|
1496
|
+
<small>{{ totalLabel() }}</small>
|
|
1497
|
+
<strong>{{ total().toLocaleString('es-ES', { minimumFractionDigits: 2 }) }} €</strong>
|
|
1498
|
+
@if (secondaryLabel()) {
|
|
1499
|
+
<loro-button
|
|
1500
|
+
[label]="secondaryLabel()"
|
|
1501
|
+
icon="tag"
|
|
1502
|
+
[iconSize]="20"
|
|
1503
|
+
variant="outline"
|
|
1504
|
+
[disabled]="secondaryDisabled()"
|
|
1505
|
+
(buttonClick)="secondaryAction.emit()" />
|
|
1506
|
+
}
|
|
1507
|
+
</div>
|
|
1508
|
+
<div class="loro-summary-bar__flow" aria-hidden="true">
|
|
1509
|
+
<loro-image [name]="leftImage()" alt="" width="5.9rem" />
|
|
1510
|
+
<loro-icon name="arrow-right" [size]="34" alt="" color="primary" />
|
|
1511
|
+
<loro-image [name]="rightImage()" alt="" width="5.25rem" />
|
|
1512
|
+
</div>
|
|
1513
|
+
<div class="loro-summary-bar__action">
|
|
1514
|
+
<loro-button
|
|
1515
|
+
[label]="primaryLabel()"
|
|
1516
|
+
icon="check"
|
|
1517
|
+
[iconSize]="21"
|
|
1518
|
+
[fullWidth]="true"
|
|
1519
|
+
[disabled]="primaryDisabled()"
|
|
1520
|
+
(buttonClick)="primaryAction.emit()" />
|
|
1521
|
+
@if (helper()) {
|
|
1522
|
+
<small>{{ helper() }}</small>
|
|
1523
|
+
}
|
|
1524
|
+
</div>
|
|
1525
|
+
</aside>
|
|
1526
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-summary-bar{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,.8fr) minmax(0,1.2fr);align-items:center;gap:1.45rem;width:100%;min-width:0;min-height:6.75rem;padding:.75rem 1.9rem;box-sizing:border-box;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-panel)}.loro-summary-bar__total{display:grid;grid-template-columns:minmax(7rem,auto) minmax(9.5rem,auto);align-items:end;justify-content:start;gap:.25rem 1.6rem;min-width:0}.loro-summary-bar__total loro-button{grid-row:1 / span 2;grid-column:2;align-self:center;--loro-summary-button-min-height: 2.9rem;--loro-summary-button-padding: .65rem 1rem;--loro-summary-button-font-size: 1rem}.loro-summary-bar__action{display:grid;justify-items:stretch;gap:.45rem;min-width:0;max-width:100%;overflow:hidden}small{color:var(--loro-muted);font-size:.92rem;font-weight:750;line-height:1.3}strong{color:var(--loro-primary-700);font-size:2.15rem;font-weight:950;line-height:1;white-space:nowrap}.loro-summary-bar__flow{display:inline-grid;grid-template-columns:auto auto auto;align-items:center;justify-content:center;gap:clamp(.55rem,1vw,1rem);min-width:0;padding-inline:clamp(.75rem,1.8vw,2.1rem);border-left:1px solid var(--loro-border-subtle);color:var(--loro-primary-700);font-size:2rem;font-weight:900}.loro-summary-bar__action loro-button{min-width:0;--loro-summary-button-min-height: 2.65rem;--loro-summary-button-padding: .62rem 1rem;--loro-summary-button-font-size: 1rem}.loro-summary-bar loro-button{--loro-button-min-height: var(--loro-summary-button-min-height);--loro-button-padding: var(--loro-summary-button-padding);--loro-button-radius: .55rem;--loro-button-font-size: var(--loro-summary-button-font-size)}:host ::ng-deep .loro-summary-bar loro-button .loro-button{max-width:100%;min-width:0}:host ::ng-deep .loro-summary-bar loro-button .loro-button span{min-width:0;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .loro-summary-bar__action loro-button,:host ::ng-deep .loro-summary-bar__action loro-button .loro-button{width:100%}.loro-summary-bar__action small{min-width:0;max-width:100%;overflow-wrap:anywhere;text-align:center}@media(max-width:1023.88px){.loro-summary-bar{grid-template-columns:minmax(0,.84fr) minmax(0,1.16fr);grid-template-areas:\"total flow\" \"total action\";align-items:center;gap:.55rem .8rem;min-height:0;padding:.85rem .95rem;border-radius:1.15rem}.loro-summary-bar__total{grid-area:total;grid-template-columns:1fr;align-content:center;justify-items:start;gap:.36rem;min-width:0;height:100%;padding-right:.65rem;border-right:1px solid var(--loro-border-subtle)}.loro-summary-bar__total loro-button{grid-row:auto;grid-column:auto;width:100%;max-width:9.6rem;--loro-summary-button-min-height: 2.2rem;--loro-summary-button-padding: .48rem .6rem;--loro-summary-button-font-size: .82rem}.loro-summary-bar__flow{grid-area:flow;display:inline-grid;justify-self:center;width:100%;max-width:10.75rem;gap:.32rem;padding-inline:0;border-left:0}.loro-summary-bar__flow loro-image:first-child{width:4.35rem}.loro-summary-bar__flow loro-image:last-child{width:3.85rem}.loro-summary-bar__action{grid-area:action;justify-items:stretch;gap:.28rem;min-width:0;width:100%}.loro-summary-bar__action loro-button{display:block;width:100%;min-width:0;--loro-summary-button-min-height: 2.35rem;--loro-summary-button-padding: .5rem .55rem;--loro-summary-button-font-size: .82rem}small{font-size:.82rem}strong{font-size:clamp(1.45rem,5.6vw,1.9rem)}}@media(max-width:640px){.loro-summary-bar{grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr);gap:.48rem .62rem;padding:.78rem .82rem}.loro-summary-bar__total loro-button{max-width:8.9rem;--loro-summary-button-min-height: 2.1rem;--loro-summary-button-padding: .44rem .52rem;--loro-summary-button-font-size: .74rem}.loro-summary-bar__flow loro-image:first-child{width:3.45rem}.loro-summary-bar__flow loro-image:last-child{width:3.2rem}.loro-summary-bar__flow{max-width:8.45rem;gap:.2rem}.loro-summary-bar__flow loro-icon{transform:scale(.78)}.loro-summary-bar__action loro-button{--loro-summary-button-min-height: 2.2rem;--loro-summary-button-padding: .48rem .44rem;--loro-summary-button-font-size: .74rem}small{font-size:.72rem}strong{font-size:clamp(1.28rem,7vw,1.6rem)}}@media(max-width:430px){.loro-summary-bar{grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr);padding:.72rem}.loro-summary-bar__total{padding-right:.5rem}.loro-summary-bar__total loro-button{max-width:7.8rem;--loro-summary-button-font-size: .68rem}.loro-summary-bar__action loro-button{--loro-summary-button-font-size: .68rem}.loro-summary-bar__flow{max-width:7.6rem}.loro-summary-bar__flow loro-image:first-child{width:3rem}.loro-summary-bar__flow loro-image:last-child{width:2.85rem}}\n"], dependencies: [{ kind: "component", type: LoroButton$1, selector: "loro-button", inputs: ["label", "text", "icon", "iconContent", "iconMode", "iconSize", "iconButtonSize", "iconColor", "socialMobileCompact", "selected", "variant", "typeButton", "color", "size", "fullWidth", "buttonWidth", "disabled", "loading", "type", "formId", "ariaLabel", "ariaDescription"], outputs: ["buttonClick", "change", "sanChange"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1527
|
+
}
|
|
1528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSummaryBar, decorators: [{
|
|
1529
|
+
type: Component,
|
|
1530
|
+
args: [{ selector: 'loro-summary-bar', standalone: true, imports: [LoroButton$1, LoroIcon$1, LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1531
|
+
<aside class="loro-summary-bar">
|
|
1532
|
+
<div class="loro-summary-bar__total">
|
|
1533
|
+
<small>{{ totalLabel() }}</small>
|
|
1534
|
+
<strong>{{ total().toLocaleString('es-ES', { minimumFractionDigits: 2 }) }} €</strong>
|
|
1535
|
+
@if (secondaryLabel()) {
|
|
1536
|
+
<loro-button
|
|
1537
|
+
[label]="secondaryLabel()"
|
|
1538
|
+
icon="tag"
|
|
1539
|
+
[iconSize]="20"
|
|
1540
|
+
variant="outline"
|
|
1541
|
+
[disabled]="secondaryDisabled()"
|
|
1542
|
+
(buttonClick)="secondaryAction.emit()" />
|
|
1543
|
+
}
|
|
1544
|
+
</div>
|
|
1545
|
+
<div class="loro-summary-bar__flow" aria-hidden="true">
|
|
1546
|
+
<loro-image [name]="leftImage()" alt="" width="5.9rem" />
|
|
1547
|
+
<loro-icon name="arrow-right" [size]="34" alt="" color="primary" />
|
|
1548
|
+
<loro-image [name]="rightImage()" alt="" width="5.25rem" />
|
|
1549
|
+
</div>
|
|
1550
|
+
<div class="loro-summary-bar__action">
|
|
1551
|
+
<loro-button
|
|
1552
|
+
[label]="primaryLabel()"
|
|
1553
|
+
icon="check"
|
|
1554
|
+
[iconSize]="21"
|
|
1555
|
+
[fullWidth]="true"
|
|
1556
|
+
[disabled]="primaryDisabled()"
|
|
1557
|
+
(buttonClick)="primaryAction.emit()" />
|
|
1558
|
+
@if (helper()) {
|
|
1559
|
+
<small>{{ helper() }}</small>
|
|
1560
|
+
}
|
|
1561
|
+
</div>
|
|
1562
|
+
</aside>
|
|
1563
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-summary-bar{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,.8fr) minmax(0,1.2fr);align-items:center;gap:1.45rem;width:100%;min-width:0;min-height:6.75rem;padding:.75rem 1.9rem;box-sizing:border-box;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-soft);box-shadow:var(--loro-shadow-panel)}.loro-summary-bar__total{display:grid;grid-template-columns:minmax(7rem,auto) minmax(9.5rem,auto);align-items:end;justify-content:start;gap:.25rem 1.6rem;min-width:0}.loro-summary-bar__total loro-button{grid-row:1 / span 2;grid-column:2;align-self:center;--loro-summary-button-min-height: 2.9rem;--loro-summary-button-padding: .65rem 1rem;--loro-summary-button-font-size: 1rem}.loro-summary-bar__action{display:grid;justify-items:stretch;gap:.45rem;min-width:0;max-width:100%;overflow:hidden}small{color:var(--loro-muted);font-size:.92rem;font-weight:750;line-height:1.3}strong{color:var(--loro-primary-700);font-size:2.15rem;font-weight:950;line-height:1;white-space:nowrap}.loro-summary-bar__flow{display:inline-grid;grid-template-columns:auto auto auto;align-items:center;justify-content:center;gap:clamp(.55rem,1vw,1rem);min-width:0;padding-inline:clamp(.75rem,1.8vw,2.1rem);border-left:1px solid var(--loro-border-subtle);color:var(--loro-primary-700);font-size:2rem;font-weight:900}.loro-summary-bar__action loro-button{min-width:0;--loro-summary-button-min-height: 2.65rem;--loro-summary-button-padding: .62rem 1rem;--loro-summary-button-font-size: 1rem}.loro-summary-bar loro-button{--loro-button-min-height: var(--loro-summary-button-min-height);--loro-button-padding: var(--loro-summary-button-padding);--loro-button-radius: .55rem;--loro-button-font-size: var(--loro-summary-button-font-size)}:host ::ng-deep .loro-summary-bar loro-button .loro-button{max-width:100%;min-width:0}:host ::ng-deep .loro-summary-bar loro-button .loro-button span{min-width:0;overflow:hidden;text-overflow:ellipsis}:host ::ng-deep .loro-summary-bar__action loro-button,:host ::ng-deep .loro-summary-bar__action loro-button .loro-button{width:100%}.loro-summary-bar__action small{min-width:0;max-width:100%;overflow-wrap:anywhere;text-align:center}@media(max-width:1023.88px){.loro-summary-bar{grid-template-columns:minmax(0,.84fr) minmax(0,1.16fr);grid-template-areas:\"total flow\" \"total action\";align-items:center;gap:.55rem .8rem;min-height:0;padding:.85rem .95rem;border-radius:1.15rem}.loro-summary-bar__total{grid-area:total;grid-template-columns:1fr;align-content:center;justify-items:start;gap:.36rem;min-width:0;height:100%;padding-right:.65rem;border-right:1px solid var(--loro-border-subtle)}.loro-summary-bar__total loro-button{grid-row:auto;grid-column:auto;width:100%;max-width:9.6rem;--loro-summary-button-min-height: 2.2rem;--loro-summary-button-padding: .48rem .6rem;--loro-summary-button-font-size: .82rem}.loro-summary-bar__flow{grid-area:flow;display:inline-grid;justify-self:center;width:100%;max-width:10.75rem;gap:.32rem;padding-inline:0;border-left:0}.loro-summary-bar__flow loro-image:first-child{width:4.35rem}.loro-summary-bar__flow loro-image:last-child{width:3.85rem}.loro-summary-bar__action{grid-area:action;justify-items:stretch;gap:.28rem;min-width:0;width:100%}.loro-summary-bar__action loro-button{display:block;width:100%;min-width:0;--loro-summary-button-min-height: 2.35rem;--loro-summary-button-padding: .5rem .55rem;--loro-summary-button-font-size: .82rem}small{font-size:.82rem}strong{font-size:clamp(1.45rem,5.6vw,1.9rem)}}@media(max-width:640px){.loro-summary-bar{grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr);gap:.48rem .62rem;padding:.78rem .82rem}.loro-summary-bar__total loro-button{max-width:8.9rem;--loro-summary-button-min-height: 2.1rem;--loro-summary-button-padding: .44rem .52rem;--loro-summary-button-font-size: .74rem}.loro-summary-bar__flow loro-image:first-child{width:3.45rem}.loro-summary-bar__flow loro-image:last-child{width:3.2rem}.loro-summary-bar__flow{max-width:8.45rem;gap:.2rem}.loro-summary-bar__flow loro-icon{transform:scale(.78)}.loro-summary-bar__action loro-button{--loro-summary-button-min-height: 2.2rem;--loro-summary-button-padding: .48rem .44rem;--loro-summary-button-font-size: .74rem}small{font-size:.72rem}strong{font-size:clamp(1.28rem,7vw,1.6rem)}}@media(max-width:430px){.loro-summary-bar{grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr);padding:.72rem}.loro-summary-bar__total{padding-right:.5rem}.loro-summary-bar__total loro-button{max-width:7.8rem;--loro-summary-button-font-size: .68rem}.loro-summary-bar__action loro-button{--loro-summary-button-font-size: .68rem}.loro-summary-bar__flow{max-width:7.6rem}.loro-summary-bar__flow loro-image:first-child{width:3rem}.loro-summary-bar__flow loro-image:last-child{width:2.85rem}}\n"] }]
|
|
1564
|
+
}], propDecorators: { totalLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalLabel", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], primaryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryLabel", required: false }] }], secondaryLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryLabel", required: false }] }], helper: [{ type: i0.Input, args: [{ isSignal: true, alias: "helper", required: false }] }], leftImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "leftImage", required: false }] }], rightImage: [{ type: i0.Input, args: [{ isSignal: true, alias: "rightImage", required: false }] }], primaryDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "primaryDisabled", required: false }] }], secondaryDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "secondaryDisabled", required: false }] }], primaryAction: [{ type: i0.Output, args: ["primaryAction"] }], secondaryAction: [{ type: i0.Output, args: ["secondaryAction"] }] } });
|
|
1565
|
+
|
|
1566
|
+
class LoroTab {
|
|
1567
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
1568
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1569
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1570
|
+
align = input('flex', ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
1571
|
+
iconSize = input(18, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1572
|
+
change = output();
|
|
1573
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1574
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroTab, isStandalone: true, selector: "loro-tab", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { properties: { "style.--loro-tab-count": "options().length" } }, ngImport: i0, template: `
|
|
1575
|
+
<div
|
|
1576
|
+
class="loro-tab"
|
|
1577
|
+
role="tablist"
|
|
1578
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
1579
|
+
[class.loro-tab--block]="align() === 'block'"
|
|
1580
|
+
>
|
|
1581
|
+
@for (option of options(); track option.value) {
|
|
1582
|
+
<button
|
|
1583
|
+
type="button"
|
|
1584
|
+
role="tab"
|
|
1585
|
+
class="loro-tab__button"
|
|
1586
|
+
[class.loro-tab__button--active]="value() === option.value"
|
|
1587
|
+
[attr.aria-selected]="value() === option.value"
|
|
1588
|
+
[attr.aria-label]="option.ariaLabel || option.label"
|
|
1589
|
+
(click)="change.emit(option.value)"
|
|
1590
|
+
>
|
|
1591
|
+
@if (option.icon) {
|
|
1592
|
+
<loro-icon
|
|
1593
|
+
[name]="option.icon"
|
|
1594
|
+
[size]="iconSize()"
|
|
1595
|
+
[alt]="option.label"
|
|
1596
|
+
[decorative]="true"
|
|
1597
|
+
[color]="value() === option.value ? 'primary' : 'muted'"
|
|
1598
|
+
/>
|
|
1599
|
+
}
|
|
1600
|
+
<span>{{ option.label }}</span>
|
|
1601
|
+
</button>
|
|
1602
|
+
}
|
|
1603
|
+
</div>
|
|
1604
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-tab{display:grid;grid-template-columns:repeat(var(--loro-tab-count, 2),minmax(0,1fr));min-height:var(--loro-tab-min-height, 2.8rem);overflow:hidden;border-bottom:1px solid var(--loro-border-subtle);background:transparent}.loro-tab__button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-width:0;min-height:100%;padding:var(--loro-tab-button-padding, .58rem .95rem .72rem);border:0;border-bottom:2px solid transparent;color:var(--loro-muted-strong);font:inherit;font-size:var(--loro-tab-font-size, .95rem);font-weight:900;line-height:var(--loro-tab-line-height, 1.15);background:transparent;cursor:pointer;transition:color .14s ease,border-color .14s ease,background .14s ease}.loro-tab--block .loro-tab__button{flex-direction:column;gap:.35rem}.loro-tab__button--active{border-bottom-color:var(--loro-primary-500);color:var(--loro-primary-500)}.loro-tab__button:hover{background:color-mix(in srgb,var(--loro-primary-500) 4%,transparent)}.loro-tab__button:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-primary-500) 28%,transparent);outline-offset:-2px;border-radius:.35rem}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1605
|
+
}
|
|
1606
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroTab, decorators: [{
|
|
1607
|
+
type: Component,
|
|
1608
|
+
args: [{ selector: 'loro-tab', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1609
|
+
<div
|
|
1610
|
+
class="loro-tab"
|
|
1611
|
+
role="tablist"
|
|
1612
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
1613
|
+
[class.loro-tab--block]="align() === 'block'"
|
|
1614
|
+
>
|
|
1615
|
+
@for (option of options(); track option.value) {
|
|
1616
|
+
<button
|
|
1617
|
+
type="button"
|
|
1618
|
+
role="tab"
|
|
1619
|
+
class="loro-tab__button"
|
|
1620
|
+
[class.loro-tab__button--active]="value() === option.value"
|
|
1621
|
+
[attr.aria-selected]="value() === option.value"
|
|
1622
|
+
[attr.aria-label]="option.ariaLabel || option.label"
|
|
1623
|
+
(click)="change.emit(option.value)"
|
|
1624
|
+
>
|
|
1625
|
+
@if (option.icon) {
|
|
1626
|
+
<loro-icon
|
|
1627
|
+
[name]="option.icon"
|
|
1628
|
+
[size]="iconSize()"
|
|
1629
|
+
[alt]="option.label"
|
|
1630
|
+
[decorative]="true"
|
|
1631
|
+
[color]="value() === option.value ? 'primary' : 'muted'"
|
|
1632
|
+
/>
|
|
1633
|
+
}
|
|
1634
|
+
<span>{{ option.label }}</span>
|
|
1635
|
+
</button>
|
|
1636
|
+
}
|
|
1637
|
+
</div>
|
|
1638
|
+
`, host: {
|
|
1639
|
+
'[style.--loro-tab-count]': 'options().length',
|
|
1640
|
+
}, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-tab{display:grid;grid-template-columns:repeat(var(--loro-tab-count, 2),minmax(0,1fr));min-height:var(--loro-tab-min-height, 2.8rem);overflow:hidden;border-bottom:1px solid var(--loro-border-subtle);background:transparent}.loro-tab__button{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-width:0;min-height:100%;padding:var(--loro-tab-button-padding, .58rem .95rem .72rem);border:0;border-bottom:2px solid transparent;color:var(--loro-muted-strong);font:inherit;font-size:var(--loro-tab-font-size, .95rem);font-weight:900;line-height:var(--loro-tab-line-height, 1.15);background:transparent;cursor:pointer;transition:color .14s ease,border-color .14s ease,background .14s ease}.loro-tab--block .loro-tab__button{flex-direction:column;gap:.35rem}.loro-tab__button--active{border-bottom-color:var(--loro-primary-500);color:var(--loro-primary-500)}.loro-tab__button:hover{background:color-mix(in srgb,var(--loro-primary-500) 4%,transparent)}.loro-tab__button:focus-visible{outline:3px solid color-mix(in srgb,var(--loro-primary-500) 28%,transparent);outline-offset:-2px;border-radius:.35rem}\n"] }]
|
|
1641
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], change: [{ type: i0.Output, args: ["change"] }] } });
|
|
1642
|
+
|
|
1643
|
+
class LoroAlert {
|
|
1644
|
+
/** Visible heading. Keep it short and specific. */
|
|
1645
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1646
|
+
/** Plain text body for common inline alerts. Rich content can still be projected. */
|
|
1647
|
+
message = input('', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1648
|
+
/** Semantic visual treatment. Meaning must never depend on colour alone. */
|
|
1649
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
1650
|
+
/** Controls live-region behaviour for dynamically inserted messages. */
|
|
1651
|
+
announcement = input('auto', ...(ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []));
|
|
1652
|
+
/** Allows programmatic focus without adding the alert to the Tab order. */
|
|
1653
|
+
focusable = input(false, ...(ngDevMode ? [{ debugName: "focusable" }] : /* istanbul ignore next */ []));
|
|
1654
|
+
/** Shows the built-in action button when a label is supplied. */
|
|
1655
|
+
actionLabel = input('', ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
1656
|
+
/** Shows a close button and emits dismissed when activated. */
|
|
1657
|
+
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
1658
|
+
/** Accessible name for the icon-only close button. */
|
|
1659
|
+
dismissLabel = input('Cerrar aviso', ...(ngDevMode ? [{ debugName: "dismissLabel" }] : /* istanbul ignore next */ []));
|
|
1660
|
+
/** Emitted by the built-in action button. */
|
|
1661
|
+
action = output();
|
|
1662
|
+
/** Emitted by the close button. The parent decides whether to remove the alert. */
|
|
1663
|
+
dismissed = output();
|
|
1664
|
+
resolvedIcon = computed(() => {
|
|
1665
|
+
switch (this.variant()) {
|
|
1666
|
+
case 'success':
|
|
1667
|
+
return 'tick-circle';
|
|
1668
|
+
case 'warning':
|
|
1669
|
+
case 'error':
|
|
1670
|
+
return 'shield-alert';
|
|
1671
|
+
case 'neutral':
|
|
1672
|
+
case 'info':
|
|
1673
|
+
default:
|
|
1674
|
+
return 'info';
|
|
1675
|
+
}
|
|
1676
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []));
|
|
1677
|
+
resolvedIconColor = computed(() => this.variant() === 'error' ? 'danger' : 'currentColor', ...(ngDevMode ? [{ debugName: "resolvedIconColor" }] : /* istanbul ignore next */ []));
|
|
1678
|
+
role = computed(() => {
|
|
1679
|
+
const announcement = this.resolvedAnnouncement();
|
|
1680
|
+
if (announcement === 'off') {
|
|
1681
|
+
return null;
|
|
1682
|
+
}
|
|
1683
|
+
return announcement === 'assertive'
|
|
1684
|
+
? 'alert'
|
|
1685
|
+
: 'status';
|
|
1686
|
+
}, ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
|
|
1687
|
+
ariaLive = computed(() => {
|
|
1688
|
+
const announcement = this.resolvedAnnouncement();
|
|
1689
|
+
return announcement === 'off'
|
|
1690
|
+
? null
|
|
1691
|
+
: announcement;
|
|
1692
|
+
}, ...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
|
|
1693
|
+
resolvedAnnouncement = computed(() => {
|
|
1694
|
+
const announcement = this.announcement();
|
|
1695
|
+
if (announcement !== 'auto') {
|
|
1696
|
+
return announcement;
|
|
1697
|
+
}
|
|
1698
|
+
return this.variant() === 'error'
|
|
1699
|
+
? 'assertive'
|
|
1700
|
+
: 'polite';
|
|
1701
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedAnnouncement" }] : /* istanbul ignore next */ []));
|
|
1702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAlert, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1703
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAlert, isStandalone: true, selector: "loro-alert", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, announcement: { classPropertyName: "announcement", publicName: "announcement", isSignal: true, isRequired: false, transformFunction: null }, focusable: { classPropertyName: "focusable", publicName: "focusable", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, dismissLabel: { classPropertyName: "dismissLabel", publicName: "dismissLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action", dismissed: "dismissed" }, host: { properties: { "attr.role": "role()", "attr.aria-live": "ariaLive()", "attr.aria-atomic": "ariaLive() ? \"true\" : null", "attr.tabindex": "focusable() ? -1 : null", "class.loro-alert--focusable": "focusable()", "attr.data-variant": "variant()" } }, ngImport: i0, template: "<aside\n class=\"loro-alert\"\n [class]=\"'loro-alert loro-alert--' + variant()\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"loro-alert__icon\" aria-hidden=\"true\">\n <loro-icon\n [name]=\"resolvedIcon()\"\n [size]=\"20\"\n [alt]=\"''\"\n [color]=\"resolvedIconColor()\"\n />\n </span>\n\n <div class=\"loro-alert__content\">\n @if (title()) {\n <strong class=\"loro-alert__title\">{{ title() }}</strong>\n }\n\n <div class=\"loro-alert__message\">\n @if (message()) {\n <p>{{ message() }}</p>\n }\n <ng-content />\n </div>\n\n @if (actionLabel()) {\n <div class=\"loro-alert__actions\">\n <button\n type=\"button\"\n class=\"loro-alert__action\"\n (click)=\"action.emit()\"\n >\n {{ actionLabel() }}\n </button>\n </div>\n }\n\n <ng-content select=\"[loroAlertActions]\" />\n </div>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"loro-alert__dismiss\"\n [attr.aria-label]=\"dismissLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <loro-icon\n class=\"loro-alert__dismiss-icon\"\n name=\"plus\"\n [size]=\"20\"\n [alt]=\"''\"\n [color]=\"'currentColor'\"\n aria-hidden=\"true\"\n />\n </button>\n }\n</aside>\n", styles: [":host{display:block;min-width:0;font-family:var(--loro-font-brand, system-ui, sans-serif)}.loro-alert{--alert-background: color-mix(in srgb, var(--loro-primary-500) 8%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-primary-500) 28%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 92%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-primary-500) 34%, transparent);--alert-hover: color-mix(in srgb, var(--alert-border) 12%, var(--loro-surface));position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:.625rem;width:100%;min-width:0;padding:.5rem;overflow-wrap:anywhere;border:1px solid var(--alert-border);border-radius:.75rem;background:var(--alert-background);color:var(--alert-foreground)}.loro-alert__accent{position:absolute;inset-block:.5rem;inset-inline-start:0;width:.25rem;border-radius:0 999px 999px 0;background:currentColor}.loro-alert__icon{display:inline-grid;width:1.5rem;min-width:1.5rem;height:1.5rem;place-items:center;margin-block-start:.0625rem;color:currentColor}.loro-alert__content{display:grid;min-width:0;gap:.25rem}.loro-alert__title{display:block;margin:0;color:var(--alert-title);font-size:1rem;font-weight:800;line-height:1.3}.loro-alert__message{min-width:0;color:var(--alert-message);font-size:1rem;font-weight:500;line-height:1.45}.loro-alert__message :where(p){margin:0}.loro-alert__message :where(a){color:currentColor;font-weight:700;text-decoration-thickness:.125em;text-underline-offset:.16em}.loro-alert__actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-block-start:.5rem}.loro-alert__action,.loro-alert__dismiss{appearance:none;border:1px solid currentColor;background:transparent;color:currentColor;font:inherit;font-weight:700;cursor:pointer}.loro-alert__action{min-height:2.5rem;padding:.5rem .875rem;border-radius:.5rem}.loro-alert__dismiss{display:inline-grid;width:2.5rem;height:2.5rem;place-items:center;margin:-.5rem -.5rem -.5rem 0;padding:0;border-color:transparent;border-radius:999px}.loro-alert__dismiss-icon{transform:rotate(45deg)}.loro-alert__action:hover,.loro-alert__dismiss:hover{background:var(--alert-hover)}.loro-alert__action:focus-visible,.loro-alert__dismiss:focus-visible,.loro-alert__message :where(a):focus-visible{outline:3px solid var(--alert-focus);outline-offset:3px}.loro-alert--neutral{--alert-background: color-mix(in srgb, var(--loro-surface-muted) 72%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-muted) 34%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 82%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-muted-strong) 36%, transparent)}.loro-alert--info{--alert-background: color-mix(in srgb, var(--loro-primary-500) 8%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-primary-500) 30%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 88%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-primary-500) 34%, transparent)}.loro-alert--success{--alert-background: color-mix(in srgb, #16a34a 10%, var(--loro-surface));--alert-border: color-mix(in srgb, #16a34a 34%, transparent);--alert-foreground: #166534;--alert-title: color-mix(in srgb, #166534 80%, var(--loro-text-strong));--alert-message: color-mix(in srgb, #166534 72%, var(--loro-text));--alert-focus: color-mix(in srgb, #16a34a 34%, transparent)}.loro-alert--warning{--alert-background: color-mix(in srgb, #f59e0b 11%, var(--loro-surface));--alert-border: color-mix(in srgb, #d97706 34%, transparent);--alert-foreground: #92400e;--alert-title: color-mix(in srgb, #78350f 82%, var(--loro-text-strong));--alert-message: color-mix(in srgb, #78350f 76%, var(--loro-text));--alert-focus: color-mix(in srgb, #d97706 34%, transparent)}.loro-alert--error{--alert-background: color-mix(in srgb, var(--loro-danger-surface) 82%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-danger-text) 62%, transparent);--alert-foreground: var(--loro-danger-text);--alert-title: color-mix(in srgb, var(--loro-danger-text) 86%, var(--loro-text-strong));--alert-message: color-mix(in srgb, var(--loro-danger-text) 78%, var(--loro-text));--alert-focus: color-mix(in srgb, var(--loro-danger-text) 34%, transparent)}html[data-theme=dark] .loro-alert{--alert-hover: color-mix(in srgb, var(--alert-border) 14%, var(--loro-surface-elevated))}html[data-theme=dark] .loro-alert--error{--alert-background: color-mix(in srgb, var(--loro-danger-surface) 58%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-danger-text) 42%, var(--loro-border-subtle));--alert-title: #ffd7d7;--alert-message: color-mix(in srgb, var(--loro-danger-text) 58%, var(--loro-text))}@media(forced-colors:active){.loro-alert{border-color:CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:auto}.loro-alert__accent{background:CanvasText}.loro-alert__action,.loro-alert__dismiss{border-color:ButtonText;color:ButtonText}}@media(prefers-reduced-motion:reduce){.loro-alert *,.loro-alert *:before,.loro-alert *:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1704
|
+
}
|
|
1705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAlert, decorators: [{
|
|
1706
|
+
type: Component,
|
|
1707
|
+
args: [{ selector: 'loro-alert', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1708
|
+
'[attr.role]': 'role()',
|
|
1709
|
+
'[attr.aria-live]': 'ariaLive()',
|
|
1710
|
+
'[attr.aria-atomic]': 'ariaLive() ? "true" : null',
|
|
1711
|
+
'[attr.tabindex]': 'focusable() ? -1 : null',
|
|
1712
|
+
'[class.loro-alert--focusable]': 'focusable()',
|
|
1713
|
+
'[attr.data-variant]': 'variant()',
|
|
1714
|
+
}, template: "<aside\n class=\"loro-alert\"\n [class]=\"'loro-alert loro-alert--' + variant()\"\n [attr.role]=\"role()\"\n [attr.aria-live]=\"ariaLive()\"\n [attr.aria-atomic]=\"role() ? 'true' : null\"\n>\n <span class=\"loro-alert__icon\" aria-hidden=\"true\">\n <loro-icon\n [name]=\"resolvedIcon()\"\n [size]=\"20\"\n [alt]=\"''\"\n [color]=\"resolvedIconColor()\"\n />\n </span>\n\n <div class=\"loro-alert__content\">\n @if (title()) {\n <strong class=\"loro-alert__title\">{{ title() }}</strong>\n }\n\n <div class=\"loro-alert__message\">\n @if (message()) {\n <p>{{ message() }}</p>\n }\n <ng-content />\n </div>\n\n @if (actionLabel()) {\n <div class=\"loro-alert__actions\">\n <button\n type=\"button\"\n class=\"loro-alert__action\"\n (click)=\"action.emit()\"\n >\n {{ actionLabel() }}\n </button>\n </div>\n }\n\n <ng-content select=\"[loroAlertActions]\" />\n </div>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"loro-alert__dismiss\"\n [attr.aria-label]=\"dismissLabel()\"\n (click)=\"dismissed.emit()\"\n >\n <loro-icon\n class=\"loro-alert__dismiss-icon\"\n name=\"plus\"\n [size]=\"20\"\n [alt]=\"''\"\n [color]=\"'currentColor'\"\n aria-hidden=\"true\"\n />\n </button>\n }\n</aside>\n", styles: [":host{display:block;min-width:0;font-family:var(--loro-font-brand, system-ui, sans-serif)}.loro-alert{--alert-background: color-mix(in srgb, var(--loro-primary-500) 8%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-primary-500) 28%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 92%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-primary-500) 34%, transparent);--alert-hover: color-mix(in srgb, var(--alert-border) 12%, var(--loro-surface));position:relative;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:.625rem;width:100%;min-width:0;padding:.5rem;overflow-wrap:anywhere;border:1px solid var(--alert-border);border-radius:.75rem;background:var(--alert-background);color:var(--alert-foreground)}.loro-alert__accent{position:absolute;inset-block:.5rem;inset-inline-start:0;width:.25rem;border-radius:0 999px 999px 0;background:currentColor}.loro-alert__icon{display:inline-grid;width:1.5rem;min-width:1.5rem;height:1.5rem;place-items:center;margin-block-start:.0625rem;color:currentColor}.loro-alert__content{display:grid;min-width:0;gap:.25rem}.loro-alert__title{display:block;margin:0;color:var(--alert-title);font-size:1rem;font-weight:800;line-height:1.3}.loro-alert__message{min-width:0;color:var(--alert-message);font-size:1rem;font-weight:500;line-height:1.45}.loro-alert__message :where(p){margin:0}.loro-alert__message :where(a){color:currentColor;font-weight:700;text-decoration-thickness:.125em;text-underline-offset:.16em}.loro-alert__actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-block-start:.5rem}.loro-alert__action,.loro-alert__dismiss{appearance:none;border:1px solid currentColor;background:transparent;color:currentColor;font:inherit;font-weight:700;cursor:pointer}.loro-alert__action{min-height:2.5rem;padding:.5rem .875rem;border-radius:.5rem}.loro-alert__dismiss{display:inline-grid;width:2.5rem;height:2.5rem;place-items:center;margin:-.5rem -.5rem -.5rem 0;padding:0;border-color:transparent;border-radius:999px}.loro-alert__dismiss-icon{transform:rotate(45deg)}.loro-alert__action:hover,.loro-alert__dismiss:hover{background:var(--alert-hover)}.loro-alert__action:focus-visible,.loro-alert__dismiss:focus-visible,.loro-alert__message :where(a):focus-visible{outline:3px solid var(--alert-focus);outline-offset:3px}.loro-alert--neutral{--alert-background: color-mix(in srgb, var(--loro-surface-muted) 72%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-muted) 34%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 82%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-muted-strong) 36%, transparent)}.loro-alert--info{--alert-background: color-mix(in srgb, var(--loro-primary-500) 8%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-primary-500) 30%, transparent);--alert-foreground: var(--loro-text);--alert-title: var(--loro-text-strong);--alert-message: color-mix(in srgb, var(--loro-text) 88%, var(--loro-muted));--alert-focus: color-mix(in srgb, var(--loro-primary-500) 34%, transparent)}.loro-alert--success{--alert-background: color-mix(in srgb, #16a34a 10%, var(--loro-surface));--alert-border: color-mix(in srgb, #16a34a 34%, transparent);--alert-foreground: #166534;--alert-title: color-mix(in srgb, #166534 80%, var(--loro-text-strong));--alert-message: color-mix(in srgb, #166534 72%, var(--loro-text));--alert-focus: color-mix(in srgb, #16a34a 34%, transparent)}.loro-alert--warning{--alert-background: color-mix(in srgb, #f59e0b 11%, var(--loro-surface));--alert-border: color-mix(in srgb, #d97706 34%, transparent);--alert-foreground: #92400e;--alert-title: color-mix(in srgb, #78350f 82%, var(--loro-text-strong));--alert-message: color-mix(in srgb, #78350f 76%, var(--loro-text));--alert-focus: color-mix(in srgb, #d97706 34%, transparent)}.loro-alert--error{--alert-background: color-mix(in srgb, var(--loro-danger-surface) 82%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-danger-text) 62%, transparent);--alert-foreground: var(--loro-danger-text);--alert-title: color-mix(in srgb, var(--loro-danger-text) 86%, var(--loro-text-strong));--alert-message: color-mix(in srgb, var(--loro-danger-text) 78%, var(--loro-text));--alert-focus: color-mix(in srgb, var(--loro-danger-text) 34%, transparent)}html[data-theme=dark] .loro-alert{--alert-hover: color-mix(in srgb, var(--alert-border) 14%, var(--loro-surface-elevated))}html[data-theme=dark] .loro-alert--error{--alert-background: color-mix(in srgb, var(--loro-danger-surface) 58%, var(--loro-surface));--alert-border: color-mix(in srgb, var(--loro-danger-text) 42%, var(--loro-border-subtle));--alert-title: #ffd7d7;--alert-message: color-mix(in srgb, var(--loro-danger-text) 58%, var(--loro-text))}@media(forced-colors:active){.loro-alert{border-color:CanvasText;background:Canvas;color:CanvasText;forced-color-adjust:auto}.loro-alert__accent{background:CanvasText}.loro-alert__action,.loro-alert__dismiss{border-color:ButtonText;color:ButtonText}}@media(prefers-reduced-motion:reduce){.loro-alert *,.loro-alert *:before,.loro-alert *:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}\n"] }]
|
|
1715
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], announcement: [{ type: i0.Input, args: [{ isSignal: true, alias: "announcement", required: false }] }], focusable: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusable", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], dismissLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissLabel", required: false }] }], action: [{ type: i0.Output, args: ["action"] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }] } });
|
|
1716
|
+
|
|
1717
|
+
class LoroNotification {
|
|
1718
|
+
count = input(0, ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
|
|
1719
|
+
maxCount = input(9, ...(ngDevMode ? [{ debugName: "maxCount" }] : /* istanbul ignore next */ []));
|
|
1720
|
+
showZero = input(false, ...(ngDevMode ? [{ debugName: "showZero" }] : /* istanbul ignore next */ []));
|
|
1721
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
1722
|
+
expanded = input(null, ...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
1723
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1724
|
+
ariaLabel = input('Notifications', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1725
|
+
iconSize = input(25, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
1726
|
+
notificationClick = output();
|
|
1727
|
+
showBadge = computed(() => this.count() > 0 || this.showZero(), ...(ngDevMode ? [{ debugName: "showBadge" }] : /* istanbul ignore next */ []));
|
|
1728
|
+
badgeLabel = computed(() => {
|
|
1729
|
+
const count = Math.max(0, this.count());
|
|
1730
|
+
const maxCount = Math.max(1, this.maxCount());
|
|
1731
|
+
return count > maxCount ? `${maxCount}+` : count.toString();
|
|
1732
|
+
}, ...(ngDevMode ? [{ debugName: "badgeLabel" }] : /* istanbul ignore next */ []));
|
|
1733
|
+
badgeAriaLabel = computed(() => `${this.badgeLabel()} unread notifications`, ...(ngDevMode ? [{ debugName: "badgeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1734
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotification, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1735
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroNotification, isStandalone: true, selector: "loro-notification", inputs: { count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: false, transformFunction: null }, maxCount: { classPropertyName: "maxCount", publicName: "maxCount", isSignal: true, isRequired: false, transformFunction: null }, showZero: { classPropertyName: "showZero", publicName: "showZero", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { notificationClick: "notificationClick" }, ngImport: i0, template: `
|
|
1736
|
+
<button
|
|
1737
|
+
type="button"
|
|
1738
|
+
class="loro-notification"
|
|
1739
|
+
[class.loro-notification--active]="active()"
|
|
1740
|
+
[class.loro-notification--disabled]="disabled()"
|
|
1741
|
+
[disabled]="disabled()"
|
|
1742
|
+
[attr.aria-label]="ariaLabel()"
|
|
1743
|
+
[attr.aria-expanded]="expanded()"
|
|
1744
|
+
(click)="notificationClick.emit()">
|
|
1745
|
+
<loro-icon name="bell" [size]="iconSize()" alt="" [decorative]="true" color="primary" />
|
|
1746
|
+
@if (showBadge()) {
|
|
1747
|
+
<span class="loro-notification__badge" [attr.aria-label]="badgeAriaLabel()">
|
|
1748
|
+
{{ badgeLabel() }}
|
|
1749
|
+
</span>
|
|
1750
|
+
}
|
|
1751
|
+
</button>
|
|
1752
|
+
`, isInline: true, styles: [":host{display:inline-flex;font-family:var(--loro-font-brand)}.loro-notification{position:relative;display:grid;width:var(--loro-notification-size, 2.75rem);height:var(--loro-notification-size, 2.75rem);place-items:center;border:0;border-radius:50%;background:transparent;color:var(--loro-primary-700);cursor:pointer;transition:background .15s ease,transform .15s ease;-webkit-tap-highlight-color:transparent}.loro-notification:hover,.loro-notification--active{background:transparent}.loro-notification:focus-visible{outline:2px solid rgba(108,60,255,.35);outline-offset:2px}.loro-notification:active{transform:scale(.97)}.loro-notification--disabled{cursor:not-allowed;opacity:.55;transform:none}.loro-notification__badge{position:absolute;top:.18rem;right:.1rem;display:grid;min-width:1.15rem;height:1.15rem;place-items:center;padding-inline:.25rem;border:2px solid var(--loro-surface);border-radius:999px;background:var(--loro-primary-500);color:#fff;font-size:.68rem;font-weight:950;line-height:1;box-sizing:border-box}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1753
|
+
}
|
|
1754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotification, decorators: [{
|
|
1755
|
+
type: Component,
|
|
1756
|
+
args: [{ selector: 'loro-notification', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1757
|
+
<button
|
|
1758
|
+
type="button"
|
|
1759
|
+
class="loro-notification"
|
|
1760
|
+
[class.loro-notification--active]="active()"
|
|
1761
|
+
[class.loro-notification--disabled]="disabled()"
|
|
1762
|
+
[disabled]="disabled()"
|
|
1763
|
+
[attr.aria-label]="ariaLabel()"
|
|
1764
|
+
[attr.aria-expanded]="expanded()"
|
|
1765
|
+
(click)="notificationClick.emit()">
|
|
1766
|
+
<loro-icon name="bell" [size]="iconSize()" alt="" [decorative]="true" color="primary" />
|
|
1767
|
+
@if (showBadge()) {
|
|
1768
|
+
<span class="loro-notification__badge" [attr.aria-label]="badgeAriaLabel()">
|
|
1769
|
+
{{ badgeLabel() }}
|
|
1770
|
+
</span>
|
|
1771
|
+
}
|
|
1772
|
+
</button>
|
|
1773
|
+
`, styles: [":host{display:inline-flex;font-family:var(--loro-font-brand)}.loro-notification{position:relative;display:grid;width:var(--loro-notification-size, 2.75rem);height:var(--loro-notification-size, 2.75rem);place-items:center;border:0;border-radius:50%;background:transparent;color:var(--loro-primary-700);cursor:pointer;transition:background .15s ease,transform .15s ease;-webkit-tap-highlight-color:transparent}.loro-notification:hover,.loro-notification--active{background:transparent}.loro-notification:focus-visible{outline:2px solid rgba(108,60,255,.35);outline-offset:2px}.loro-notification:active{transform:scale(.97)}.loro-notification--disabled{cursor:not-allowed;opacity:.55;transform:none}.loro-notification__badge{position:absolute;top:.18rem;right:.1rem;display:grid;min-width:1.15rem;height:1.15rem;place-items:center;padding-inline:.25rem;border:2px solid var(--loro-surface);border-radius:999px;background:var(--loro-primary-500);color:#fff;font-size:.68rem;font-weight:950;line-height:1;box-sizing:border-box}\n"] }]
|
|
1774
|
+
}], propDecorators: { count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: false }] }], maxCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxCount", required: false }] }], showZero: [{ type: i0.Input, args: [{ isSignal: true, alias: "showZero", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], notificationClick: [{ type: i0.Output, args: ["notificationClick"] }] } });
|
|
1775
|
+
|
|
1776
|
+
class LoroNotificationPanel {
|
|
1777
|
+
title = input('Notifications', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1778
|
+
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
1779
|
+
presentation = input('dropdown', ...(ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []));
|
|
1780
|
+
showMarkAll = input(true, ...(ngDevMode ? [{ debugName: "showMarkAll" }] : /* istanbul ignore next */ []));
|
|
1781
|
+
markAllLabel = input('Mark all as read', ...(ngDevMode ? [{ debugName: "markAllLabel" }] : /* istanbul ignore next */ []));
|
|
1782
|
+
showClearAll = input(true, ...(ngDevMode ? [{ debugName: "showClearAll" }] : /* istanbul ignore next */ []));
|
|
1783
|
+
clearAllLabel = input('Delete notifications', ...(ngDevMode ? [{ debugName: "clearAllLabel" }] : /* istanbul ignore next */ []));
|
|
1784
|
+
emptyIcon = input('bell', ...(ngDevMode ? [{ debugName: "emptyIcon" }] : /* istanbul ignore next */ []));
|
|
1785
|
+
emptyTitle = input('No new notifications', ...(ngDevMode ? [{ debugName: "emptyTitle" }] : /* istanbul ignore next */ []));
|
|
1786
|
+
emptyMessage = input('When there is something new, it will appear here.', ...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
1787
|
+
itemClick = output();
|
|
1788
|
+
itemRemove = output();
|
|
1789
|
+
markAllRead = output();
|
|
1790
|
+
clearAll = output();
|
|
1791
|
+
hasUnread = computed(() => this.items().some((item) => !!item.unread), ...(ngDevMode ? [{ debugName: "hasUnread" }] : /* istanbul ignore next */ []));
|
|
1792
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotificationPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1793
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroNotificationPanel, isStandalone: true, selector: "loro-notification-panel", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, showMarkAll: { classPropertyName: "showMarkAll", publicName: "showMarkAll", isSignal: true, isRequired: false, transformFunction: null }, markAllLabel: { classPropertyName: "markAllLabel", publicName: "markAllLabel", isSignal: true, isRequired: false, transformFunction: null }, showClearAll: { classPropertyName: "showClearAll", publicName: "showClearAll", isSignal: true, isRequired: false, transformFunction: null }, clearAllLabel: { classPropertyName: "clearAllLabel", publicName: "clearAllLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyIcon: { classPropertyName: "emptyIcon", publicName: "emptyIcon", isSignal: true, isRequired: false, transformFunction: null }, emptyTitle: { classPropertyName: "emptyTitle", publicName: "emptyTitle", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", itemRemove: "itemRemove", markAllRead: "markAllRead", clearAll: "clearAll" }, ngImport: i0, template: `
|
|
1794
|
+
<section
|
|
1795
|
+
class="loro-notification-panel"
|
|
1796
|
+
[class.loro-notification-panel--sheet]="presentation() === 'sheet'"
|
|
1797
|
+
[class.loro-notification-panel--empty]="items().length === 0">
|
|
1798
|
+
@if (presentation() === 'sheet') {
|
|
1799
|
+
<span class="loro-notification-panel__handle" aria-hidden="true"></span>
|
|
1800
|
+
}
|
|
1801
|
+
<header class="loro-notification-panel__header">
|
|
1802
|
+
<h2>{{ title() }}</h2>
|
|
1803
|
+
@if (items().length > 0) {
|
|
1804
|
+
<div class="loro-notification-panel__actions">
|
|
1805
|
+
@if (showMarkAll() && hasUnread()) {
|
|
1806
|
+
<button type="button" (click)="markAllRead.emit()">{{ markAllLabel() }}</button>
|
|
1807
|
+
} @else if (showClearAll()) {
|
|
1808
|
+
<button type="button" (click)="clearAll.emit()">{{ clearAllLabel() }}</button>
|
|
1809
|
+
}
|
|
1810
|
+
</div>
|
|
1811
|
+
}
|
|
1812
|
+
</header>
|
|
1813
|
+
|
|
1814
|
+
@if (items().length > 0) {
|
|
1815
|
+
<div class="loro-notification-panel__list">
|
|
1816
|
+
@for (item of items(); track item.id) {
|
|
1817
|
+
<loro-notification-row
|
|
1818
|
+
[title]="item.title"
|
|
1819
|
+
[message]="item.message"
|
|
1820
|
+
[time]="item.time || ''"
|
|
1821
|
+
[icon]="item.icon || 'info'"
|
|
1822
|
+
[unread]="!!item.unread"
|
|
1823
|
+
(rowClick)="itemClick.emit(item)"
|
|
1824
|
+
(rowRemove)="itemRemove.emit(item)" />
|
|
1825
|
+
}
|
|
1826
|
+
</div>
|
|
1827
|
+
} @else {
|
|
1828
|
+
<div class="loro-notification-panel__empty">
|
|
1829
|
+
<span class="loro-notification-panel__empty-icon">
|
|
1830
|
+
<loro-icon [name]="emptyIcon()" [size]="64" [alt]="emptyTitle()" color="primary" />
|
|
1831
|
+
</span>
|
|
1832
|
+
<strong>{{ emptyTitle() }}</strong>
|
|
1833
|
+
<p>{{ emptyMessage() }}</p>
|
|
1834
|
+
</div>
|
|
1835
|
+
}
|
|
1836
|
+
</section>
|
|
1837
|
+
`, isInline: true, styles: [":host{display:block;width:min(100%,24rem);min-height:0;font-family:var(--loro-font-brand)}.loro-notification-panel{overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;isolation:isolate;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-panel);color:var(--loro-text)}.loro-notification-panel__handle{display:none}.loro-notification-panel__header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;padding:.9rem 1rem;border-bottom:1px solid var(--loro-border-subtle)}.loro-notification-panel__actions{display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.75rem}h2{margin:0;color:var(--loro-text-strong);font-size:1rem;font-weight:950}button{border:0;background:transparent;color:var(--loro-primary-700);font:inherit;font-size:.82rem;font-weight:850;cursor:pointer}.loro-notification-panel__list{display:grid;align-content:start;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;background:var(--loro-surface)}.loro-notification-panel__empty{display:grid;min-height:18rem;place-items:center;align-content:center;gap:.75rem;padding:2rem;text-align:center;background:var(--loro-surface)}.loro-notification-panel__empty-icon{display:grid;width:6rem;height:6rem;place-items:center;border-radius:50%;background:#6c3cff0f}.loro-notification-panel__empty strong{color:var(--loro-text-strong);font-weight:950}.loro-notification-panel__empty p{max-width:16rem;margin:0;color:var(--loro-muted);font-weight:700;line-height:1.45}@media(min-width:1024px){.loro-notification-panel__list{max-height:min(28rem,60vh)}}@media(max-width:1023.88px){:host{display:grid;width:100%;height:100%;min-height:0}.loro-notification-panel,.loro-notification-panel--sheet{width:100%;height:100%;min-height:0;border-radius:1.15rem 1.15rem 0 0;background:var(--loro-surface)}.loro-notification-panel--sheet{display:grid;min-height:0;grid-template-rows:auto auto minmax(0,1fr)}.loro-notification-panel--sheet .loro-notification-panel__list{min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;background:var(--loro-surface);touch-action:pan-y}.loro-notification-panel--sheet .loro-notification-panel__header{position:sticky;top:0;z-index:2;background:var(--loro-surface);align-items:start;grid-template-columns:minmax(0,1fr);gap:.65rem}.loro-notification-panel--sheet.loro-notification-panel--empty .loro-notification-panel__header{border-bottom:0}.loro-notification-panel--sheet .loro-notification-panel__empty{min-height:0;height:100%;padding:1rem 1.15rem 1.4rem;background:var(--loro-surface)}.loro-notification-panel--sheet .loro-notification-panel__handle{display:block;width:3rem;height:.25rem;margin:.5rem auto .2rem;border-radius:999px;background:#62588259}.loro-notification-panel--sheet .loro-notification-panel__header{padding:.7rem .95rem}.loro-notification-panel__actions{display:flex;width:100%;justify-content:space-between;gap:.5rem}.loro-notification-panel__actions button{white-space:nowrap}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }, { kind: "component", type: LoroNotificationRow$1, selector: "loro-notification-row", inputs: ["title", "message", "time", "icon", "unread"], outputs: ["rowClick", "rowRemove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1838
|
+
}
|
|
1839
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotificationPanel, decorators: [{
|
|
1840
|
+
type: Component,
|
|
1841
|
+
args: [{ selector: 'loro-notification-panel', standalone: true, imports: [LoroIcon$1, LoroNotificationRow$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1842
|
+
<section
|
|
1843
|
+
class="loro-notification-panel"
|
|
1844
|
+
[class.loro-notification-panel--sheet]="presentation() === 'sheet'"
|
|
1845
|
+
[class.loro-notification-panel--empty]="items().length === 0">
|
|
1846
|
+
@if (presentation() === 'sheet') {
|
|
1847
|
+
<span class="loro-notification-panel__handle" aria-hidden="true"></span>
|
|
1848
|
+
}
|
|
1849
|
+
<header class="loro-notification-panel__header">
|
|
1850
|
+
<h2>{{ title() }}</h2>
|
|
1851
|
+
@if (items().length > 0) {
|
|
1852
|
+
<div class="loro-notification-panel__actions">
|
|
1853
|
+
@if (showMarkAll() && hasUnread()) {
|
|
1854
|
+
<button type="button" (click)="markAllRead.emit()">{{ markAllLabel() }}</button>
|
|
1855
|
+
} @else if (showClearAll()) {
|
|
1856
|
+
<button type="button" (click)="clearAll.emit()">{{ clearAllLabel() }}</button>
|
|
1857
|
+
}
|
|
1858
|
+
</div>
|
|
1859
|
+
}
|
|
1860
|
+
</header>
|
|
1861
|
+
|
|
1862
|
+
@if (items().length > 0) {
|
|
1863
|
+
<div class="loro-notification-panel__list">
|
|
1864
|
+
@for (item of items(); track item.id) {
|
|
1865
|
+
<loro-notification-row
|
|
1866
|
+
[title]="item.title"
|
|
1867
|
+
[message]="item.message"
|
|
1868
|
+
[time]="item.time || ''"
|
|
1869
|
+
[icon]="item.icon || 'info'"
|
|
1870
|
+
[unread]="!!item.unread"
|
|
1871
|
+
(rowClick)="itemClick.emit(item)"
|
|
1872
|
+
(rowRemove)="itemRemove.emit(item)" />
|
|
1873
|
+
}
|
|
1874
|
+
</div>
|
|
1875
|
+
} @else {
|
|
1876
|
+
<div class="loro-notification-panel__empty">
|
|
1877
|
+
<span class="loro-notification-panel__empty-icon">
|
|
1878
|
+
<loro-icon [name]="emptyIcon()" [size]="64" [alt]="emptyTitle()" color="primary" />
|
|
1879
|
+
</span>
|
|
1880
|
+
<strong>{{ emptyTitle() }}</strong>
|
|
1881
|
+
<p>{{ emptyMessage() }}</p>
|
|
1882
|
+
</div>
|
|
1883
|
+
}
|
|
1884
|
+
</section>
|
|
1885
|
+
`, styles: [":host{display:block;width:min(100%,24rem);min-height:0;font-family:var(--loro-font-brand)}.loro-notification-panel{overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;height:100%;min-height:0;isolation:isolate;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-panel);color:var(--loro-text)}.loro-notification-panel__handle{display:none}.loro-notification-panel__header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;padding:.9rem 1rem;border-bottom:1px solid var(--loro-border-subtle)}.loro-notification-panel__actions{display:inline-flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:.75rem}h2{margin:0;color:var(--loro-text-strong);font-size:1rem;font-weight:950}button{border:0;background:transparent;color:var(--loro-primary-700);font:inherit;font-size:.82rem;font-weight:850;cursor:pointer}.loro-notification-panel__list{display:grid;align-content:start;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;background:var(--loro-surface)}.loro-notification-panel__empty{display:grid;min-height:18rem;place-items:center;align-content:center;gap:.75rem;padding:2rem;text-align:center;background:var(--loro-surface)}.loro-notification-panel__empty-icon{display:grid;width:6rem;height:6rem;place-items:center;border-radius:50%;background:#6c3cff0f}.loro-notification-panel__empty strong{color:var(--loro-text-strong);font-weight:950}.loro-notification-panel__empty p{max-width:16rem;margin:0;color:var(--loro-muted);font-weight:700;line-height:1.45}@media(min-width:1024px){.loro-notification-panel__list{max-height:min(28rem,60vh)}}@media(max-width:1023.88px){:host{display:grid;width:100%;height:100%;min-height:0}.loro-notification-panel,.loro-notification-panel--sheet{width:100%;height:100%;min-height:0;border-radius:1.15rem 1.15rem 0 0;background:var(--loro-surface)}.loro-notification-panel--sheet{display:grid;min-height:0;grid-template-rows:auto auto minmax(0,1fr)}.loro-notification-panel--sheet .loro-notification-panel__list{min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;background:var(--loro-surface);touch-action:pan-y}.loro-notification-panel--sheet .loro-notification-panel__header{position:sticky;top:0;z-index:2;background:var(--loro-surface);align-items:start;grid-template-columns:minmax(0,1fr);gap:.65rem}.loro-notification-panel--sheet.loro-notification-panel--empty .loro-notification-panel__header{border-bottom:0}.loro-notification-panel--sheet .loro-notification-panel__empty{min-height:0;height:100%;padding:1rem 1.15rem 1.4rem;background:var(--loro-surface)}.loro-notification-panel--sheet .loro-notification-panel__handle{display:block;width:3rem;height:.25rem;margin:.5rem auto .2rem;border-radius:999px;background:#62588259}.loro-notification-panel--sheet .loro-notification-panel__header{padding:.7rem .95rem}.loro-notification-panel__actions{display:flex;width:100%;justify-content:space-between;gap:.5rem}.loro-notification-panel__actions button{white-space:nowrap}}\n"] }]
|
|
1886
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], showMarkAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMarkAll", required: false }] }], markAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "markAllLabel", required: false }] }], showClearAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClearAll", required: false }] }], clearAllLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearAllLabel", required: false }] }], emptyIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyIcon", required: false }] }], emptyTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyTitle", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], itemRemove: [{ type: i0.Output, args: ["itemRemove"] }], markAllRead: [{ type: i0.Output, args: ["markAllRead"] }], clearAll: [{ type: i0.Output, args: ["clearAll"] }] } });
|
|
1887
|
+
|
|
1888
|
+
class LoroNotificationRow {
|
|
1889
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1890
|
+
message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1891
|
+
time = input('', ...(ngDevMode ? [{ debugName: "time" }] : /* istanbul ignore next */ []));
|
|
1892
|
+
icon = input('info', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1893
|
+
unread = input(false, ...(ngDevMode ? [{ debugName: "unread" }] : /* istanbul ignore next */ []));
|
|
1894
|
+
rowClick = output();
|
|
1895
|
+
rowRemove = output();
|
|
1896
|
+
dragX = signal(0, ...(ngDevMode ? [{ debugName: "dragX" }] : /* istanbul ignore next */ []));
|
|
1897
|
+
dragging = signal(false, ...(ngDevMode ? [{ debugName: "dragging" }] : /* istanbul ignore next */ []));
|
|
1898
|
+
armed = signal(false, ...(ngDevMode ? [{ debugName: "armed" }] : /* istanbul ignore next */ []));
|
|
1899
|
+
removing = signal(false, ...(ngDevMode ? [{ debugName: "removing" }] : /* istanbul ignore next */ []));
|
|
1900
|
+
touchStartX = 0;
|
|
1901
|
+
touchStartY = 0;
|
|
1902
|
+
clickSuppressed = false;
|
|
1903
|
+
static REVEAL_PX = 96;
|
|
1904
|
+
static MAX_PX = 164;
|
|
1905
|
+
static DELETE_EXTRA_PX = 44;
|
|
1906
|
+
onTouchStart(event) {
|
|
1907
|
+
const touch = event.touches[0];
|
|
1908
|
+
if (!touch || this.removing()) {
|
|
1909
|
+
return;
|
|
1910
|
+
}
|
|
1911
|
+
this.touchStartX = touch.clientX;
|
|
1912
|
+
this.touchStartY = touch.clientY;
|
|
1913
|
+
this.clickSuppressed = false;
|
|
1914
|
+
this.dragging.set(true);
|
|
1915
|
+
}
|
|
1916
|
+
onTouchMove(event) {
|
|
1917
|
+
const touch = event.touches[0];
|
|
1918
|
+
if (!touch || this.removing()) {
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
const deltaX = touch.clientX - this.touchStartX;
|
|
1922
|
+
const deltaY = touch.clientY - this.touchStartY;
|
|
1923
|
+
if (Math.abs(deltaY) > Math.abs(deltaX) && Math.abs(deltaY) > 8) {
|
|
1924
|
+
this.resetDrag();
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
const nextX = this.armed()
|
|
1928
|
+
? Math.max(-LoroNotificationRow.MAX_PX, Math.min(-LoroNotificationRow.REVEAL_PX, -LoroNotificationRow.REVEAL_PX + deltaX))
|
|
1929
|
+
: Math.min(0, Math.max(deltaX, -LoroNotificationRow.MAX_PX));
|
|
1930
|
+
this.dragX.set(nextX);
|
|
1931
|
+
this.clickSuppressed = nextX < -8;
|
|
1932
|
+
}
|
|
1933
|
+
onTouchEnd() {
|
|
1934
|
+
if (this.removing()) {
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
const offset = this.dragX();
|
|
1938
|
+
this.dragging.set(false);
|
|
1939
|
+
if (this.armed()) {
|
|
1940
|
+
if (offset <= -(LoroNotificationRow.REVEAL_PX + LoroNotificationRow.DELETE_EXTRA_PX)) {
|
|
1941
|
+
this.startRemove();
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
if (offset > -(LoroNotificationRow.REVEAL_PX - 18)) {
|
|
1945
|
+
this.armed.set(false);
|
|
1946
|
+
this.dragX.set(0);
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1949
|
+
this.dragX.set(-LoroNotificationRow.REVEAL_PX);
|
|
1950
|
+
this.clickSuppressed = true;
|
|
1951
|
+
return;
|
|
1952
|
+
}
|
|
1953
|
+
if (offset <= -LoroNotificationRow.REVEAL_PX) {
|
|
1954
|
+
this.armed.set(true);
|
|
1955
|
+
this.dragX.set(-LoroNotificationRow.REVEAL_PX);
|
|
1956
|
+
this.clickSuppressed = true;
|
|
1957
|
+
return;
|
|
1958
|
+
}
|
|
1959
|
+
this.dragX.set(0);
|
|
1960
|
+
}
|
|
1961
|
+
resetDrag() {
|
|
1962
|
+
if (this.removing()) {
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
this.dragging.set(false);
|
|
1966
|
+
this.dragX.set(this.armed() ? -LoroNotificationRow.REVEAL_PX : 0);
|
|
1967
|
+
}
|
|
1968
|
+
onRowClick() {
|
|
1969
|
+
if (this.clickSuppressed || this.removing() || this.armed()) {
|
|
1970
|
+
this.clickSuppressed = false;
|
|
1971
|
+
return;
|
|
1972
|
+
}
|
|
1973
|
+
this.rowClick.emit();
|
|
1974
|
+
}
|
|
1975
|
+
onRowKeydown(event) {
|
|
1976
|
+
event.preventDefault();
|
|
1977
|
+
this.onRowClick();
|
|
1978
|
+
}
|
|
1979
|
+
onDeleteClick(event) {
|
|
1980
|
+
event.preventDefault();
|
|
1981
|
+
event.stopPropagation();
|
|
1982
|
+
this.startRemove();
|
|
1983
|
+
}
|
|
1984
|
+
startRemove() {
|
|
1985
|
+
this.armed.set(false);
|
|
1986
|
+
this.removing.set(true);
|
|
1987
|
+
this.dragX.set(-LoroNotificationRow.MAX_PX);
|
|
1988
|
+
window.setTimeout(() => this.rowRemove.emit(), 180);
|
|
1989
|
+
}
|
|
1990
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotificationRow, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1991
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroNotificationRow, isStandalone: true, selector: "loro-notification-row", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, time: { classPropertyName: "time", publicName: "time", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, unread: { classPropertyName: "unread", publicName: "unread", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rowClick: "rowClick", rowRemove: "rowRemove" }, ngImport: i0, template: `
|
|
1992
|
+
<div
|
|
1993
|
+
class="loro-notification-row-shell"
|
|
1994
|
+
data-horizontal-gesture
|
|
1995
|
+
[class.loro-notification-row-shell--dragging]="dragging()"
|
|
1996
|
+
[class.loro-notification-row-shell--armed]="armed()"
|
|
1997
|
+
[class.loro-notification-row-shell--removing]="removing()"
|
|
1998
|
+
(touchstart)="onTouchStart($event)"
|
|
1999
|
+
(touchmove)="onTouchMove($event)"
|
|
2000
|
+
(touchend)="onTouchEnd()"
|
|
2001
|
+
(touchcancel)="resetDrag()">
|
|
2002
|
+
<span class="loro-notification-row-shell__delete" aria-hidden="true">
|
|
2003
|
+
<loro-icon name="trash-white" [size]="22" alt="" [decorative]="true" color="inverse" />
|
|
2004
|
+
<span>Eliminar</span>
|
|
2005
|
+
</span>
|
|
2006
|
+
<article
|
|
2007
|
+
role="button"
|
|
2008
|
+
tabindex="0"
|
|
2009
|
+
class="loro-notification-row"
|
|
2010
|
+
[class.loro-notification-row--unread]="unread()"
|
|
2011
|
+
[style.transform]="'translate3d(' + dragX() + 'px, 0, 0)'"
|
|
2012
|
+
(click)="onRowClick()"
|
|
2013
|
+
(keydown.enter)="onRowKeydown($event)"
|
|
2014
|
+
(keydown.space)="onRowKeydown($event)">
|
|
2015
|
+
<span class="loro-notification-row__icon">
|
|
2016
|
+
<loro-icon [name]="icon()" [size]="26" [alt]="title()" color="primary" />
|
|
2017
|
+
</span>
|
|
2018
|
+
<span class="loro-notification-row__content">
|
|
2019
|
+
<span class="loro-notification-row__meta">
|
|
2020
|
+
<strong>{{ title() }}</strong>
|
|
2021
|
+
@if (time()) {
|
|
2022
|
+
<small>{{ time() }}</small>
|
|
2023
|
+
}
|
|
2024
|
+
</span>
|
|
2025
|
+
<span class="loro-notification-row__message">{{ message() }}</span>
|
|
2026
|
+
</span>
|
|
2027
|
+
@if (unread()) {
|
|
2028
|
+
<span class="loro-notification-row__dot" aria-label="Unread"></span>
|
|
2029
|
+
}
|
|
2030
|
+
<button
|
|
2031
|
+
type="button"
|
|
2032
|
+
class="loro-notification-row__delete-button"
|
|
2033
|
+
aria-label="Eliminar notificacion"
|
|
2034
|
+
(click)="onDeleteClick($event)">
|
|
2035
|
+
<loro-icon name="trash" [size]="18" alt="" [decorative]="true" color="danger" />
|
|
2036
|
+
</button>
|
|
2037
|
+
</article>
|
|
2038
|
+
</div>
|
|
2039
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-notification-row-shell{position:relative;overflow:hidden;background:transparent;touch-action:pan-y}.loro-notification-row-shell__delete{position:absolute;inset:0 0 0 auto;display:grid;width:8.75rem;align-content:center;justify-items:center;gap:.45rem;background:#ef4444;color:var(--loro-text-inverse);opacity:0;transition:opacity .18s ease,transform .18s ease}.loro-notification-row-shell--dragging .loro-notification-row-shell__delete,.loro-notification-row-shell--armed .loro-notification-row-shell__delete,.loro-notification-row-shell--removing .loro-notification-row-shell__delete{opacity:1}.loro-notification-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:.85rem;width:100%;padding:.82rem .95rem;border:0;border-bottom:1px solid var(--loro-border-subtle);background:var(--loro-surface);color:var(--loro-text);text-align:left;cursor:pointer;will-change:transform;transition:background .15s ease,transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease}.loro-notification-row-shell--dragging .loro-notification-row{transition:background .15s ease}.loro-notification-row-shell--removing .loro-notification-row{opacity:.18;transform:translate3d(-100%,0,0)!important}:host:last-child .loro-notification-row{border-bottom-color:transparent}.loro-notification-row:hover{background:var(--loro-surface)}.loro-notification-row:focus-visible{position:relative;z-index:1;outline:2px solid rgba(108,60,255,.32);outline-offset:-2px}.loro-notification-row__icon{display:grid;width:2.5rem;height:2.5rem;place-items:center;border-radius:.8rem;background:transparent}.loro-notification-row__content{display:grid;gap:.2rem;min-width:0}.loro-notification-row__meta{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:.75rem}strong{overflow:hidden;color:var(--loro-text-strong);font-size:.92rem;font-weight:950;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}small,.loro-notification-row__message{color:var(--loro-muted);font-size:.82rem;font-weight:700;line-height:1.35}.loro-notification-row__dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--loro-primary-500)}.loro-notification-row__delete-button{display:grid;width:2.25rem;height:2.25rem;place-items:center;border:0;border-radius:.7rem;background:color-mix(in srgb,var(--loro-danger-text) 8%,transparent);cursor:pointer;opacity:0;transition:background .15s ease,opacity .15s ease,transform .15s ease}.loro-notification-row:hover .loro-notification-row__delete-button,.loro-notification-row:focus-visible .loro-notification-row__delete-button,.loro-notification-row__delete-button:focus-visible{opacity:1}.loro-notification-row__delete-button:hover,.loro-notification-row__delete-button:focus-visible{background:color-mix(in srgb,var(--loro-danger-text) 14%,transparent);outline:0;transform:translateY(-1px)}@media(max-width:1023.88px){.loro-notification-row{grid-template-columns:auto minmax(0,1fr) auto;padding:.82rem .8rem}.loro-notification-row__delete-button{display:none}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2040
|
+
}
|
|
2041
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroNotificationRow, decorators: [{
|
|
2042
|
+
type: Component,
|
|
2043
|
+
args: [{ selector: 'loro-notification-row', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2044
|
+
<div
|
|
2045
|
+
class="loro-notification-row-shell"
|
|
2046
|
+
data-horizontal-gesture
|
|
2047
|
+
[class.loro-notification-row-shell--dragging]="dragging()"
|
|
2048
|
+
[class.loro-notification-row-shell--armed]="armed()"
|
|
2049
|
+
[class.loro-notification-row-shell--removing]="removing()"
|
|
2050
|
+
(touchstart)="onTouchStart($event)"
|
|
2051
|
+
(touchmove)="onTouchMove($event)"
|
|
2052
|
+
(touchend)="onTouchEnd()"
|
|
2053
|
+
(touchcancel)="resetDrag()">
|
|
2054
|
+
<span class="loro-notification-row-shell__delete" aria-hidden="true">
|
|
2055
|
+
<loro-icon name="trash-white" [size]="22" alt="" [decorative]="true" color="inverse" />
|
|
2056
|
+
<span>Eliminar</span>
|
|
2057
|
+
</span>
|
|
2058
|
+
<article
|
|
2059
|
+
role="button"
|
|
2060
|
+
tabindex="0"
|
|
2061
|
+
class="loro-notification-row"
|
|
2062
|
+
[class.loro-notification-row--unread]="unread()"
|
|
2063
|
+
[style.transform]="'translate3d(' + dragX() + 'px, 0, 0)'"
|
|
2064
|
+
(click)="onRowClick()"
|
|
2065
|
+
(keydown.enter)="onRowKeydown($event)"
|
|
2066
|
+
(keydown.space)="onRowKeydown($event)">
|
|
2067
|
+
<span class="loro-notification-row__icon">
|
|
2068
|
+
<loro-icon [name]="icon()" [size]="26" [alt]="title()" color="primary" />
|
|
2069
|
+
</span>
|
|
2070
|
+
<span class="loro-notification-row__content">
|
|
2071
|
+
<span class="loro-notification-row__meta">
|
|
2072
|
+
<strong>{{ title() }}</strong>
|
|
2073
|
+
@if (time()) {
|
|
2074
|
+
<small>{{ time() }}</small>
|
|
2075
|
+
}
|
|
2076
|
+
</span>
|
|
2077
|
+
<span class="loro-notification-row__message">{{ message() }}</span>
|
|
2078
|
+
</span>
|
|
2079
|
+
@if (unread()) {
|
|
2080
|
+
<span class="loro-notification-row__dot" aria-label="Unread"></span>
|
|
2081
|
+
}
|
|
2082
|
+
<button
|
|
2083
|
+
type="button"
|
|
2084
|
+
class="loro-notification-row__delete-button"
|
|
2085
|
+
aria-label="Eliminar notificacion"
|
|
2086
|
+
(click)="onDeleteClick($event)">
|
|
2087
|
+
<loro-icon name="trash" [size]="18" alt="" [decorative]="true" color="danger" />
|
|
2088
|
+
</button>
|
|
2089
|
+
</article>
|
|
2090
|
+
</div>
|
|
2091
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-notification-row-shell{position:relative;overflow:hidden;background:transparent;touch-action:pan-y}.loro-notification-row-shell__delete{position:absolute;inset:0 0 0 auto;display:grid;width:8.75rem;align-content:center;justify-items:center;gap:.45rem;background:#ef4444;color:var(--loro-text-inverse);opacity:0;transition:opacity .18s ease,transform .18s ease}.loro-notification-row-shell--dragging .loro-notification-row-shell__delete,.loro-notification-row-shell--armed .loro-notification-row-shell__delete,.loro-notification-row-shell--removing .loro-notification-row-shell__delete{opacity:1}.loro-notification-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:.85rem;width:100%;padding:.82rem .95rem;border:0;border-bottom:1px solid var(--loro-border-subtle);background:var(--loro-surface);color:var(--loro-text);text-align:left;cursor:pointer;will-change:transform;transition:background .15s ease,transform .22s cubic-bezier(.2,.8,.2,1),opacity .18s ease}.loro-notification-row-shell--dragging .loro-notification-row{transition:background .15s ease}.loro-notification-row-shell--removing .loro-notification-row{opacity:.18;transform:translate3d(-100%,0,0)!important}:host:last-child .loro-notification-row{border-bottom-color:transparent}.loro-notification-row:hover{background:var(--loro-surface)}.loro-notification-row:focus-visible{position:relative;z-index:1;outline:2px solid rgba(108,60,255,.32);outline-offset:-2px}.loro-notification-row__icon{display:grid;width:2.5rem;height:2.5rem;place-items:center;border-radius:.8rem;background:transparent}.loro-notification-row__content{display:grid;gap:.2rem;min-width:0}.loro-notification-row__meta{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:.75rem}strong{overflow:hidden;color:var(--loro-text-strong);font-size:.92rem;font-weight:950;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}small,.loro-notification-row__message{color:var(--loro-muted);font-size:.82rem;font-weight:700;line-height:1.35}.loro-notification-row__dot{width:.5rem;height:.5rem;border-radius:50%;background:var(--loro-primary-500)}.loro-notification-row__delete-button{display:grid;width:2.25rem;height:2.25rem;place-items:center;border:0;border-radius:.7rem;background:color-mix(in srgb,var(--loro-danger-text) 8%,transparent);cursor:pointer;opacity:0;transition:background .15s ease,opacity .15s ease,transform .15s ease}.loro-notification-row:hover .loro-notification-row__delete-button,.loro-notification-row:focus-visible .loro-notification-row__delete-button,.loro-notification-row__delete-button:focus-visible{opacity:1}.loro-notification-row__delete-button:hover,.loro-notification-row__delete-button:focus-visible{background:color-mix(in srgb,var(--loro-danger-text) 14%,transparent);outline:0;transform:translateY(-1px)}@media(max-width:1023.88px){.loro-notification-row{grid-template-columns:auto minmax(0,1fr) auto;padding:.82rem .8rem}.loro-notification-row__delete-button{display:none}}\n"] }]
|
|
2092
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], time: [{ type: i0.Input, args: [{ isSignal: true, alias: "time", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], unread: [{ type: i0.Input, args: [{ isSignal: true, alias: "unread", required: false }] }], rowClick: [{ type: i0.Output, args: ["rowClick"] }], rowRemove: [{ type: i0.Output, args: ["rowRemove"] }] } });
|
|
2093
|
+
|
|
2094
|
+
class LoroSpinner {
|
|
2095
|
+
iconName = 'image-loro-icon-default';
|
|
2096
|
+
message = input('Cargando...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
2097
|
+
ariaLabel = input('Cargando contenido', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
2098
|
+
showBrand = input(true, ...(ngDevMode ? [{ debugName: "showBrand" }] : /* istanbul ignore next */ []));
|
|
2099
|
+
brandText = input('AlLoro', ...(ngDevMode ? [{ debugName: "brandText" }] : /* istanbul ignore next */ []));
|
|
2100
|
+
showMessage = input(true, ...(ngDevMode ? [{ debugName: "showMessage" }] : /* istanbul ignore next */ []));
|
|
2101
|
+
showDots = input(true, ...(ngDevMode ? [{ debugName: "showDots" }] : /* istanbul ignore next */ []));
|
|
2102
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroSpinner, isStandalone: true, selector: "loro-spinner", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, showBrand: { classPropertyName: "showBrand", publicName: "showBrand", isSignal: true, isRequired: false, transformFunction: null }, brandText: { classPropertyName: "brandText", publicName: "brandText", isSignal: true, isRequired: false, transformFunction: null }, showMessage: { classPropertyName: "showMessage", publicName: "showMessage", isSignal: true, isRequired: false, transformFunction: null }, showDots: { classPropertyName: "showDots", publicName: "showDots", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div class=\"loro-spinner\" role=\"status\" aria-live=\"polite\" [attr.aria-label]=\"ariaLabel()\">\n <div class=\"loro-spinner__panel\">\n <loro-image class=\"loro-spinner__image\" [name]=\"iconName\" fit=\"contain\" />\n\n @if (showBrand()) {\n <strong class=\"loro-spinner__brand\">{{ brandText() }}</strong>\n }\n\n @if (showMessage()) {\n <p class=\"loro-spinner__message\">{{ message() }}</p>\n }\n\n @if (showDots()) {\n <div class=\"loro-spinner__dots\" aria-hidden=\"true\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n }\n </div>\n</div>\n", styles: [".loro-spinner{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;min-height:100dvh;padding:max(var(--loro-space-5),env(safe-area-inset-top)) var(--loro-space-5) max(var(--loro-space-5),env(safe-area-inset-bottom));background:var(--loro-page-background);color:var(--loro-text);font-family:var(--loro-font-brand);isolation:isolate}.loro-spinner__panel{display:flex;flex-direction:column;align-items:center;padding:24px}.loro-spinner__image{width:8rem;margin-bottom:8px}.loro-spinner__brand{color:var(--loro-primary-500);font-size:3rem;font-weight:800;letter-spacing:0}.loro-spinner__message{font-size:1.25rem;font-weight:500;letter-spacing:0;margin-bottom:8px}.loro-spinner__dots{display:inline-flex;align-items:center;gap:var(--loro-space-2);min-height:.75rem}.loro-spinner__dots span{width:.55rem;height:.55rem;border-radius:var(--loro-radius-pill);background:var(--loro-primary-500);animation:loro-spinner-pulse 1.05s ease-in-out infinite}.loro-spinner__dots span:nth-child(2){animation-delay:.14s}.loro-spinner__dots span:nth-child(3){animation-delay:.28s}@media(min-width:1024px){.loro-spinner{background:var(--loro-surface-overlay);-webkit-backdrop-filter:blur(.625rem);backdrop-filter:blur(.625rem)}.loro-spinner__image{width:5rem}.loro-spinner__brand{font-size:1.5rem}.loro-spinner__message{font-size:.75rem}.loro-spinner__panel{min-width:16rem;padding:var(--loro-space-6);border:1px solid var(--loro-border-soft);border-radius:var(--loro-radius-card-lg);background:var(--loro-surface-elevated);min-height:16rem}}@keyframes loro-spinner-pulse{0%,80%,to{opacity:.28;transform:scale(.78)}40%{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){.loro-spinner__dots span{animation:none;opacity:.72}}\n"], dependencies: [{ kind: "component", type: LoroImage$1, selector: "loro-image", inputs: ["name", "alt", "size", "width", "height", "fit"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2104
|
+
}
|
|
2105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSpinner, decorators: [{
|
|
2106
|
+
type: Component,
|
|
2107
|
+
args: [{ selector: 'loro-spinner', standalone: true, imports: [LoroImage$1], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"loro-spinner\" role=\"status\" aria-live=\"polite\" [attr.aria-label]=\"ariaLabel()\">\n <div class=\"loro-spinner__panel\">\n <loro-image class=\"loro-spinner__image\" [name]=\"iconName\" fit=\"contain\" />\n\n @if (showBrand()) {\n <strong class=\"loro-spinner__brand\">{{ brandText() }}</strong>\n }\n\n @if (showMessage()) {\n <p class=\"loro-spinner__message\">{{ message() }}</p>\n }\n\n @if (showDots()) {\n <div class=\"loro-spinner__dots\" aria-hidden=\"true\">\n <span></span>\n <span></span>\n <span></span>\n </div>\n }\n </div>\n</div>\n", styles: [".loro-spinner{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;min-height:100dvh;padding:max(var(--loro-space-5),env(safe-area-inset-top)) var(--loro-space-5) max(var(--loro-space-5),env(safe-area-inset-bottom));background:var(--loro-page-background);color:var(--loro-text);font-family:var(--loro-font-brand);isolation:isolate}.loro-spinner__panel{display:flex;flex-direction:column;align-items:center;padding:24px}.loro-spinner__image{width:8rem;margin-bottom:8px}.loro-spinner__brand{color:var(--loro-primary-500);font-size:3rem;font-weight:800;letter-spacing:0}.loro-spinner__message{font-size:1.25rem;font-weight:500;letter-spacing:0;margin-bottom:8px}.loro-spinner__dots{display:inline-flex;align-items:center;gap:var(--loro-space-2);min-height:.75rem}.loro-spinner__dots span{width:.55rem;height:.55rem;border-radius:var(--loro-radius-pill);background:var(--loro-primary-500);animation:loro-spinner-pulse 1.05s ease-in-out infinite}.loro-spinner__dots span:nth-child(2){animation-delay:.14s}.loro-spinner__dots span:nth-child(3){animation-delay:.28s}@media(min-width:1024px){.loro-spinner{background:var(--loro-surface-overlay);-webkit-backdrop-filter:blur(.625rem);backdrop-filter:blur(.625rem)}.loro-spinner__image{width:5rem}.loro-spinner__brand{font-size:1.5rem}.loro-spinner__message{font-size:.75rem}.loro-spinner__panel{min-width:16rem;padding:var(--loro-space-6);border:1px solid var(--loro-border-soft);border-radius:var(--loro-radius-card-lg);background:var(--loro-surface-elevated);min-height:16rem}}@keyframes loro-spinner-pulse{0%,80%,to{opacity:.28;transform:scale(.78)}40%{opacity:1;transform:scale(1)}}@media(prefers-reduced-motion:reduce){.loro-spinner__dots span{animation:none;opacity:.72}}\n"] }]
|
|
2108
|
+
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], showBrand: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBrand", required: false }] }], brandText: [{ type: i0.Input, args: [{ isSignal: true, alias: "brandText", required: false }] }], showMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMessage", required: false }] }], showDots: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDots", required: false }] }] } });
|
|
2109
|
+
|
|
2110
|
+
class LoroToast {
|
|
2111
|
+
message = input.required(...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
2112
|
+
variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2113
|
+
position = input('bottom-right', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
2114
|
+
visible = input(true, ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
2115
|
+
dismissible = input(true, ...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
2116
|
+
dismiss = output();
|
|
2117
|
+
resolvedIcon() {
|
|
2118
|
+
switch (this.variant()) {
|
|
2119
|
+
case 'success':
|
|
2120
|
+
return 'check';
|
|
2121
|
+
case 'warning':
|
|
2122
|
+
return 'warning';
|
|
2123
|
+
case 'error':
|
|
2124
|
+
return 'shield-alert';
|
|
2125
|
+
default:
|
|
2126
|
+
return 'info';
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
iconColor() {
|
|
2130
|
+
switch (this.variant()) {
|
|
2131
|
+
case 'success':
|
|
2132
|
+
return 'success';
|
|
2133
|
+
case 'warning':
|
|
2134
|
+
return 'warning';
|
|
2135
|
+
case 'error':
|
|
2136
|
+
return 'danger';
|
|
2137
|
+
default:
|
|
2138
|
+
return 'primary';
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroToast, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2142
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroToast, isStandalone: true, selector: "loro-toast", inputs: { message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { properties: { "class.loro-toast-host--inline": "position() === 'inline'" } }, ngImport: i0, template: `
|
|
2143
|
+
@if (visible()) {
|
|
2144
|
+
<aside
|
|
2145
|
+
class="loro-toast"
|
|
2146
|
+
[class]="'loro-toast loro-toast--' + variant() + ' loro-toast--' + position()"
|
|
2147
|
+
[attr.role]="variant() === 'error' ? 'alert' : 'status'">
|
|
2148
|
+
<span class="loro-toast__icon">
|
|
2149
|
+
@if (variant() === 'loading') {
|
|
2150
|
+
<span class="loro-toast__spinner" aria-hidden="true"></span>
|
|
2151
|
+
} @else {
|
|
2152
|
+
<loro-icon [name]="resolvedIcon()" [size]="24" [alt]="message()" [color]="iconColor()" />
|
|
2153
|
+
}
|
|
2154
|
+
</span>
|
|
2155
|
+
<span>{{ message() }}</span>
|
|
2156
|
+
@if (dismissible()) {
|
|
2157
|
+
<button type="button" (click)="dismiss.emit()" aria-label="Dismiss notification">x</button>
|
|
2158
|
+
}
|
|
2159
|
+
</aside>
|
|
2160
|
+
}
|
|
2161
|
+
`, isInline: true, styles: [":host{z-index:1000;display:block;font-family:var(--loro-font-brand);pointer-events:none}:host(.loro-toast-host--inline){width:100%}.loro-toast{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.75rem;width:min(24rem,calc(100vw - 2rem));min-height:3.6rem;padding:.85rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:.8rem;background:var(--loro-surface);color:var(--loro-text-strong);box-shadow:var(--loro-shadow-panel);font-weight:800;pointer-events:auto}.loro-toast--top-right{position:fixed;top:1rem;right:1rem}.loro-toast--bottom-right{position:fixed;right:1rem;bottom:1rem}.loro-toast--bottom-center{position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}.loro-toast--inline{position:static;width:100%;transform:none}.loro-toast__icon{display:grid;width:1.8rem;height:1.8rem;place-items:center}.loro-toast__spinner{width:1.35rem;height:1.35rem;border:2px solid rgba(108,60,255,.18);border-top-color:var(--loro-primary-500);border-radius:50%;animation:loro-toast-spin .85s linear infinite}button{border:0;background:transparent;color:var(--loro-muted);font:inherit;cursor:pointer}@keyframes loro-toast-spin{to{transform:rotate(360deg)}}@media(max-width:1023.88px){.loro-toast:not(.loro-toast--inline){right:1rem;bottom:calc(env(safe-area-inset-bottom,0px) + 1rem);left:1rem;width:auto;transform:none}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2162
|
+
}
|
|
2163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroToast, decorators: [{
|
|
2164
|
+
type: Component,
|
|
2165
|
+
args: [{ selector: 'loro-toast', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2166
|
+
'[class.loro-toast-host--inline]': "position() === 'inline'",
|
|
2167
|
+
}, template: `
|
|
2168
|
+
@if (visible()) {
|
|
2169
|
+
<aside
|
|
2170
|
+
class="loro-toast"
|
|
2171
|
+
[class]="'loro-toast loro-toast--' + variant() + ' loro-toast--' + position()"
|
|
2172
|
+
[attr.role]="variant() === 'error' ? 'alert' : 'status'">
|
|
2173
|
+
<span class="loro-toast__icon">
|
|
2174
|
+
@if (variant() === 'loading') {
|
|
2175
|
+
<span class="loro-toast__spinner" aria-hidden="true"></span>
|
|
2176
|
+
} @else {
|
|
2177
|
+
<loro-icon [name]="resolvedIcon()" [size]="24" [alt]="message()" [color]="iconColor()" />
|
|
2178
|
+
}
|
|
2179
|
+
</span>
|
|
2180
|
+
<span>{{ message() }}</span>
|
|
2181
|
+
@if (dismissible()) {
|
|
2182
|
+
<button type="button" (click)="dismiss.emit()" aria-label="Dismiss notification">x</button>
|
|
2183
|
+
}
|
|
2184
|
+
</aside>
|
|
2185
|
+
}
|
|
2186
|
+
`, styles: [":host{z-index:1000;display:block;font-family:var(--loro-font-brand);pointer-events:none}:host(.loro-toast-host--inline){width:100%}.loro-toast{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.75rem;width:min(24rem,calc(100vw - 2rem));min-height:3.6rem;padding:.85rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:.8rem;background:var(--loro-surface);color:var(--loro-text-strong);box-shadow:var(--loro-shadow-panel);font-weight:800;pointer-events:auto}.loro-toast--top-right{position:fixed;top:1rem;right:1rem}.loro-toast--bottom-right{position:fixed;right:1rem;bottom:1rem}.loro-toast--bottom-center{position:fixed;bottom:1rem;left:50%;transform:translate(-50%)}.loro-toast--inline{position:static;width:100%;transform:none}.loro-toast__icon{display:grid;width:1.8rem;height:1.8rem;place-items:center}.loro-toast__spinner{width:1.35rem;height:1.35rem;border:2px solid rgba(108,60,255,.18);border-top-color:var(--loro-primary-500);border-radius:50%;animation:loro-toast-spin .85s linear infinite}button{border:0;background:transparent;color:var(--loro-muted);font:inherit;cursor:pointer}@keyframes loro-toast-spin{to{transform:rotate(360deg)}}@media(max-width:1023.88px){.loro-toast:not(.loro-toast--inline){right:1rem;bottom:calc(env(safe-area-inset-bottom,0px) + 1rem);left:1rem;width:auto;transform:none}}\n"] }]
|
|
2187
|
+
}], propDecorators: { message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: true }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
|
|
2188
|
+
|
|
2189
|
+
let nextLoroAuthFieldId = 0;
|
|
2190
|
+
class LoroAuthField {
|
|
2191
|
+
icon = input.required(...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2192
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2193
|
+
placeholder = input.required(...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2194
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2195
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2196
|
+
autocomplete = input('off', ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
2197
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
2198
|
+
state = input('default', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
2199
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
2200
|
+
valueChange = output();
|
|
2201
|
+
errorId = `loro-auth-field-error-${++nextLoroAuthFieldId}`;
|
|
2202
|
+
errorText = computed(() => this.errorMessage().trim(), ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
2203
|
+
hasError = computed(() => this.state() === 'error' || this.errorText().length > 0, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
2204
|
+
passwordVisible = signal(false, ...(ngDevMode ? [{ debugName: "passwordVisible" }] : /* istanbul ignore next */ []));
|
|
2205
|
+
showToggle() {
|
|
2206
|
+
return this.type() === 'password';
|
|
2207
|
+
}
|
|
2208
|
+
resolvedType() {
|
|
2209
|
+
return this.type() === 'password' && this.passwordVisible() ? 'text' : this.type();
|
|
2210
|
+
}
|
|
2211
|
+
toggleVisibility() {
|
|
2212
|
+
this.passwordVisible.update((value) => !value);
|
|
2213
|
+
}
|
|
2214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAuthField, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2215
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroAuthField, isStandalone: true, selector: "loro-auth-field", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
2216
|
+
<label
|
|
2217
|
+
class="loro-auth-field"
|
|
2218
|
+
[class.loro-auth-field--selected]="selected()"
|
|
2219
|
+
[class.loro-auth-field--error]="hasError()"
|
|
2220
|
+
>
|
|
2221
|
+
<span class="sr-only">{{ label() }}</span>
|
|
2222
|
+
<span class="loro-auth-field__icon">
|
|
2223
|
+
<loro-icon [name]="icon()" [size]="28" [alt]="label()" />
|
|
2224
|
+
</span>
|
|
2225
|
+
<input
|
|
2226
|
+
class="loro-auth-field__input"
|
|
2227
|
+
[type]="resolvedType()"
|
|
2228
|
+
[attr.autocomplete]="autocomplete()"
|
|
2229
|
+
[placeholder]="placeholder()"
|
|
2230
|
+
[value]="value()"
|
|
2231
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2232
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2233
|
+
(input)="valueChange.emit(($any($event.target).value ?? '').toString())"
|
|
2234
|
+
/>
|
|
2235
|
+
@if (showToggle()) {
|
|
2236
|
+
<button
|
|
2237
|
+
type="button"
|
|
2238
|
+
class="loro-auth-field__toggle"
|
|
2239
|
+
(click)="toggleVisibility()"
|
|
2240
|
+
[attr.aria-label]="passwordVisible() ? 'Ocultar contenido' : 'Mostrar contenido'"
|
|
2241
|
+
>
|
|
2242
|
+
<loro-icon name="eye" [size]="26" alt="Mostrar contenido" />
|
|
2243
|
+
</button>
|
|
2244
|
+
}
|
|
2245
|
+
</label>
|
|
2246
|
+
@if (hasError() && errorText()) {
|
|
2247
|
+
<span class="loro-auth-field__error" [id]="errorId">
|
|
2248
|
+
<loro-icon name="shield-alert" [size]="15" color="danger" [decorative]="true" />
|
|
2249
|
+
<span>{{ errorText() }}</span>
|
|
2250
|
+
</span>
|
|
2251
|
+
}
|
|
2252
|
+
`, isInline: true, styles: [":host{display:grid;gap:.35rem}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;padding:0}.loro-auth-field{display:grid;grid-template-columns:2rem minmax(0,1fr) auto;align-items:center;border:1px solid var(--loro-border-strong);border-radius:.72rem;background:var(--loro-surface);padding:.48rem .65rem;box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font-family:var(--loro-font-brand);transition:border-color .18s ease,box-shadow .18s ease}.loro-auth-field:hover,.loro-auth-field:focus-within,.loro-auth-field--selected{border-color:var(--loro-auth-field-active-border, var(--loro-primary-500));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-field--error{border-color:color-mix(in srgb,var(--loro-danger-text) 30%,var(--loro-border-strong));background:color-mix(in srgb,var(--loro-danger-surface) 34%,var(--loro-surface));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-auth-field--error:hover,.loro-auth-field--error:focus-within{border-color:color-mix(in srgb,var(--loro-danger-text) 44%,var(--loro-border-strong));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 10%,transparent)}.loro-auth-field__icon{display:grid;place-items:center;width:24px}.loro-auth-field__icon loro-icon{transform:scale(.62)}.loro-auth-field__input{width:100%;border:0;outline:none;background:transparent;color:var(--loro-text);font:inherit;font-size:.72rem;line-height:1.3}.loro-auth-field__input::placeholder{color:var(--loro-muted)}.loro-auth-field__toggle{border:0;background:transparent;padding:0;color:inherit;line-height:0;cursor:pointer}.loro-auth-field__toggle loro-icon{transform:scale(.62)}.loro-auth-field__error{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.35rem;color:var(--loro-danger-text);font-size:.72rem;font-weight:750;line-height:1.3}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2253
|
+
}
|
|
2254
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroAuthField, decorators: [{
|
|
2255
|
+
type: Component,
|
|
2256
|
+
args: [{ selector: 'loro-auth-field', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2257
|
+
<label
|
|
2258
|
+
class="loro-auth-field"
|
|
2259
|
+
[class.loro-auth-field--selected]="selected()"
|
|
2260
|
+
[class.loro-auth-field--error]="hasError()"
|
|
2261
|
+
>
|
|
2262
|
+
<span class="sr-only">{{ label() }}</span>
|
|
2263
|
+
<span class="loro-auth-field__icon">
|
|
2264
|
+
<loro-icon [name]="icon()" [size]="28" [alt]="label()" />
|
|
2265
|
+
</span>
|
|
2266
|
+
<input
|
|
2267
|
+
class="loro-auth-field__input"
|
|
2268
|
+
[type]="resolvedType()"
|
|
2269
|
+
[attr.autocomplete]="autocomplete()"
|
|
2270
|
+
[placeholder]="placeholder()"
|
|
2271
|
+
[value]="value()"
|
|
2272
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2273
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2274
|
+
(input)="valueChange.emit(($any($event.target).value ?? '').toString())"
|
|
2275
|
+
/>
|
|
2276
|
+
@if (showToggle()) {
|
|
2277
|
+
<button
|
|
2278
|
+
type="button"
|
|
2279
|
+
class="loro-auth-field__toggle"
|
|
2280
|
+
(click)="toggleVisibility()"
|
|
2281
|
+
[attr.aria-label]="passwordVisible() ? 'Ocultar contenido' : 'Mostrar contenido'"
|
|
2282
|
+
>
|
|
2283
|
+
<loro-icon name="eye" [size]="26" alt="Mostrar contenido" />
|
|
2284
|
+
</button>
|
|
2285
|
+
}
|
|
2286
|
+
</label>
|
|
2287
|
+
@if (hasError() && errorText()) {
|
|
2288
|
+
<span class="loro-auth-field__error" [id]="errorId">
|
|
2289
|
+
<loro-icon name="shield-alert" [size]="15" color="danger" [decorative]="true" />
|
|
2290
|
+
<span>{{ errorText() }}</span>
|
|
2291
|
+
</span>
|
|
2292
|
+
}
|
|
2293
|
+
`, styles: [":host{display:grid;gap:.35rem}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;padding:0}.loro-auth-field{display:grid;grid-template-columns:2rem minmax(0,1fr) auto;align-items:center;border:1px solid var(--loro-border-strong);border-radius:.72rem;background:var(--loro-surface);padding:.48rem .65rem;box-shadow:var(--loro-shadow-soft);color:var(--loro-text);font-family:var(--loro-font-brand);transition:border-color .18s ease,box-shadow .18s ease}.loro-auth-field:hover,.loro-auth-field:focus-within,.loro-auth-field--selected{border-color:var(--loro-auth-field-active-border, var(--loro-primary-500));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 14%,transparent)}.loro-auth-field--error{border-color:color-mix(in srgb,var(--loro-danger-text) 30%,var(--loro-border-strong));background:color-mix(in srgb,var(--loro-danger-surface) 34%,var(--loro-surface));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-auth-field--error:hover,.loro-auth-field--error:focus-within{border-color:color-mix(in srgb,var(--loro-danger-text) 44%,var(--loro-border-strong));box-shadow:var(--loro-shadow-soft),0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 10%,transparent)}.loro-auth-field__icon{display:grid;place-items:center;width:24px}.loro-auth-field__icon loro-icon{transform:scale(.62)}.loro-auth-field__input{width:100%;border:0;outline:none;background:transparent;color:var(--loro-text);font:inherit;font-size:.72rem;line-height:1.3}.loro-auth-field__input::placeholder{color:var(--loro-muted)}.loro-auth-field__toggle{border:0;background:transparent;padding:0;color:inherit;line-height:0;cursor:pointer}.loro-auth-field__toggle loro-icon{transform:scale(.62)}.loro-auth-field__error{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.35rem;color:var(--loro-danger-text);font-size:.72rem;font-weight:750;line-height:1.3}\n"] }]
|
|
2294
|
+
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
2295
|
+
|
|
2296
|
+
class LoroCheckbox {
|
|
2297
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
2298
|
+
touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
2299
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2300
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
2301
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
2302
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2303
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2304
|
+
helperText = input('', ...(ngDevMode ? [{ debugName: "helperText" }] : /* istanbul ignore next */ []));
|
|
2305
|
+
text = input('', ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
2306
|
+
errorText = computed(() => this.errors()[0]?.message?.trim() ?? '', ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
2307
|
+
showError = computed(() => this.errorText().length > 0 || (this.invalid() && this.touched()), ...(ngDevMode ? [{ debugName: "showError" }] : /* istanbul ignore next */ []));
|
|
2308
|
+
toggle(checked) {
|
|
2309
|
+
if (this.disabled() || this.readonly()) {
|
|
2310
|
+
return;
|
|
2311
|
+
}
|
|
2312
|
+
this.checked.set(checked);
|
|
2313
|
+
}
|
|
2314
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCheckbox, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2315
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroCheckbox, isStandalone: true, selector: "loro-checkbox", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touched: "touchedChange" }, ngImport: i0, template: `
|
|
2316
|
+
<label
|
|
2317
|
+
class="loro-checkbox"
|
|
2318
|
+
[class.loro-checkbox--checked]="checked()"
|
|
2319
|
+
[class.loro-checkbox--invalid]="showError()"
|
|
2320
|
+
[class.loro-checkbox--disabled]="disabled()"
|
|
2321
|
+
>
|
|
2322
|
+
<input
|
|
2323
|
+
type="checkbox"
|
|
2324
|
+
class="loro-checkbox__native"
|
|
2325
|
+
[checked]="checked()"
|
|
2326
|
+
[disabled]="disabled()"
|
|
2327
|
+
[required]="required()"
|
|
2328
|
+
[readonly]="readonly()"
|
|
2329
|
+
(change)="toggle(($any($event.target).checked))"
|
|
2330
|
+
(blur)="touched.set(true)"
|
|
2331
|
+
/>
|
|
2332
|
+
<span class="loro-checkbox__box" aria-hidden="true"></span>
|
|
2333
|
+
<span class="loro-checkbox__content">
|
|
2334
|
+
<span class="loro-checkbox__label">
|
|
2335
|
+
@if (text()) {
|
|
2336
|
+
{{ text() }}
|
|
2337
|
+
} @else {
|
|
2338
|
+
<ng-content></ng-content>
|
|
2339
|
+
}
|
|
2340
|
+
</span>
|
|
2341
|
+
@if (errorText()) {
|
|
2342
|
+
<span class="loro-checkbox__error">{{ errorText() }}</span>
|
|
2343
|
+
} @else if (helperText()) {
|
|
2344
|
+
<span class="loro-checkbox__helper">{{ helperText() }}</span>
|
|
2345
|
+
}
|
|
2346
|
+
</span>
|
|
2347
|
+
</label>
|
|
2348
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-checkbox{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.65rem;color:var(--loro-muted);cursor:pointer}.loro-checkbox--disabled{opacity:.62;cursor:not-allowed}.loro-checkbox__native{position:absolute;opacity:0;pointer-events:none}.loro-checkbox__box{position:relative;width:1.15rem;height:1.15rem;margin-top:.08rem;border:1.5px solid color-mix(in srgb,var(--loro-primary-500) 78%,#ffffff 22%);border-radius:.35rem;background:var(--loro-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-surface) 70%,transparent);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.loro-checkbox--checked .loro-checkbox__box{background:linear-gradient(180deg,#8f6bff,#6d3dff);border-color:var(--loro-primary-500);box-shadow:inset 0 0 0 1px color-mix(in srgb,#ffffff 18%,transparent),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 12%,transparent)}.loro-checkbox--checked .loro-checkbox__box:after{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:.8rem;font-weight:900;line-height:1;content:\"\\2713\"}.loro-checkbox--invalid .loro-checkbox__box{border-color:color-mix(in srgb,var(--loro-danger-text) 44%,var(--loro-primary-500));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 10%,transparent)}.loro-checkbox__content{display:grid;gap:.22rem;min-width:0}.loro-checkbox__label{color:inherit;font-size:var(--loro-checkbox-label-font-size, .9rem);font-weight:var(--loro-checkbox-label-font-weight, 750);line-height:var(--loro-checkbox-label-line-height, 1.35)}.loro-checkbox__helper,.loro-checkbox__error{font-size:.78rem;font-weight:700;line-height:1.3}.loro-checkbox__helper{color:var(--loro-muted)}.loro-checkbox__error{color:var(--loro-danger-text)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2349
|
+
}
|
|
2350
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroCheckbox, decorators: [{
|
|
2351
|
+
type: Component,
|
|
2352
|
+
args: [{ selector: 'loro-checkbox', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2353
|
+
<label
|
|
2354
|
+
class="loro-checkbox"
|
|
2355
|
+
[class.loro-checkbox--checked]="checked()"
|
|
2356
|
+
[class.loro-checkbox--invalid]="showError()"
|
|
2357
|
+
[class.loro-checkbox--disabled]="disabled()"
|
|
2358
|
+
>
|
|
2359
|
+
<input
|
|
2360
|
+
type="checkbox"
|
|
2361
|
+
class="loro-checkbox__native"
|
|
2362
|
+
[checked]="checked()"
|
|
2363
|
+
[disabled]="disabled()"
|
|
2364
|
+
[required]="required()"
|
|
2365
|
+
[readonly]="readonly()"
|
|
2366
|
+
(change)="toggle(($any($event.target).checked))"
|
|
2367
|
+
(blur)="touched.set(true)"
|
|
2368
|
+
/>
|
|
2369
|
+
<span class="loro-checkbox__box" aria-hidden="true"></span>
|
|
2370
|
+
<span class="loro-checkbox__content">
|
|
2371
|
+
<span class="loro-checkbox__label">
|
|
2372
|
+
@if (text()) {
|
|
2373
|
+
{{ text() }}
|
|
2374
|
+
} @else {
|
|
2375
|
+
<ng-content></ng-content>
|
|
2376
|
+
}
|
|
2377
|
+
</span>
|
|
2378
|
+
@if (errorText()) {
|
|
2379
|
+
<span class="loro-checkbox__error">{{ errorText() }}</span>
|
|
2380
|
+
} @else if (helperText()) {
|
|
2381
|
+
<span class="loro-checkbox__helper">{{ helperText() }}</span>
|
|
2382
|
+
}
|
|
2383
|
+
</span>
|
|
2384
|
+
</label>
|
|
2385
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-checkbox{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.65rem;color:var(--loro-muted);cursor:pointer}.loro-checkbox--disabled{opacity:.62;cursor:not-allowed}.loro-checkbox__native{position:absolute;opacity:0;pointer-events:none}.loro-checkbox__box{position:relative;width:1.15rem;height:1.15rem;margin-top:.08rem;border:1.5px solid color-mix(in srgb,var(--loro-primary-500) 78%,#ffffff 22%);border-radius:.35rem;background:var(--loro-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-surface) 70%,transparent);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.loro-checkbox--checked .loro-checkbox__box{background:linear-gradient(180deg,#8f6bff,#6d3dff);border-color:var(--loro-primary-500);box-shadow:inset 0 0 0 1px color-mix(in srgb,#ffffff 18%,transparent),0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 12%,transparent)}.loro-checkbox--checked .loro-checkbox__box:after{position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:.8rem;font-weight:900;line-height:1;content:\"\\2713\"}.loro-checkbox--invalid .loro-checkbox__box{border-color:color-mix(in srgb,var(--loro-danger-text) 44%,var(--loro-primary-500));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 10%,transparent)}.loro-checkbox__content{display:grid;gap:.22rem;min-width:0}.loro-checkbox__label{color:inherit;font-size:var(--loro-checkbox-label-font-size, .9rem);font-weight:var(--loro-checkbox-label-font-weight, 750);line-height:var(--loro-checkbox-label-line-height, 1.35)}.loro-checkbox__helper,.loro-checkbox__error{font-size:.78rem;font-weight:700;line-height:1.3}.loro-checkbox__helper{color:var(--loro-muted)}.loro-checkbox__error{color:var(--loro-danger-text)}\n"] }]
|
|
2386
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }] } });
|
|
2387
|
+
|
|
2388
|
+
class LoroDropdown {
|
|
2389
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2390
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2391
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2392
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
2393
|
+
valueChange = output();
|
|
2394
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDropdown, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2395
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroDropdown, isStandalone: true, selector: "loro-dropdown", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
2396
|
+
<label class="loro-dropdown">
|
|
2397
|
+
@if (label()) {
|
|
2398
|
+
<span class="loro-dropdown__label">{{ label() }}</span>
|
|
2399
|
+
}
|
|
2400
|
+
<span class="loro-dropdown__control">
|
|
2401
|
+
<select [value]="value()" (change)="valueChange.emit(($any($event.target).value ?? '').toString())">
|
|
2402
|
+
@if (placeholder()) {
|
|
2403
|
+
<option value="" disabled>{{ placeholder() }}</option>
|
|
2404
|
+
}
|
|
2405
|
+
@for (option of options(); track option.value) {
|
|
2406
|
+
<option [value]="option.value">{{ option.label }}</option>
|
|
2407
|
+
}
|
|
2408
|
+
</select>
|
|
2409
|
+
<loro-icon name="chevron-down" [size]="22" alt="Abrir opciones" color="primary" />
|
|
2410
|
+
</span>
|
|
2411
|
+
</label>
|
|
2412
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-dropdown{display:grid;gap:.55rem}.loro-dropdown__label{color:var(--loro-muted-strong);font-size:.95rem;font-weight:800}.loro-dropdown__control{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:3.4rem;padding:0 1rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-input);background:var(--loro-surface)}select{width:100%;border:0;outline:0;appearance:none;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:700}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2413
|
+
}
|
|
2414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroDropdown, decorators: [{
|
|
2415
|
+
type: Component,
|
|
2416
|
+
args: [{ selector: 'loro-dropdown', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2417
|
+
<label class="loro-dropdown">
|
|
2418
|
+
@if (label()) {
|
|
2419
|
+
<span class="loro-dropdown__label">{{ label() }}</span>
|
|
2420
|
+
}
|
|
2421
|
+
<span class="loro-dropdown__control">
|
|
2422
|
+
<select [value]="value()" (change)="valueChange.emit(($any($event.target).value ?? '').toString())">
|
|
2423
|
+
@if (placeholder()) {
|
|
2424
|
+
<option value="" disabled>{{ placeholder() }}</option>
|
|
2425
|
+
}
|
|
2426
|
+
@for (option of options(); track option.value) {
|
|
2427
|
+
<option [value]="option.value">{{ option.label }}</option>
|
|
2428
|
+
}
|
|
2429
|
+
</select>
|
|
2430
|
+
<loro-icon name="chevron-down" [size]="22" alt="Abrir opciones" color="primary" />
|
|
2431
|
+
</span>
|
|
2432
|
+
</label>
|
|
2433
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-dropdown{display:grid;gap:.55rem}.loro-dropdown__label{color:var(--loro-muted-strong);font-size:.95rem;font-weight:800}.loro-dropdown__control{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:3.4rem;padding:0 1rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-input);background:var(--loro-surface)}select{width:100%;border:0;outline:0;appearance:none;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:700}\n"] }]
|
|
2434
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
2435
|
+
|
|
2436
|
+
class LoroFilterChip {
|
|
2437
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2438
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2439
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2440
|
+
active = input(false, ...(ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []));
|
|
2441
|
+
selected = output();
|
|
2442
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroFilterChip, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2443
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroFilterChip, isStandalone: true, selector: "loro-filter-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, ngImport: i0, template: `
|
|
2444
|
+
<button type="button" class="loro-filter-chip" [class.loro-filter-chip--active]="active()" (click)="selected.emit(value())">
|
|
2445
|
+
@if (icon()) {
|
|
2446
|
+
<loro-icon [name]="icon()!" [size]="20" [alt]="label()" [color]="active() ? 'inverse' : 'primary'" />
|
|
2447
|
+
}
|
|
2448
|
+
<span>{{ label() }}</span>
|
|
2449
|
+
</button>
|
|
2450
|
+
`, isInline: true, styles: [":host{display:inline-flex;font-family:var(--loro-font-brand)}.loro-filter-chip{display:inline-flex;align-items:center;gap:.45rem;min-height:2.55rem;padding:.55rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-pill);background:var(--loro-surface);color:var(--loro-muted-strong);font:inherit;font-size:.9rem;font-weight:850;cursor:pointer;white-space:nowrap}.loro-filter-chip--active{border-color:transparent;background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff;box-shadow:var(--loro-shadow-button)}@media(max-width:640px){.loro-filter-chip{gap:.4rem;min-height:2.3rem;padding:.48rem .78rem;font-size:clamp(.78rem,2.9vw,.9rem)}}@media(max-width:430px){.loro-filter-chip{gap:.34rem;min-height:2.2rem;padding:.42rem .7rem;font-size:clamp(.74rem,2.8vw,.84rem)}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2451
|
+
}
|
|
2452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroFilterChip, decorators: [{
|
|
2453
|
+
type: Component,
|
|
2454
|
+
args: [{ selector: 'loro-filter-chip', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2455
|
+
<button type="button" class="loro-filter-chip" [class.loro-filter-chip--active]="active()" (click)="selected.emit(value())">
|
|
2456
|
+
@if (icon()) {
|
|
2457
|
+
<loro-icon [name]="icon()!" [size]="20" [alt]="label()" [color]="active() ? 'inverse' : 'primary'" />
|
|
2458
|
+
}
|
|
2459
|
+
<span>{{ label() }}</span>
|
|
2460
|
+
</button>
|
|
2461
|
+
`, styles: [":host{display:inline-flex;font-family:var(--loro-font-brand)}.loro-filter-chip{display:inline-flex;align-items:center;gap:.45rem;min-height:2.55rem;padding:.55rem 1rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-pill);background:var(--loro-surface);color:var(--loro-muted-strong);font:inherit;font-size:.9rem;font-weight:850;cursor:pointer;white-space:nowrap}.loro-filter-chip--active{border-color:transparent;background:linear-gradient(135deg,var(--loro-primary-500),var(--loro-primary-700));color:#fff;box-shadow:var(--loro-shadow-button)}@media(max-width:640px){.loro-filter-chip{gap:.4rem;min-height:2.3rem;padding:.48rem .78rem;font-size:clamp(.78rem,2.9vw,.9rem)}}@media(max-width:430px){.loro-filter-chip{gap:.34rem;min-height:2.2rem;padding:.42rem .7rem;font-size:clamp(.74rem,2.8vw,.84rem)}}\n"] }]
|
|
2462
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
2463
|
+
|
|
2464
|
+
let nextLoroInputId = 0;
|
|
2465
|
+
class LoroInput {
|
|
2466
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2467
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
2468
|
+
helperText = input('', ...(ngDevMode ? [{ debugName: "helperText" }] : /* istanbul ignore next */ []));
|
|
2469
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2470
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
2471
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
2472
|
+
autocomplete = input('', ...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
2473
|
+
inputmode = input('', ...(ngDevMode ? [{ debugName: "inputmode" }] : /* istanbul ignore next */ []));
|
|
2474
|
+
icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2475
|
+
iconSize = input(24, ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
|
|
2476
|
+
trailingIcon = input(null, ...(ngDevMode ? [{ debugName: "trailingIcon" }] : /* istanbul ignore next */ []));
|
|
2477
|
+
trailingIconSize = input(24, ...(ngDevMode ? [{ debugName: "trailingIconSize" }] : /* istanbul ignore next */ []));
|
|
2478
|
+
trailingAriaLabel = input('', ...(ngDevMode ? [{ debugName: "trailingAriaLabel" }] : /* istanbul ignore next */ []));
|
|
2479
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2480
|
+
state = input('default', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
2481
|
+
errorMessage = input('', ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
|
|
2482
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2483
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2484
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2485
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
2486
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
2487
|
+
touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
2488
|
+
unit = input('ud', ...(ngDevMode ? [{ debugName: "unit" }] : /* istanbul ignore next */ []));
|
|
2489
|
+
step = input(1, ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
2490
|
+
min = input(0, ...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
2491
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
2492
|
+
trailingClick = output();
|
|
2493
|
+
control = viewChild('control', ...(ngDevMode ? [{ debugName: "control" }] : /* istanbul ignore next */ []));
|
|
2494
|
+
errorId = `loro-input-error-${++nextLoroInputId}`;
|
|
2495
|
+
errorText = computed(() => {
|
|
2496
|
+
const manualMessage = this.errorMessage().trim();
|
|
2497
|
+
if (manualMessage) {
|
|
2498
|
+
return manualMessage;
|
|
2499
|
+
}
|
|
2500
|
+
return this.errors()[0]?.message?.trim() ?? '';
|
|
2501
|
+
}, ...(ngDevMode ? [{ debugName: "errorText" }] : /* istanbul ignore next */ []));
|
|
2502
|
+
hasError = computed(() => this.state() === 'error'
|
|
2503
|
+
|| this.errorText().length > 0
|
|
2504
|
+
|| (this.invalid() && this.touched()), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
2505
|
+
hasSuccess = computed(() => this.state() === 'success' && !this.hasError(), ...(ngDevMode ? [{ debugName: "hasSuccess" }] : /* istanbul ignore next */ []));
|
|
2506
|
+
hasLoading = computed(() => this.state() === 'loading' && !this.hasError(), ...(ngDevMode ? [{ debugName: "hasLoading" }] : /* istanbul ignore next */ []));
|
|
2507
|
+
resolvedLeadingIconColor = computed(() => this.hasError() ? 'danger' : this.hasSuccess() ? 'success' : 'primary', ...(ngDevMode ? [{ debugName: "resolvedLeadingIconColor" }] : /* istanbul ignore next */ []));
|
|
2508
|
+
resolvedTrailingIconColor = computed(() => this.trailingIcon() === 'eye' || this.trailingIcon() === 'eye-off'
|
|
2509
|
+
? 'muted'
|
|
2510
|
+
: this.hasError() ? 'danger' : this.hasSuccess() ? 'success' : 'muted', ...(ngDevMode ? [{ debugName: "resolvedTrailingIconColor" }] : /* istanbul ignore next */ []));
|
|
2511
|
+
focus(options) {
|
|
2512
|
+
this.control()?.nativeElement.focus(options);
|
|
2513
|
+
}
|
|
2514
|
+
adjust(delta) {
|
|
2515
|
+
const value = this.coerceNumber(this.value());
|
|
2516
|
+
const nextValue = this.clampValue(value + delta);
|
|
2517
|
+
this.value.set(this.formatValue(nextValue));
|
|
2518
|
+
this.touched.set(true);
|
|
2519
|
+
}
|
|
2520
|
+
normalizeValue(value) {
|
|
2521
|
+
this.value.set(this.formatValue(this.clampValue(this.coerceNumber(value))));
|
|
2522
|
+
this.touched.set(true);
|
|
2523
|
+
}
|
|
2524
|
+
updateValue(value) {
|
|
2525
|
+
this.value.set(value);
|
|
2526
|
+
}
|
|
2527
|
+
markAsTouched() {
|
|
2528
|
+
this.touched.set(true);
|
|
2529
|
+
}
|
|
2530
|
+
coerceNumber(value) {
|
|
2531
|
+
const parsed = Number(value.replace(',', '.'));
|
|
2532
|
+
return Number.isFinite(parsed) ? parsed : (this.min() ?? 0);
|
|
2533
|
+
}
|
|
2534
|
+
formatValue(value) {
|
|
2535
|
+
if (this.normalizedUnit() === 'ud') {
|
|
2536
|
+
return Math.round(value).toString();
|
|
2537
|
+
}
|
|
2538
|
+
return Number(value.toFixed(1)).toLocaleString('es-ES', {
|
|
2539
|
+
minimumFractionDigits: Number.isInteger(value) ? 0 : 1,
|
|
2540
|
+
maximumFractionDigits: 1,
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
normalizedUnit() {
|
|
2544
|
+
return this.unit() === 'kg' ? 'kg' : 'ud';
|
|
2545
|
+
}
|
|
2546
|
+
stepperInputSize() {
|
|
2547
|
+
return this.normalizedUnit() === 'kg' ? 4 : 3;
|
|
2548
|
+
}
|
|
2549
|
+
stepperInputMaxLength() {
|
|
2550
|
+
return this.normalizedUnit() === 'kg' ? 4 : 3;
|
|
2551
|
+
}
|
|
2552
|
+
sanitizeStepperInput(event) {
|
|
2553
|
+
const input = event.target;
|
|
2554
|
+
if (!(input instanceof HTMLInputElement)) {
|
|
2555
|
+
return;
|
|
2556
|
+
}
|
|
2557
|
+
const value = this.sanitizeValue(input.value);
|
|
2558
|
+
if (input.value !== value) {
|
|
2559
|
+
input.value = value;
|
|
2560
|
+
}
|
|
2561
|
+
if (value === '' || value === ',' || value === '.') {
|
|
2562
|
+
return;
|
|
2563
|
+
}
|
|
2564
|
+
const formatted = this.formatValue(this.clampValue(this.coerceNumber(value)));
|
|
2565
|
+
input.value = formatted;
|
|
2566
|
+
this.value.set(formatted);
|
|
2567
|
+
}
|
|
2568
|
+
clampValue(value) {
|
|
2569
|
+
const min = this.min() ?? 0;
|
|
2570
|
+
const max = this.max() ?? 100;
|
|
2571
|
+
return Math.min(max, Math.max(min, value));
|
|
2572
|
+
}
|
|
2573
|
+
sanitizeValue(value) {
|
|
2574
|
+
if (this.normalizedUnit() === 'ud') {
|
|
2575
|
+
return value.replace(/\D/g, '').slice(0, this.stepperInputMaxLength());
|
|
2576
|
+
}
|
|
2577
|
+
const normalized = value.replace(/\./g, ',').replace(/[^\d,]/g, '');
|
|
2578
|
+
const [integer = '', decimal = ''] = normalized.split(',');
|
|
2579
|
+
const nextInteger = integer.slice(0, 3);
|
|
2580
|
+
const nextDecimal = decimal.slice(0, 1);
|
|
2581
|
+
return normalized.includes(',') ? `${nextInteger},${nextDecimal}` : nextInteger.slice(0, 3);
|
|
2582
|
+
}
|
|
2583
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2584
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroInput, isStandalone: true, selector: "loro-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, helperText: { classPropertyName: "helperText", publicName: "helperText", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, inputmode: { classPropertyName: "inputmode", publicName: "inputmode", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, trailingIcon: { classPropertyName: "trailingIcon", publicName: "trailingIcon", isSignal: true, isRequired: false, transformFunction: null }, trailingIconSize: { classPropertyName: "trailingIconSize", publicName: "trailingIconSize", isSignal: true, isRequired: false, transformFunction: null }, trailingAriaLabel: { classPropertyName: "trailingAriaLabel", publicName: "trailingAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, errorMessage: { classPropertyName: "errorMessage", publicName: "errorMessage", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touched: "touchedChange", trailingClick: "trailingClick" }, viewQueries: [{ propertyName: "control", first: true, predicate: ["control"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
2585
|
+
@if (variant() === 'stepper') {
|
|
2586
|
+
<span
|
|
2587
|
+
class="loro-input loro-input--stepper-field"
|
|
2588
|
+
[class.loro-input--error]="hasError()"
|
|
2589
|
+
[class.loro-input--success]="hasSuccess()">
|
|
2590
|
+
@if (label()) {
|
|
2591
|
+
<span class="loro-input__label">{{ label() }}</span>
|
|
2592
|
+
}
|
|
2593
|
+
<span
|
|
2594
|
+
class="loro-input--stepper"
|
|
2595
|
+
[class.loro-input--stepper-kg]="normalizedUnit() === 'kg'"
|
|
2596
|
+
[class.loro-input--stepper-ud]="normalizedUnit() === 'ud'"
|
|
2597
|
+
role="group"
|
|
2598
|
+
[attr.aria-label]="label() || 'Cantidad'"
|
|
2599
|
+
>
|
|
2600
|
+
<button type="button" aria-label="Restar" [disabled]="disabled()" (click)="adjust(-step())">-</button>
|
|
2601
|
+
<span class="loro-input__stepper-value">
|
|
2602
|
+
<input
|
|
2603
|
+
#control
|
|
2604
|
+
[attr.inputmode]="normalizedUnit() === 'kg' ? 'decimal' : 'numeric'"
|
|
2605
|
+
[attr.size]="stepperInputSize()"
|
|
2606
|
+
[attr.maxlength]="stepperInputMaxLength()"
|
|
2607
|
+
[attr.max]="max()"
|
|
2608
|
+
[attr.min]="min()"
|
|
2609
|
+
[value]="value()"
|
|
2610
|
+
[disabled]="disabled()"
|
|
2611
|
+
[readonly]="readonly()"
|
|
2612
|
+
[required]="required()"
|
|
2613
|
+
[attr.aria-label]="label() || 'Cantidad'"
|
|
2614
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2615
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2616
|
+
(keydown.enter)="$any($event.target).blur()"
|
|
2617
|
+
(input)="sanitizeStepperInput($event)"
|
|
2618
|
+
(blur)="markAsTouched(); normalizeValue(($any($event.target).value ?? '').toString())"
|
|
2619
|
+
/>
|
|
2620
|
+
<span>{{ normalizedUnit() }}</span>
|
|
2621
|
+
</span>
|
|
2622
|
+
<button type="button" aria-label="Sumar" [disabled]="disabled()" (click)="adjust(step())">+</button>
|
|
2623
|
+
</span>
|
|
2624
|
+
@if (hasError() && errorText()) {
|
|
2625
|
+
<span class="loro-input__error" [id]="errorId">
|
|
2626
|
+
<loro-icon name="shield-alert" [size]="16" color="danger" [decorative]="true" />
|
|
2627
|
+
<span>{{ errorText() }}</span>
|
|
2628
|
+
</span>
|
|
2629
|
+
} @else if (hasLoading() && helperText()) {
|
|
2630
|
+
<span class="loro-input__loading" aria-live="polite">
|
|
2631
|
+
<span>{{ helperText() }}</span>
|
|
2632
|
+
</span>
|
|
2633
|
+
} @else if (hasSuccess() && helperText()) {
|
|
2634
|
+
<span class="loro-input__success">
|
|
2635
|
+
<loro-icon name="check" [size]="16" color="success" [decorative]="true" />
|
|
2636
|
+
<span>{{ helperText() }}</span>
|
|
2637
|
+
</span>
|
|
2638
|
+
} @else if (helperText()) {
|
|
2639
|
+
<span class="loro-input__helper">{{ helperText() }}</span>
|
|
2640
|
+
}
|
|
2641
|
+
</span>
|
|
2642
|
+
} @else {
|
|
2643
|
+
<label
|
|
2644
|
+
class="loro-input"
|
|
2645
|
+
[class.loro-input--has-icon]="icon() || variant() === 'search'"
|
|
2646
|
+
[class.loro-input--error]="hasError()"
|
|
2647
|
+
[class.loro-input--success]="hasSuccess()"
|
|
2648
|
+
[class.loro-input--loading]="hasLoading()"
|
|
2649
|
+
>
|
|
2650
|
+
@if (label()) {
|
|
2651
|
+
<span class="loro-input__label">{{ label() }}</span>
|
|
2652
|
+
}
|
|
2653
|
+
<span class="loro-input__control">
|
|
2654
|
+
@if (icon() || variant() === 'search') {
|
|
2655
|
+
<loro-icon
|
|
2656
|
+
[name]="icon() || 'search'"
|
|
2657
|
+
[size]="iconSize()"
|
|
2658
|
+
[alt]="label() || placeholder()"
|
|
2659
|
+
[color]="resolvedLeadingIconColor()"
|
|
2660
|
+
/>
|
|
2661
|
+
}
|
|
2662
|
+
<input
|
|
2663
|
+
#control
|
|
2664
|
+
[type]="type()"
|
|
2665
|
+
[attr.name]="name() || null"
|
|
2666
|
+
[placeholder]="placeholder()"
|
|
2667
|
+
[value]="value()"
|
|
2668
|
+
[disabled]="disabled()"
|
|
2669
|
+
[readonly]="readonly()"
|
|
2670
|
+
[required]="required()"
|
|
2671
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
2672
|
+
[attr.inputmode]="inputmode() || null"
|
|
2673
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2674
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2675
|
+
(input)="updateValue(($any($event.target).value ?? '').toString())"
|
|
2676
|
+
(blur)="markAsTouched()"
|
|
2677
|
+
/>
|
|
2678
|
+
@if (trailingIcon()) {
|
|
2679
|
+
<button
|
|
2680
|
+
type="button"
|
|
2681
|
+
class="loro-input__trailing-button"
|
|
2682
|
+
[attr.aria-label]="trailingAriaLabel() || null"
|
|
2683
|
+
(click)="trailingClick.emit()"
|
|
2684
|
+
>
|
|
2685
|
+
<loro-icon
|
|
2686
|
+
[name]="trailingIcon()!"
|
|
2687
|
+
[size]="trailingIconSize()"
|
|
2688
|
+
alt=""
|
|
2689
|
+
[decorative]="true"
|
|
2690
|
+
[color]="resolvedTrailingIconColor()"
|
|
2691
|
+
/>
|
|
2692
|
+
</button>
|
|
2693
|
+
}
|
|
2694
|
+
</span>
|
|
2695
|
+
@if (hasError() && errorText()) {
|
|
2696
|
+
<span class="loro-input__error" [id]="errorId">
|
|
2697
|
+
<loro-icon name="shield-alert" [size]="16" color="danger" [decorative]="true" />
|
|
2698
|
+
<span>{{ errorText() }}</span>
|
|
2699
|
+
</span>
|
|
2700
|
+
} @else if (hasLoading() && helperText()) {
|
|
2701
|
+
<span class="loro-input__loading" aria-live="polite">
|
|
2702
|
+
<span class="loro-input__loader" aria-hidden="true"></span>
|
|
2703
|
+
<span>{{ helperText() }}</span>
|
|
2704
|
+
</span>
|
|
2705
|
+
} @else if (hasSuccess() && helperText()) {
|
|
2706
|
+
<span class="loro-input__success">
|
|
2707
|
+
<loro-icon name="check" [size]="16" color="success" [decorative]="true" />
|
|
2708
|
+
<span>{{ helperText() }}</span>
|
|
2709
|
+
</span>
|
|
2710
|
+
} @else if (helperText()) {
|
|
2711
|
+
<span class="loro-input__helper">{{ helperText() }}</span>
|
|
2712
|
+
}
|
|
2713
|
+
</label>
|
|
2714
|
+
}
|
|
2715
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-input{display:grid;gap:.55rem;color:var(--loro-text)}.loro-input__label{color:var(--loro-muted-strong);font-size:var(--loro-input-label-font-size, .95rem);font-weight:var(--loro-input-label-font-weight, 800);line-height:var(--loro-input-label-line-height, 1.2)}.loro-input__control{display:grid;grid-template-columns:minmax(0,1fr);align-items:center;min-height:var(--loro-input-control-min-height, 3.4rem);padding:var(--loro-input-control-padding, 0 1rem);border:1px solid var(--loro-input-control-border-color, var(--loro-border-subtle));border-radius:var(--loro-input-control-radius, var(--loro-radius-input));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:var(--loro-input-control-shadow, none);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.loro-input--has-icon .loro-input__control{grid-template-columns:auto minmax(0,1fr);gap:var(--loro-input-control-gap, .8rem)}.loro-input--has-icon:has(.loro-input__trailing-button) .loro-input__control{grid-template-columns:auto minmax(0,1fr) auto}.loro-input__control input{font-size:var(--loro-input-field-font-size, 1rem);line-height:var(--loro-input-field-line-height, 1.2)}input{width:100%;border:0;outline:0;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:var(--loro-input-field-font-weight, 700)}input::placeholder{color:var(--loro-muted);font-weight:var(--loro-input-placeholder-font-weight, 600);opacity:var(--loro-input-placeholder-opacity, 1)}.loro-input__trailing-button{display:grid;width:2.5rem;height:2.5rem;place-items:center;margin-right:-.55rem;border:0;border-radius:50%;color:var(--loro-muted);background:transparent;cursor:pointer;transition:background .15s ease,color .15s ease}.loro-input__trailing-button:hover,.loro-input__trailing-button:focus-visible{color:var(--loro-primary-700);background:color-mix(in srgb,var(--loro-primary-500) 10%,transparent);outline:none}.loro-input--error .loro-input__control{border-color:color-mix(in srgb,var(--loro-danger-text) 28%,var(--loro-border-subtle));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-input--error .loro-input--stepper{border-color:color-mix(in srgb,var(--loro-danger-text) 28%,var(--loro-border-subtle));background:var(--loro-surface);box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-input--error .loro-input__label{color:color-mix(in srgb,var(--loro-danger-text) 68%,var(--loro-muted-strong))}.loro-input--success .loro-input__control{border-color:color-mix(in srgb,var(--loro-success, #1f9d55) 34%,var(--loro-border-subtle));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-success, #1f9d55) 10%,transparent)}.loro-input--success .loro-input--stepper{border-color:color-mix(in srgb,var(--loro-success, #1f9d55) 34%,var(--loro-border-subtle));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-success, #1f9d55) 10%,transparent)}.loro-input--success .loro-input__label{color:color-mix(in srgb,var(--loro-success, #1f9d55) 72%,var(--loro-muted-strong))}.loro-input--loading .loro-input__control{border-color:color-mix(in srgb,var(--loro-primary-500) 22%,var(--loro-border-subtle));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 8%,transparent)}.loro-input__control:focus-within{border-color:var(--loro-input-control-focus-border-color, var(--loro-primary-500));box-shadow:var(--loro-input-control-focus-shadow, 0 0 0 3px color-mix(in srgb, var(--loro-primary-500) 16%, transparent))}.loro-input__error{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.4rem;color:var(--loro-danger-text);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__helper{display:inline-block;color:var(--loro-muted);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__success{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.4rem;color:var(--loro-success, #1f9d55);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__loading{display:flex;align-items:center;gap:.35rem;color:var(--loro-primary-700);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__loader{width:1rem;height:1rem;border:2px solid color-mix(in srgb,var(--loro-primary-500) 18%,transparent);border-top-color:var(--loro-primary-500);border-radius:50%;animation:loro-input-spin .75s linear infinite}.loro-input--stepper{display:grid;grid-template-columns:1.85rem minmax(3.9rem,1fr) 1.85rem;align-items:center;min-width:0;min-height:2.25rem;overflow:hidden;border:1px solid color-mix(in srgb,var(--loro-primary-500) 12%,var(--loro-border-subtle) 88%);border-radius:.65rem;background:var(--loro-surface);color:var(--loro-text-strong);font-weight:900;text-align:center;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-surface) 70%,transparent)}.loro-input--stepper button{height:100%;min-width:0;border:0;background:transparent;color:var(--loro-primary-700);font:inherit;font-weight:950;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.loro-input--stepper button:active{background:color-mix(in srgb,var(--loro-primary-500) 10%,var(--loro-surface) 90%)}.loro-input__stepper-value{display:inline-grid;grid-template-columns:minmax(1.55rem,max-content) auto;align-items:center;justify-content:center;gap:.18rem;min-width:0;overflow:hidden;padding-inline:.1rem;white-space:nowrap}.loro-input--stepper input{width:auto;min-width:1.55rem;max-width:2.75rem;overflow:hidden;padding:0;text-align:right;text-overflow:clip;white-space:nowrap;font-weight:900;font-size:clamp(.85rem,2.4vw,.98rem);letter-spacing:-.02em}.loro-input__stepper-value span{min-width:1.05rem;color:var(--loro-text-strong);font-size:clamp(.8rem,2.2vw,.92rem);font-weight:950;line-height:1}.loro-input--stepper-kg input{min-width:2.1rem;max-width:2.35rem}@media(max-width:1023.88px){.loro-input__control input{font-size:16px}.loro-input--stepper{grid-template-columns:1.65rem minmax(3.65rem,1fr) 1.65rem;min-height:2.2rem}.loro-input__stepper-value{gap:.16rem}}@keyframes loro-input-spin{to{transform:rotate(360deg)}}@keyframes loro-input-dot-blink{0%,20%{opacity:.25}50%{opacity:1}to{opacity:.25}}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2716
|
+
}
|
|
2717
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroInput, decorators: [{
|
|
2718
|
+
type: Component,
|
|
2719
|
+
args: [{ selector: 'loro-input', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2720
|
+
@if (variant() === 'stepper') {
|
|
2721
|
+
<span
|
|
2722
|
+
class="loro-input loro-input--stepper-field"
|
|
2723
|
+
[class.loro-input--error]="hasError()"
|
|
2724
|
+
[class.loro-input--success]="hasSuccess()">
|
|
2725
|
+
@if (label()) {
|
|
2726
|
+
<span class="loro-input__label">{{ label() }}</span>
|
|
2727
|
+
}
|
|
2728
|
+
<span
|
|
2729
|
+
class="loro-input--stepper"
|
|
2730
|
+
[class.loro-input--stepper-kg]="normalizedUnit() === 'kg'"
|
|
2731
|
+
[class.loro-input--stepper-ud]="normalizedUnit() === 'ud'"
|
|
2732
|
+
role="group"
|
|
2733
|
+
[attr.aria-label]="label() || 'Cantidad'"
|
|
2734
|
+
>
|
|
2735
|
+
<button type="button" aria-label="Restar" [disabled]="disabled()" (click)="adjust(-step())">-</button>
|
|
2736
|
+
<span class="loro-input__stepper-value">
|
|
2737
|
+
<input
|
|
2738
|
+
#control
|
|
2739
|
+
[attr.inputmode]="normalizedUnit() === 'kg' ? 'decimal' : 'numeric'"
|
|
2740
|
+
[attr.size]="stepperInputSize()"
|
|
2741
|
+
[attr.maxlength]="stepperInputMaxLength()"
|
|
2742
|
+
[attr.max]="max()"
|
|
2743
|
+
[attr.min]="min()"
|
|
2744
|
+
[value]="value()"
|
|
2745
|
+
[disabled]="disabled()"
|
|
2746
|
+
[readonly]="readonly()"
|
|
2747
|
+
[required]="required()"
|
|
2748
|
+
[attr.aria-label]="label() || 'Cantidad'"
|
|
2749
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2750
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2751
|
+
(keydown.enter)="$any($event.target).blur()"
|
|
2752
|
+
(input)="sanitizeStepperInput($event)"
|
|
2753
|
+
(blur)="markAsTouched(); normalizeValue(($any($event.target).value ?? '').toString())"
|
|
2754
|
+
/>
|
|
2755
|
+
<span>{{ normalizedUnit() }}</span>
|
|
2756
|
+
</span>
|
|
2757
|
+
<button type="button" aria-label="Sumar" [disabled]="disabled()" (click)="adjust(step())">+</button>
|
|
2758
|
+
</span>
|
|
2759
|
+
@if (hasError() && errorText()) {
|
|
2760
|
+
<span class="loro-input__error" [id]="errorId">
|
|
2761
|
+
<loro-icon name="shield-alert" [size]="16" color="danger" [decorative]="true" />
|
|
2762
|
+
<span>{{ errorText() }}</span>
|
|
2763
|
+
</span>
|
|
2764
|
+
} @else if (hasLoading() && helperText()) {
|
|
2765
|
+
<span class="loro-input__loading" aria-live="polite">
|
|
2766
|
+
<span>{{ helperText() }}</span>
|
|
2767
|
+
</span>
|
|
2768
|
+
} @else if (hasSuccess() && helperText()) {
|
|
2769
|
+
<span class="loro-input__success">
|
|
2770
|
+
<loro-icon name="check" [size]="16" color="success" [decorative]="true" />
|
|
2771
|
+
<span>{{ helperText() }}</span>
|
|
2772
|
+
</span>
|
|
2773
|
+
} @else if (helperText()) {
|
|
2774
|
+
<span class="loro-input__helper">{{ helperText() }}</span>
|
|
2775
|
+
}
|
|
2776
|
+
</span>
|
|
2777
|
+
} @else {
|
|
2778
|
+
<label
|
|
2779
|
+
class="loro-input"
|
|
2780
|
+
[class.loro-input--has-icon]="icon() || variant() === 'search'"
|
|
2781
|
+
[class.loro-input--error]="hasError()"
|
|
2782
|
+
[class.loro-input--success]="hasSuccess()"
|
|
2783
|
+
[class.loro-input--loading]="hasLoading()"
|
|
2784
|
+
>
|
|
2785
|
+
@if (label()) {
|
|
2786
|
+
<span class="loro-input__label">{{ label() }}</span>
|
|
2787
|
+
}
|
|
2788
|
+
<span class="loro-input__control">
|
|
2789
|
+
@if (icon() || variant() === 'search') {
|
|
2790
|
+
<loro-icon
|
|
2791
|
+
[name]="icon() || 'search'"
|
|
2792
|
+
[size]="iconSize()"
|
|
2793
|
+
[alt]="label() || placeholder()"
|
|
2794
|
+
[color]="resolvedLeadingIconColor()"
|
|
2795
|
+
/>
|
|
2796
|
+
}
|
|
2797
|
+
<input
|
|
2798
|
+
#control
|
|
2799
|
+
[type]="type()"
|
|
2800
|
+
[attr.name]="name() || null"
|
|
2801
|
+
[placeholder]="placeholder()"
|
|
2802
|
+
[value]="value()"
|
|
2803
|
+
[disabled]="disabled()"
|
|
2804
|
+
[readonly]="readonly()"
|
|
2805
|
+
[required]="required()"
|
|
2806
|
+
[attr.autocomplete]="autocomplete() || null"
|
|
2807
|
+
[attr.inputmode]="inputmode() || null"
|
|
2808
|
+
[attr.aria-invalid]="hasError() ? 'true' : null"
|
|
2809
|
+
[attr.aria-describedby]="hasError() && errorText() ? errorId : null"
|
|
2810
|
+
(input)="updateValue(($any($event.target).value ?? '').toString())"
|
|
2811
|
+
(blur)="markAsTouched()"
|
|
2812
|
+
/>
|
|
2813
|
+
@if (trailingIcon()) {
|
|
2814
|
+
<button
|
|
2815
|
+
type="button"
|
|
2816
|
+
class="loro-input__trailing-button"
|
|
2817
|
+
[attr.aria-label]="trailingAriaLabel() || null"
|
|
2818
|
+
(click)="trailingClick.emit()"
|
|
2819
|
+
>
|
|
2820
|
+
<loro-icon
|
|
2821
|
+
[name]="trailingIcon()!"
|
|
2822
|
+
[size]="trailingIconSize()"
|
|
2823
|
+
alt=""
|
|
2824
|
+
[decorative]="true"
|
|
2825
|
+
[color]="resolvedTrailingIconColor()"
|
|
2826
|
+
/>
|
|
2827
|
+
</button>
|
|
2828
|
+
}
|
|
2829
|
+
</span>
|
|
2830
|
+
@if (hasError() && errorText()) {
|
|
2831
|
+
<span class="loro-input__error" [id]="errorId">
|
|
2832
|
+
<loro-icon name="shield-alert" [size]="16" color="danger" [decorative]="true" />
|
|
2833
|
+
<span>{{ errorText() }}</span>
|
|
2834
|
+
</span>
|
|
2835
|
+
} @else if (hasLoading() && helperText()) {
|
|
2836
|
+
<span class="loro-input__loading" aria-live="polite">
|
|
2837
|
+
<span class="loro-input__loader" aria-hidden="true"></span>
|
|
2838
|
+
<span>{{ helperText() }}</span>
|
|
2839
|
+
</span>
|
|
2840
|
+
} @else if (hasSuccess() && helperText()) {
|
|
2841
|
+
<span class="loro-input__success">
|
|
2842
|
+
<loro-icon name="check" [size]="16" color="success" [decorative]="true" />
|
|
2843
|
+
<span>{{ helperText() }}</span>
|
|
2844
|
+
</span>
|
|
2845
|
+
} @else if (helperText()) {
|
|
2846
|
+
<span class="loro-input__helper">{{ helperText() }}</span>
|
|
2847
|
+
}
|
|
2848
|
+
</label>
|
|
2849
|
+
}
|
|
2850
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-input{display:grid;gap:.55rem;color:var(--loro-text)}.loro-input__label{color:var(--loro-muted-strong);font-size:var(--loro-input-label-font-size, .95rem);font-weight:var(--loro-input-label-font-weight, 800);line-height:var(--loro-input-label-line-height, 1.2)}.loro-input__control{display:grid;grid-template-columns:minmax(0,1fr);align-items:center;min-height:var(--loro-input-control-min-height, 3.4rem);padding:var(--loro-input-control-padding, 0 1rem);border:1px solid var(--loro-input-control-border-color, var(--loro-border-subtle));border-radius:var(--loro-input-control-radius, var(--loro-radius-input));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:var(--loro-input-control-shadow, none);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}.loro-input--has-icon .loro-input__control{grid-template-columns:auto minmax(0,1fr);gap:var(--loro-input-control-gap, .8rem)}.loro-input--has-icon:has(.loro-input__trailing-button) .loro-input__control{grid-template-columns:auto minmax(0,1fr) auto}.loro-input__control input{font-size:var(--loro-input-field-font-size, 1rem);line-height:var(--loro-input-field-line-height, 1.2)}input{width:100%;border:0;outline:0;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:var(--loro-input-field-font-weight, 700)}input::placeholder{color:var(--loro-muted);font-weight:var(--loro-input-placeholder-font-weight, 600);opacity:var(--loro-input-placeholder-opacity, 1)}.loro-input__trailing-button{display:grid;width:2.5rem;height:2.5rem;place-items:center;margin-right:-.55rem;border:0;border-radius:50%;color:var(--loro-muted);background:transparent;cursor:pointer;transition:background .15s ease,color .15s ease}.loro-input__trailing-button:hover,.loro-input__trailing-button:focus-visible{color:var(--loro-primary-700);background:color-mix(in srgb,var(--loro-primary-500) 10%,transparent);outline:none}.loro-input--error .loro-input__control{border-color:color-mix(in srgb,var(--loro-danger-text) 28%,var(--loro-border-subtle));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-input--error .loro-input--stepper{border-color:color-mix(in srgb,var(--loro-danger-text) 28%,var(--loro-border-subtle));background:var(--loro-surface);box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-danger-text) 7%,transparent)}.loro-input--error .loro-input__label{color:color-mix(in srgb,var(--loro-danger-text) 68%,var(--loro-muted-strong))}.loro-input--success .loro-input__control{border-color:color-mix(in srgb,var(--loro-success, #1f9d55) 34%,var(--loro-border-subtle));background:var(--loro-input-control-background, var(--loro-surface));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-success, #1f9d55) 10%,transparent)}.loro-input--success .loro-input--stepper{border-color:color-mix(in srgb,var(--loro-success, #1f9d55) 34%,var(--loro-border-subtle));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-success, #1f9d55) 10%,transparent)}.loro-input--success .loro-input__label{color:color-mix(in srgb,var(--loro-success, #1f9d55) 72%,var(--loro-muted-strong))}.loro-input--loading .loro-input__control{border-color:color-mix(in srgb,var(--loro-primary-500) 22%,var(--loro-border-subtle));box-shadow:0 0 0 3px color-mix(in srgb,var(--loro-primary-500) 8%,transparent)}.loro-input__control:focus-within{border-color:var(--loro-input-control-focus-border-color, var(--loro-primary-500));box-shadow:var(--loro-input-control-focus-shadow, 0 0 0 3px color-mix(in srgb, var(--loro-primary-500) 16%, transparent))}.loro-input__error{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.4rem;color:var(--loro-danger-text);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__helper{display:inline-block;color:var(--loro-muted);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__success{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.4rem;color:var(--loro-success, #1f9d55);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__loading{display:flex;align-items:center;gap:.35rem;color:var(--loro-primary-700);font-size:var(--loro-input-support-font-size, .82rem);font-weight:var(--loro-input-support-font-weight, 750);line-height:var(--loro-input-support-line-height, 1.35)}.loro-input__loader{width:1rem;height:1rem;border:2px solid color-mix(in srgb,var(--loro-primary-500) 18%,transparent);border-top-color:var(--loro-primary-500);border-radius:50%;animation:loro-input-spin .75s linear infinite}.loro-input--stepper{display:grid;grid-template-columns:1.85rem minmax(3.9rem,1fr) 1.85rem;align-items:center;min-width:0;min-height:2.25rem;overflow:hidden;border:1px solid color-mix(in srgb,var(--loro-primary-500) 12%,var(--loro-border-subtle) 88%);border-radius:.65rem;background:var(--loro-surface);color:var(--loro-text-strong);font-weight:900;text-align:center;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--loro-surface) 70%,transparent)}.loro-input--stepper button{height:100%;min-width:0;border:0;background:transparent;color:var(--loro-primary-700);font:inherit;font-weight:950;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.loro-input--stepper button:active{background:color-mix(in srgb,var(--loro-primary-500) 10%,var(--loro-surface) 90%)}.loro-input__stepper-value{display:inline-grid;grid-template-columns:minmax(1.55rem,max-content) auto;align-items:center;justify-content:center;gap:.18rem;min-width:0;overflow:hidden;padding-inline:.1rem;white-space:nowrap}.loro-input--stepper input{width:auto;min-width:1.55rem;max-width:2.75rem;overflow:hidden;padding:0;text-align:right;text-overflow:clip;white-space:nowrap;font-weight:900;font-size:clamp(.85rem,2.4vw,.98rem);letter-spacing:-.02em}.loro-input__stepper-value span{min-width:1.05rem;color:var(--loro-text-strong);font-size:clamp(.8rem,2.2vw,.92rem);font-weight:950;line-height:1}.loro-input--stepper-kg input{min-width:2.1rem;max-width:2.35rem}@media(max-width:1023.88px){.loro-input__control input{font-size:16px}.loro-input--stepper{grid-template-columns:1.65rem minmax(3.65rem,1fr) 1.65rem;min-height:2.2rem}.loro-input__stepper-value{gap:.16rem}}@keyframes loro-input-spin{to{transform:rotate(360deg)}}@keyframes loro-input-dot-blink{0%,20%{opacity:.25}50%{opacity:1}to{opacity:.25}}\n"] }]
|
|
2851
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], helperText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helperText", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], inputmode: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputmode", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], trailingIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIcon", required: false }] }], trailingIconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingIconSize", required: false }] }], trailingAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "trailingAriaLabel", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], trailingClick: [{ type: i0.Output, args: ["trailingClick"] }], control: [{ type: i0.ViewChild, args: ['control', { isSignal: true }] }] } });
|
|
2852
|
+
|
|
2853
|
+
class LoroRadio {
|
|
2854
|
+
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
2855
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2856
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
2857
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
2858
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
2859
|
+
selected = output();
|
|
2860
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroRadio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2861
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroRadio, isStandalone: true, selector: "loro-radio", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, ngImport: i0, template: `
|
|
2862
|
+
<button
|
|
2863
|
+
type="button"
|
|
2864
|
+
class="loro-radio"
|
|
2865
|
+
[class.loro-radio--row]="variant() === 'row'"
|
|
2866
|
+
[class.loro-radio--checked]="checked()"
|
|
2867
|
+
[attr.aria-pressed]="checked()"
|
|
2868
|
+
(click)="selected.emit(value())">
|
|
2869
|
+
@if (variant() !== 'row') {
|
|
2870
|
+
<span class="loro-radio__mark"></span>
|
|
2871
|
+
}
|
|
2872
|
+
<span class="loro-radio__copy">
|
|
2873
|
+
<span class="loro-radio__label">{{ label() }}</span>
|
|
2874
|
+
@if (description()) {
|
|
2875
|
+
<span class="loro-radio__description">{{ description() }}</span>
|
|
2876
|
+
}
|
|
2877
|
+
</span>
|
|
2878
|
+
@if (variant() === 'row') {
|
|
2879
|
+
<span class="loro-radio__mark"></span>
|
|
2880
|
+
}
|
|
2881
|
+
</button>
|
|
2882
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-radio{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.85rem;width:100%;min-height:3rem;border:0;background:transparent;color:var(--loro-text-strong);font:inherit;text-align:left;cursor:pointer}.loro-radio--row{grid-template-columns:minmax(0,1fr) auto;min-height:4.35rem;padding:0 1rem;border:1px solid var(--loro-border-subtle);background:var(--loro-surface)}.loro-radio__mark{position:relative;width:1.35rem;height:1.35rem;border:2px solid var(--loro-muted);border-radius:50%}.loro-radio__mark:after{position:absolute;inset:.24rem;border-radius:50%;background:var(--loro-primary-500);opacity:0;content:\"\"}.loro-radio--checked .loro-radio__mark{border-color:var(--loro-primary-500)}.loro-radio--checked .loro-radio__mark:after{opacity:1}.loro-radio__copy{display:grid;gap:.18rem;min-width:0}.loro-radio__label{font-size:1rem;font-weight:900;line-height:1.2}.loro-radio__description{color:var(--loro-muted);font-size:.88rem;font-weight:600;line-height:1.35}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2883
|
+
}
|
|
2884
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroRadio, decorators: [{
|
|
2885
|
+
type: Component,
|
|
2886
|
+
args: [{ selector: 'loro-radio', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2887
|
+
<button
|
|
2888
|
+
type="button"
|
|
2889
|
+
class="loro-radio"
|
|
2890
|
+
[class.loro-radio--row]="variant() === 'row'"
|
|
2891
|
+
[class.loro-radio--checked]="checked()"
|
|
2892
|
+
[attr.aria-pressed]="checked()"
|
|
2893
|
+
(click)="selected.emit(value())">
|
|
2894
|
+
@if (variant() !== 'row') {
|
|
2895
|
+
<span class="loro-radio__mark"></span>
|
|
2896
|
+
}
|
|
2897
|
+
<span class="loro-radio__copy">
|
|
2898
|
+
<span class="loro-radio__label">{{ label() }}</span>
|
|
2899
|
+
@if (description()) {
|
|
2900
|
+
<span class="loro-radio__description">{{ description() }}</span>
|
|
2901
|
+
}
|
|
2902
|
+
</span>
|
|
2903
|
+
@if (variant() === 'row') {
|
|
2904
|
+
<span class="loro-radio__mark"></span>
|
|
2905
|
+
}
|
|
2906
|
+
</button>
|
|
2907
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-radio{display:inline-grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.85rem;width:100%;min-height:3rem;border:0;background:transparent;color:var(--loro-text-strong);font:inherit;text-align:left;cursor:pointer}.loro-radio--row{grid-template-columns:minmax(0,1fr) auto;min-height:4.35rem;padding:0 1rem;border:1px solid var(--loro-border-subtle);background:var(--loro-surface)}.loro-radio__mark{position:relative;width:1.35rem;height:1.35rem;border:2px solid var(--loro-muted);border-radius:50%}.loro-radio__mark:after{position:absolute;inset:.24rem;border-radius:50%;background:var(--loro-primary-500);opacity:0;content:\"\"}.loro-radio--checked .loro-radio__mark{border-color:var(--loro-primary-500)}.loro-radio--checked .loro-radio__mark:after{opacity:1}.loro-radio__copy{display:grid;gap:.18rem;min-width:0}.loro-radio__label{font-size:1rem;font-weight:900;line-height:1.2}.loro-radio__description{color:var(--loro-muted);font-size:.88rem;font-weight:600;line-height:1.35}\n"] }]
|
|
2908
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }] } });
|
|
2909
|
+
|
|
2910
|
+
class LoroSegmentedControl {
|
|
2911
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
2912
|
+
value = input.required(...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2913
|
+
valueChange = output();
|
|
2914
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSegmentedControl, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2915
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroSegmentedControl, isStandalone: true, selector: "loro-segmented-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { properties: { "style.--loro-segmented-count": "options().length" } }, ngImport: i0, template: `
|
|
2916
|
+
<div class="loro-segmented-control" role="tablist">
|
|
2917
|
+
@for (option of options(); track option.value) {
|
|
2918
|
+
<button
|
|
2919
|
+
type="button"
|
|
2920
|
+
role="tab"
|
|
2921
|
+
[attr.aria-selected]="value() === option.value"
|
|
2922
|
+
[class.loro-segmented-control__button--active]="value() === option.value"
|
|
2923
|
+
class="loro-segmented-control__button"
|
|
2924
|
+
(click)="valueChange.emit(option.value)">
|
|
2925
|
+
{{ option.label }}
|
|
2926
|
+
</button>
|
|
2927
|
+
}
|
|
2928
|
+
</div>
|
|
2929
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-segmented-control{display:grid;grid-template-columns:repeat(var(--loro-segmented-count, 2),minmax(0,1fr));min-height:3.15rem;padding:.18rem;border:1px solid var(--loro-border-subtle);border-radius:.75rem;background:var(--loro-surface-muted);box-shadow:var(--loro-shadow-soft)}.loro-segmented-control__button{border:0;border-radius:.58rem;background:transparent;color:var(--loro-muted-strong);font:inherit;font-size:clamp(.95rem,3vw,1rem);font-weight:850;line-height:1.15;text-wrap:balance;cursor:pointer}.loro-segmented-control__button--active{background:var(--loro-surface);color:var(--loro-primary-700);box-shadow:0 6px 18px #22194914}@media(max-width:640px){.loro-segmented-control{min-height:3rem}.loro-segmented-control__button{padding-inline:.6rem}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2930
|
+
}
|
|
2931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSegmentedControl, decorators: [{
|
|
2932
|
+
type: Component,
|
|
2933
|
+
args: [{ selector: 'loro-segmented-control', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2934
|
+
<div class="loro-segmented-control" role="tablist">
|
|
2935
|
+
@for (option of options(); track option.value) {
|
|
2936
|
+
<button
|
|
2937
|
+
type="button"
|
|
2938
|
+
role="tab"
|
|
2939
|
+
[attr.aria-selected]="value() === option.value"
|
|
2940
|
+
[class.loro-segmented-control__button--active]="value() === option.value"
|
|
2941
|
+
class="loro-segmented-control__button"
|
|
2942
|
+
(click)="valueChange.emit(option.value)">
|
|
2943
|
+
{{ option.label }}
|
|
2944
|
+
</button>
|
|
2945
|
+
}
|
|
2946
|
+
</div>
|
|
2947
|
+
`, host: {
|
|
2948
|
+
'[style.--loro-segmented-count]': 'options().length'
|
|
2949
|
+
}, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-segmented-control{display:grid;grid-template-columns:repeat(var(--loro-segmented-count, 2),minmax(0,1fr));min-height:3.15rem;padding:.18rem;border:1px solid var(--loro-border-subtle);border-radius:.75rem;background:var(--loro-surface-muted);box-shadow:var(--loro-shadow-soft)}.loro-segmented-control__button{border:0;border-radius:.58rem;background:transparent;color:var(--loro-muted-strong);font:inherit;font-size:clamp(.95rem,3vw,1rem);font-weight:850;line-height:1.15;text-wrap:balance;cursor:pointer}.loro-segmented-control__button--active{background:var(--loro-surface);color:var(--loro-primary-700);box-shadow:0 6px 18px #22194914}@media(max-width:640px){.loro-segmented-control{min-height:3rem}.loro-segmented-control__button{padding-inline:.6rem}}\n"] }]
|
|
2950
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
2951
|
+
|
|
2952
|
+
class LoroSelect {
|
|
2953
|
+
title = input.required(...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
2954
|
+
subtitle = input('', ...(ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []));
|
|
2955
|
+
meta = input('', ...(ngDevMode ? [{ debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
2956
|
+
icon = input('phone', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
2957
|
+
badge = input('', ...(ngDevMode ? [{ debugName: "badge" }] : /* istanbul ignore next */ []));
|
|
2958
|
+
status = input('', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
2959
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
2960
|
+
actionLabel = input('', ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
2961
|
+
action = output();
|
|
2962
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2963
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroSelect, isStandalone: true, selector: "loro-select", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action" }, ngImport: i0, template: `
|
|
2964
|
+
<article class="loro-select" [class.loro-select--selected]="selected()">
|
|
2965
|
+
<span class="loro-select__icon">
|
|
2966
|
+
<loro-icon [name]="icon()" [size]="44" [alt]="title()" color="primary-deep" />
|
|
2967
|
+
</span>
|
|
2968
|
+
<div class="loro-select__copy">
|
|
2969
|
+
<h3>{{ title() }} @if (badge()) {<loro-badge [label]="badge()" variant="info" />}</h3>
|
|
2970
|
+
<p>{{ subtitle() }}</p>
|
|
2971
|
+
<small>{{ meta() }}</small>
|
|
2972
|
+
</div>
|
|
2973
|
+
<div class="loro-select__side">
|
|
2974
|
+
@if (status()) {
|
|
2975
|
+
<span class="loro-select__status">{{ status() }}</span>
|
|
2976
|
+
}
|
|
2977
|
+
@if (actionLabel()) {
|
|
2978
|
+
<loro-button [label]="actionLabel()" variant="outline" (buttonClick)="action.emit()" />
|
|
2979
|
+
}
|
|
2980
|
+
</div>
|
|
2981
|
+
</article>
|
|
2982
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-select{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1.25rem;padding:1rem;border-top:1px solid var(--loro-border-subtle);background:transparent}.loro-select--selected{border:1px solid rgba(108,60,255,.28);border-radius:1rem;background:#6c3cff0a}.loro-select__icon{display:grid;width:5.2rem;height:5.2rem;place-items:center;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-muted)}h3,p,small{margin:0}h3{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;color:var(--loro-text-strong);font-size:1.15rem;font-weight:900}p{margin-top:.35rem;color:var(--loro-muted-strong);font-weight:700}small,.loro-select__status{color:var(--loro-muted);font-weight:700}.loro-select__side{display:flex;align-items:center;justify-content:flex-end;gap:1rem}@media(max-width:680px){.loro-select{grid-template-columns:5rem minmax(0,1fr);border:1px solid var(--loro-border-subtle);border-radius:1rem}.loro-select__side{grid-column:2;justify-content:flex-start}}\n"], dependencies: [{ kind: "component", type: LoroBadge$1, selector: "loro-badge", inputs: ["label", "variant"] }, { kind: "component", type: LoroButton$1, selector: "loro-button", inputs: ["label", "text", "icon", "iconContent", "iconMode", "iconSize", "iconButtonSize", "iconColor", "socialMobileCompact", "selected", "variant", "typeButton", "color", "size", "fullWidth", "buttonWidth", "disabled", "loading", "type", "formId", "ariaLabel", "ariaDescription"], outputs: ["buttonClick", "change", "sanChange"] }, { kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2983
|
+
}
|
|
2984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroSelect, decorators: [{
|
|
2985
|
+
type: Component,
|
|
2986
|
+
args: [{ selector: 'loro-select', standalone: true, imports: [LoroBadge$1, LoroButton$1, LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
2987
|
+
<article class="loro-select" [class.loro-select--selected]="selected()">
|
|
2988
|
+
<span class="loro-select__icon">
|
|
2989
|
+
<loro-icon [name]="icon()" [size]="44" [alt]="title()" color="primary-deep" />
|
|
2990
|
+
</span>
|
|
2991
|
+
<div class="loro-select__copy">
|
|
2992
|
+
<h3>{{ title() }} @if (badge()) {<loro-badge [label]="badge()" variant="info" />}</h3>
|
|
2993
|
+
<p>{{ subtitle() }}</p>
|
|
2994
|
+
<small>{{ meta() }}</small>
|
|
2995
|
+
</div>
|
|
2996
|
+
<div class="loro-select__side">
|
|
2997
|
+
@if (status()) {
|
|
2998
|
+
<span class="loro-select__status">{{ status() }}</span>
|
|
2999
|
+
}
|
|
3000
|
+
@if (actionLabel()) {
|
|
3001
|
+
<loro-button [label]="actionLabel()" variant="outline" (buttonClick)="action.emit()" />
|
|
3002
|
+
}
|
|
3003
|
+
</div>
|
|
3004
|
+
</article>
|
|
3005
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-select{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:1.25rem;padding:1rem;border-top:1px solid var(--loro-border-subtle);background:transparent}.loro-select--selected{border:1px solid rgba(108,60,255,.28);border-radius:1rem;background:#6c3cff0a}.loro-select__icon{display:grid;width:5.2rem;height:5.2rem;place-items:center;border:1px solid var(--loro-border-subtle);border-radius:1rem;background:var(--loro-surface-muted)}h3,p,small{margin:0}h3{display:flex;flex-wrap:wrap;align-items:center;gap:.55rem;color:var(--loro-text-strong);font-size:1.15rem;font-weight:900}p{margin-top:.35rem;color:var(--loro-muted-strong);font-weight:700}small,.loro-select__status{color:var(--loro-muted);font-weight:700}.loro-select__side{display:flex;align-items:center;justify-content:flex-end;gap:1rem}@media(max-width:680px){.loro-select{grid-template-columns:5rem minmax(0,1fr);border:1px solid var(--loro-border-subtle);border-radius:1rem}.loro-select__side{grid-column:2;justify-content:flex-start}}\n"] }]
|
|
3006
|
+
}], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: true }] }], subtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "subtitle", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], action: [{ type: i0.Output, args: ["action"] }] } });
|
|
3007
|
+
|
|
3008
|
+
class LoroTextArea {
|
|
3009
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3010
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
3011
|
+
value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3012
|
+
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
3013
|
+
valueChange = output();
|
|
3014
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroTextArea, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3015
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroTextArea, isStandalone: true, selector: "loro-text-area", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, ngImport: i0, template: `
|
|
3016
|
+
<label class="loro-text-area">
|
|
3017
|
+
@if (label()) {
|
|
3018
|
+
<span class="loro-text-area__label">{{ label() }}</span>
|
|
3019
|
+
}
|
|
3020
|
+
<span class="loro-text-area__control">
|
|
3021
|
+
<textarea
|
|
3022
|
+
[placeholder]="placeholder()"
|
|
3023
|
+
[value]="value()"
|
|
3024
|
+
[attr.maxlength]="maxLength()"
|
|
3025
|
+
(input)="valueChange.emit(($any($event.target).value ?? '').toString())"></textarea>
|
|
3026
|
+
@if (maxLength()) {
|
|
3027
|
+
<span class="loro-text-area__counter">{{ value().length }}/{{ maxLength() }}</span>
|
|
3028
|
+
}
|
|
3029
|
+
</span>
|
|
3030
|
+
</label>
|
|
3031
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-text-area{display:grid;gap:.55rem}.loro-text-area__label{color:var(--loro-muted-strong);font-size:.95rem;font-weight:800}.loro-text-area__control{display:grid;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-input);background:var(--loro-surface);overflow:hidden}textarea{width:100%;min-height:8rem;resize:vertical;border:0;outline:0;padding:1rem;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:650}textarea::placeholder{color:var(--loro-muted)}.loro-text-area__counter{justify-self:end;padding:0 1rem .75rem;color:var(--loro-muted);font-size:.85rem;font-weight:700}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3032
|
+
}
|
|
3033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroTextArea, decorators: [{
|
|
3034
|
+
type: Component,
|
|
3035
|
+
args: [{ selector: 'loro-text-area', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3036
|
+
<label class="loro-text-area">
|
|
3037
|
+
@if (label()) {
|
|
3038
|
+
<span class="loro-text-area__label">{{ label() }}</span>
|
|
3039
|
+
}
|
|
3040
|
+
<span class="loro-text-area__control">
|
|
3041
|
+
<textarea
|
|
3042
|
+
[placeholder]="placeholder()"
|
|
3043
|
+
[value]="value()"
|
|
3044
|
+
[attr.maxlength]="maxLength()"
|
|
3045
|
+
(input)="valueChange.emit(($any($event.target).value ?? '').toString())"></textarea>
|
|
3046
|
+
@if (maxLength()) {
|
|
3047
|
+
<span class="loro-text-area__counter">{{ value().length }}/{{ maxLength() }}</span>
|
|
3048
|
+
}
|
|
3049
|
+
</span>
|
|
3050
|
+
</label>
|
|
3051
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-text-area{display:grid;gap:.55rem}.loro-text-area__label{color:var(--loro-muted-strong);font-size:.95rem;font-weight:800}.loro-text-area__control{display:grid;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-input);background:var(--loro-surface);overflow:hidden}textarea{width:100%;min-height:8rem;resize:vertical;border:0;outline:0;padding:1rem;background:transparent;color:var(--loro-text-strong);font:inherit;font-weight:650}textarea::placeholder{color:var(--loro-muted)}.loro-text-area__counter{justify-self:end;padding:0 1rem .75rem;color:var(--loro-muted);font-size:.85rem;font-weight:700}\n"] }]
|
|
3052
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
3053
|
+
|
|
3054
|
+
class LoroToggle {
|
|
3055
|
+
checked = input(false, ...(ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []));
|
|
3056
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
3057
|
+
ariaLabel = input('Cambiar estado', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3058
|
+
checkedChange = output();
|
|
3059
|
+
toggle() {
|
|
3060
|
+
if (this.disabled()) {
|
|
3061
|
+
return;
|
|
3062
|
+
}
|
|
3063
|
+
this.checkedChange.emit(!this.checked());
|
|
3064
|
+
}
|
|
3065
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroToggle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3066
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: LoroToggle, isStandalone: true, selector: "loro-toggle", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: `
|
|
3067
|
+
<button
|
|
3068
|
+
type="button"
|
|
3069
|
+
class="loro-toggle"
|
|
3070
|
+
[class.loro-toggle--checked]="checked()"
|
|
3071
|
+
[disabled]="disabled()"
|
|
3072
|
+
[attr.aria-label]="ariaLabel()"
|
|
3073
|
+
[attr.aria-pressed]="checked()"
|
|
3074
|
+
(click)="toggle()">
|
|
3075
|
+
<span class="loro-toggle__thumb"></span>
|
|
3076
|
+
</button>
|
|
3077
|
+
`, isInline: true, styles: [":host{display:inline-flex;flex:0 0 auto}.loro-toggle{position:relative;display:inline-flex;align-items:center;width:4rem;height:2.25rem;padding:.2rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-pill);background:var(--loro-surface-muted);cursor:pointer;transition:background .16s ease,border-color .16s ease,opacity .16s ease}.loro-toggle__thumb{display:block;width:1.85rem;height:1.85rem;border-radius:50%;background:var(--loro-surface);box-shadow:0 3px 10px #2219492e;transition:transform .16s ease}.loro-toggle--checked{border-color:color-mix(in srgb,var(--loro-primary-500) 54%,transparent);background:linear-gradient(135deg,var(--loro-primary-700),var(--loro-primary-500))}.loro-toggle--checked .loro-toggle__thumb{transform:translate(1.75rem)}.loro-toggle:disabled{cursor:not-allowed;opacity:.7}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3078
|
+
}
|
|
3079
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroToggle, decorators: [{
|
|
3080
|
+
type: Component,
|
|
3081
|
+
args: [{ selector: 'loro-toggle', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3082
|
+
<button
|
|
3083
|
+
type="button"
|
|
3084
|
+
class="loro-toggle"
|
|
3085
|
+
[class.loro-toggle--checked]="checked()"
|
|
3086
|
+
[disabled]="disabled()"
|
|
3087
|
+
[attr.aria-label]="ariaLabel()"
|
|
3088
|
+
[attr.aria-pressed]="checked()"
|
|
3089
|
+
(click)="toggle()">
|
|
3090
|
+
<span class="loro-toggle__thumb"></span>
|
|
3091
|
+
</button>
|
|
3092
|
+
`, styles: [":host{display:inline-flex;flex:0 0 auto}.loro-toggle{position:relative;display:inline-flex;align-items:center;width:4rem;height:2.25rem;padding:.2rem;border:1px solid var(--loro-border-subtle);border-radius:var(--loro-radius-pill);background:var(--loro-surface-muted);cursor:pointer;transition:background .16s ease,border-color .16s ease,opacity .16s ease}.loro-toggle__thumb{display:block;width:1.85rem;height:1.85rem;border-radius:50%;background:var(--loro-surface);box-shadow:0 3px 10px #2219492e;transition:transform .16s ease}.loro-toggle--checked{border-color:color-mix(in srgb,var(--loro-primary-500) 54%,transparent);background:linear-gradient(135deg,var(--loro-primary-700),var(--loro-primary-500))}.loro-toggle--checked .loro-toggle__thumb{transform:translate(1.75rem)}.loro-toggle:disabled{cursor:not-allowed;opacity:.7}\n"] }]
|
|
3093
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
3094
|
+
|
|
3095
|
+
class LoroUpload {
|
|
3096
|
+
label = input('Adjuntar captura', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
3097
|
+
title = input('Haz clic para seleccionar un archivo o arrastra y suelta aqui', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
3098
|
+
description = input('Formatos: PNG, JPG, GIF, PDF (max. 10 MB)', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
3099
|
+
accept = input('image/*,.pdf', ...(ngDevMode ? [{ debugName: "accept" }] : /* istanbul ignore next */ []));
|
|
3100
|
+
optional = input(true, ...(ngDevMode ? [{ debugName: "optional" }] : /* istanbul ignore next */ []));
|
|
3101
|
+
compact = input(false, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
3102
|
+
fileSelected = output();
|
|
3103
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroUpload, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3104
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroUpload, isStandalone: true, selector: "loro-upload", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileSelected: "fileSelected" }, ngImport: i0, template: `
|
|
3105
|
+
<label class="loro-upload" [class.loro-upload--compact]="compact()">
|
|
3106
|
+
@if (label()) {
|
|
3107
|
+
<span class="loro-upload__label">{{ label() }} @if (optional()) {<small>Opcional</small>}</span>
|
|
3108
|
+
}
|
|
3109
|
+
<span class="loro-upload__drop">
|
|
3110
|
+
<loro-icon name="paperclip" [size]="28" alt="Adjuntar archivo" color="primary" />
|
|
3111
|
+
<span class="loro-upload__copy">
|
|
3112
|
+
<span>{{ title() }}</span>
|
|
3113
|
+
@if (description()) {
|
|
3114
|
+
<small>{{ description() }}</small>
|
|
3115
|
+
}
|
|
3116
|
+
</span>
|
|
3117
|
+
@if (compact()) {
|
|
3118
|
+
<loro-icon name="chevron-right" [size]="22" alt="Seleccionar" color="primary" />
|
|
3119
|
+
}
|
|
3120
|
+
<input type="file" [accept]="accept()" (change)="fileSelected.emit($any($event.target).files?.[0] ?? null)" />
|
|
3121
|
+
</span>
|
|
3122
|
+
</label>
|
|
3123
|
+
`, isInline: true, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-upload{display:grid;gap:.7rem}.loro-upload__label{display:flex;gap:.75rem;color:var(--loro-text-strong);font-weight:900}.loro-upload__label small{color:var(--loro-muted);font-weight:700}.loro-upload__drop{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.85rem;min-height:4.4rem;padding:1rem;border:1px dashed var(--loro-border-strong);border-radius:var(--loro-radius-input);background:var(--loro-surface);color:var(--loro-muted-strong);cursor:pointer}.loro-upload--compact .loro-upload__drop{grid-template-columns:auto minmax(0,1fr) auto;border-style:solid}.loro-upload__copy{display:grid;gap:.15rem;font-weight:800;line-height:1.25}.loro-upload__copy small{color:var(--loro-muted);font-weight:650}input{position:absolute;inset:0;opacity:0;cursor:pointer}\n"], dependencies: [{ kind: "component", type: LoroIcon$1, selector: "loro-icon", inputs: ["name", "size", "alt", "decorative", "color", "renderMode"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3124
|
+
}
|
|
3125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroUpload, decorators: [{
|
|
3126
|
+
type: Component,
|
|
3127
|
+
args: [{ selector: 'loro-upload', standalone: true, imports: [LoroIcon$1], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3128
|
+
<label class="loro-upload" [class.loro-upload--compact]="compact()">
|
|
3129
|
+
@if (label()) {
|
|
3130
|
+
<span class="loro-upload__label">{{ label() }} @if (optional()) {<small>Opcional</small>}</span>
|
|
3131
|
+
}
|
|
3132
|
+
<span class="loro-upload__drop">
|
|
3133
|
+
<loro-icon name="paperclip" [size]="28" alt="Adjuntar archivo" color="primary" />
|
|
3134
|
+
<span class="loro-upload__copy">
|
|
3135
|
+
<span>{{ title() }}</span>
|
|
3136
|
+
@if (description()) {
|
|
3137
|
+
<small>{{ description() }}</small>
|
|
3138
|
+
}
|
|
3139
|
+
</span>
|
|
3140
|
+
@if (compact()) {
|
|
3141
|
+
<loro-icon name="chevron-right" [size]="22" alt="Seleccionar" color="primary" />
|
|
3142
|
+
}
|
|
3143
|
+
<input type="file" [accept]="accept()" (change)="fileSelected.emit($any($event.target).files?.[0] ?? null)" />
|
|
3144
|
+
</span>
|
|
3145
|
+
</label>
|
|
3146
|
+
`, styles: [":host{display:block;font-family:var(--loro-font-brand)}.loro-upload{display:grid;gap:.7rem}.loro-upload__label{display:flex;gap:.75rem;color:var(--loro-text-strong);font-weight:900}.loro-upload__label small{color:var(--loro-muted);font-weight:700}.loro-upload__drop{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:.85rem;min-height:4.4rem;padding:1rem;border:1px dashed var(--loro-border-strong);border-radius:var(--loro-radius-input);background:var(--loro-surface);color:var(--loro-muted-strong);cursor:pointer}.loro-upload--compact .loro-upload__drop{grid-template-columns:auto minmax(0,1fr) auto;border-style:solid}.loro-upload__copy{display:grid;gap:.15rem;font-weight:800;line-height:1.25}.loro-upload__copy small{color:var(--loro-muted);font-weight:650}input{position:absolute;inset:0;opacity:0;cursor:pointer}\n"] }]
|
|
3147
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], accept: [{ type: i0.Input, args: [{ isSignal: true, alias: "accept", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], fileSelected: [{ type: i0.Output, args: ["fileSelected"] }] } });
|
|
3148
|
+
|
|
3149
|
+
class LoroModal {
|
|
3150
|
+
document = inject(DOCUMENT);
|
|
3151
|
+
dragStartY = 0;
|
|
3152
|
+
dragStartTop = 0;
|
|
3153
|
+
open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
|
|
3154
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
3155
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
3156
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3157
|
+
placement = input('center', ...(ngDevMode ? [{ debugName: "placement" }] : /* istanbul ignore next */ []));
|
|
3158
|
+
dismissible = input(true, ...(ngDevMode ? [{ debugName: "dismissible" }] : /* istanbul ignore next */ []));
|
|
3159
|
+
sheetDragToClose = input(true, ...(ngDevMode ? [{ debugName: "sheetDragToClose" }] : /* istanbul ignore next */ []));
|
|
3160
|
+
sheetRestTop = input('', ...(ngDevMode ? [{ debugName: "sheetRestTop" }] : /* istanbul ignore next */ []));
|
|
3161
|
+
showBackdrop = input(true, ...(ngDevMode ? [{ debugName: "showBackdrop" }] : /* istanbul ignore next */ []));
|
|
3162
|
+
closeOnBackdrop = input(true, ...(ngDevMode ? [{ debugName: "closeOnBackdrop" }] : /* istanbul ignore next */ []));
|
|
3163
|
+
modalClose = output();
|
|
3164
|
+
sheetDragging = signal(false, ...(ngDevMode ? [{ debugName: "sheetDragging" }] : /* istanbul ignore next */ []));
|
|
3165
|
+
sheetTop = signal(null, ...(ngDevMode ? [{ debugName: "sheetTop" }] : /* istanbul ignore next */ []));
|
|
3166
|
+
sheetRestTopCss = computed(() => this.isSheetInteractionEnabled() ? `${this.collapsedSheetTop()}px` : null, ...(ngDevMode ? [{ debugName: "sheetRestTopCss" }] : /* istanbul ignore next */ []));
|
|
3167
|
+
sheetDragOffsetCss = computed(() => {
|
|
3168
|
+
if (!this.isSheetInteractionEnabled()) {
|
|
3169
|
+
return null;
|
|
3170
|
+
}
|
|
3171
|
+
return `${Math.max(0, this.currentSheetTop() - this.collapsedSheetTop())}px`;
|
|
3172
|
+
}, ...(ngDevMode ? [{ debugName: "sheetDragOffsetCss" }] : /* istanbul ignore next */ []));
|
|
3173
|
+
backdropOpacity = computed(() => {
|
|
3174
|
+
if (!this.isSheetInteractionEnabled()) {
|
|
3175
|
+
return '1';
|
|
3176
|
+
}
|
|
3177
|
+
const collapsedTop = this.collapsedSheetTop();
|
|
3178
|
+
const progress = (this.currentSheetTop() - collapsedTop) / Math.max(1, this.maxSheetTop() - collapsedTop);
|
|
3179
|
+
return String(0.42 - Math.min(0.18, progress * 0.18));
|
|
3180
|
+
}, ...(ngDevMode ? [{ debugName: "backdropOpacity" }] : /* istanbul ignore next */ []));
|
|
3181
|
+
constructor() {
|
|
3182
|
+
effect((onCleanup) => {
|
|
3183
|
+
if (this.open()) {
|
|
3184
|
+
this.resetSheetState();
|
|
3185
|
+
this.lockDocumentScroll(onCleanup);
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3188
|
+
}
|
|
3189
|
+
requestClose() {
|
|
3190
|
+
this.resetSheetState();
|
|
3191
|
+
this.modalClose.emit();
|
|
3192
|
+
}
|
|
3193
|
+
onSheetTouchStart(event, dialog) {
|
|
3194
|
+
if (!this.isSheetInteractionEnabled() || event.touches.length !== 1 || !this.isDragZone(event, dialog)) {
|
|
3195
|
+
return;
|
|
3196
|
+
}
|
|
3197
|
+
this.sheetDragging.set(true);
|
|
3198
|
+
this.dragStartY = event.touches[0].clientY;
|
|
3199
|
+
this.dragStartTop = this.currentSheetTop();
|
|
3200
|
+
event.preventDefault();
|
|
3201
|
+
}
|
|
3202
|
+
onSheetTouchMove(event) {
|
|
3203
|
+
if (!this.sheetDragging() || !this.isSheetInteractionEnabled() || event.touches.length !== 1) {
|
|
3204
|
+
return;
|
|
3205
|
+
}
|
|
3206
|
+
const deltaY = Math.max(0, event.touches[0].clientY - this.dragStartY);
|
|
3207
|
+
const nextTop = this.dragStartTop + deltaY;
|
|
3208
|
+
this.sheetTop.set(this.clampSheetTop(nextTop));
|
|
3209
|
+
event.preventDefault();
|
|
3210
|
+
}
|
|
3211
|
+
onSheetTouchEnd() {
|
|
3212
|
+
if (!this.sheetDragging()) {
|
|
3213
|
+
return;
|
|
3214
|
+
}
|
|
3215
|
+
this.sheetDragging.set(false);
|
|
3216
|
+
const currentTop = this.currentSheetTop();
|
|
3217
|
+
const collapsedTop = this.collapsedSheetTop();
|
|
3218
|
+
if (currentTop >= collapsedTop + 64) {
|
|
3219
|
+
this.requestClose();
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3222
|
+
this.sheetTop.set(collapsedTop);
|
|
3223
|
+
}
|
|
3224
|
+
resetSheetState() {
|
|
3225
|
+
this.sheetDragging.set(false);
|
|
3226
|
+
this.sheetTop.set(this.isSheetInteractionEnabled() ? this.collapsedSheetTop() : null);
|
|
3227
|
+
}
|
|
3228
|
+
currentSheetTop() {
|
|
3229
|
+
return this.sheetTop() ?? this.collapsedSheetTop();
|
|
3230
|
+
}
|
|
3231
|
+
clampSheetTop(value) {
|
|
3232
|
+
return Math.min(Math.max(value, this.collapsedSheetTop()), this.maxSheetTop());
|
|
3233
|
+
}
|
|
3234
|
+
collapsedSheetTop() {
|
|
3235
|
+
const safeTop = this.safeAreaInsetTop();
|
|
3236
|
+
return Math.max(safeTop + 12, Math.min(88, Math.round(this.viewportHeight() * 0.1)));
|
|
3237
|
+
}
|
|
3238
|
+
maxSheetTop() {
|
|
3239
|
+
return this.viewportHeight() - 56;
|
|
3240
|
+
}
|
|
3241
|
+
viewportHeight() {
|
|
3242
|
+
const win = this.document.defaultView;
|
|
3243
|
+
if (!win) {
|
|
3244
|
+
return 844;
|
|
3245
|
+
}
|
|
3246
|
+
const visualHeight = win.visualViewport?.height ?? 0;
|
|
3247
|
+
const layoutHeight = Math.max(win.innerHeight, this.document.documentElement.clientHeight);
|
|
3248
|
+
if (visualHeight > 0 && visualHeight < layoutHeight * 0.75) {
|
|
3249
|
+
return visualHeight;
|
|
3250
|
+
}
|
|
3251
|
+
return Math.max(visualHeight, layoutHeight);
|
|
3252
|
+
}
|
|
3253
|
+
safeAreaInsetTop() {
|
|
3254
|
+
const win = this.document.defaultView;
|
|
3255
|
+
if (!win) {
|
|
3256
|
+
return 0;
|
|
3257
|
+
}
|
|
3258
|
+
return Number.parseFloat(win.getComputedStyle(this.document.documentElement).getPropertyValue('env(safe-area-inset-top)')) || 0;
|
|
3259
|
+
}
|
|
3260
|
+
lockDocumentScroll(onCleanup) {
|
|
3261
|
+
const body = this.document.body;
|
|
3262
|
+
const documentElement = this.document.documentElement;
|
|
3263
|
+
const previousBodyOverflow = body.style.overflow;
|
|
3264
|
+
const previousDocumentOverflow = documentElement.style.overflow;
|
|
3265
|
+
body.style.overflow = 'hidden';
|
|
3266
|
+
documentElement.style.overflow = 'hidden';
|
|
3267
|
+
body.classList.add('loro-modal-open');
|
|
3268
|
+
documentElement.classList.add('loro-modal-open');
|
|
3269
|
+
onCleanup(() => {
|
|
3270
|
+
body.style.overflow = previousBodyOverflow;
|
|
3271
|
+
documentElement.style.overflow = previousDocumentOverflow;
|
|
3272
|
+
body.classList.remove('loro-modal-open');
|
|
3273
|
+
documentElement.classList.remove('loro-modal-open');
|
|
3274
|
+
});
|
|
3275
|
+
}
|
|
3276
|
+
isSheetInteractionEnabled() {
|
|
3277
|
+
return (this.placement() === 'sheet' &&
|
|
3278
|
+
(this.dismissible() || this.sheetDragToClose()) &&
|
|
3279
|
+
!!this.document.defaultView?.matchMedia('(max-width: 1023.88px)').matches);
|
|
3280
|
+
}
|
|
3281
|
+
isDragZone(event, dialog) {
|
|
3282
|
+
const touch = event.touches[0];
|
|
3283
|
+
if (!touch) {
|
|
3284
|
+
return false;
|
|
3285
|
+
}
|
|
3286
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
3287
|
+
if (target?.closest('.loro-notification-panel__handle, .loro-modal__header')) {
|
|
3288
|
+
return true;
|
|
3289
|
+
}
|
|
3290
|
+
const dialogTop = dialog.getBoundingClientRect().top;
|
|
3291
|
+
return touch.clientY - dialogTop <= 52;
|
|
3292
|
+
}
|
|
3293
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroModal, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3294
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroModal, isStandalone: true, selector: "loro-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, sheetDragToClose: { classPropertyName: "sheetDragToClose", publicName: "sheetDragToClose", isSignal: true, isRequired: false, transformFunction: null }, sheetRestTop: { classPropertyName: "sheetRestTop", publicName: "sheetRestTop", isSignal: true, isRequired: false, transformFunction: null }, showBackdrop: { classPropertyName: "showBackdrop", publicName: "showBackdrop", isSignal: true, isRequired: false, transformFunction: null }, closeOnBackdrop: { classPropertyName: "closeOnBackdrop", publicName: "closeOnBackdrop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { modalClose: "modalClose" }, ngImport: i0, template: `
|
|
3295
|
+
@if (open()) {
|
|
3296
|
+
<div class="loro-modal" [class]="'loro-modal loro-modal--' + placement()" role="presentation">
|
|
3297
|
+
@if (showBackdrop()) {
|
|
3298
|
+
<button
|
|
3299
|
+
type="button"
|
|
3300
|
+
class="loro-modal__backdrop"
|
|
3301
|
+
aria-label="Close modal"
|
|
3302
|
+
[style.opacity]="backdropOpacity()"
|
|
3303
|
+
(click)="closeOnBackdrop() && requestClose()"></button>
|
|
3304
|
+
}
|
|
3305
|
+
<section
|
|
3306
|
+
#dialog
|
|
3307
|
+
class="loro-modal__dialog"
|
|
3308
|
+
[class]="'loro-modal__dialog loro-modal__dialog--' + size()"
|
|
3309
|
+
[class.loro-modal__dialog--dragging]="sheetDragging()"
|
|
3310
|
+
[style.--loro-modal-sheet-drag-y]="sheetDragOffsetCss()"
|
|
3311
|
+
[style.--loro-modal-sheet-rest-top]="sheetRestTop() || sheetRestTopCss()"
|
|
3312
|
+
role="dialog"
|
|
3313
|
+
aria-modal="true"
|
|
3314
|
+
[attr.aria-label]="ariaLabel() || title()"
|
|
3315
|
+
(touchstart)="onSheetTouchStart($event, dialog)"
|
|
3316
|
+
(touchmove)="onSheetTouchMove($event)"
|
|
3317
|
+
(touchend)="onSheetTouchEnd()"
|
|
3318
|
+
(touchcancel)="onSheetTouchEnd()">
|
|
3319
|
+
@if (title() || dismissible()) {
|
|
3320
|
+
<header class="loro-modal__header">
|
|
3321
|
+
@if (title()) {
|
|
3322
|
+
<h2>{{ title() }}</h2>
|
|
3323
|
+
}
|
|
3324
|
+
@if (dismissible()) {
|
|
3325
|
+
<button type="button" class="loro-modal__close" aria-label="Cerrar modal" (click)="requestClose()">
|
|
3326
|
+
X
|
|
3327
|
+
</button>
|
|
3328
|
+
}
|
|
3329
|
+
</header>
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
<div
|
|
3333
|
+
class="loro-modal__content"
|
|
3334
|
+
[class.loro-modal__content--flush]="placement() === 'sheet' && !title()">
|
|
3335
|
+
<ng-content />
|
|
3336
|
+
</div>
|
|
3337
|
+
|
|
3338
|
+
<ng-content select="[loro-modal-actions]" />
|
|
3339
|
+
</section>
|
|
3340
|
+
</div>
|
|
3341
|
+
}
|
|
3342
|
+
`, isInline: true, styles: [":host{display:contents;font-family:var(--loro-font-brand)}.loro-modal{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;width:100vw;height:100vh;height:var(--app-fill-height, var(--app-viewport-height, 100dvh));padding:1.25rem;isolation:isolate}.loro-modal__backdrop{position:absolute;inset:0;border:0;background:#140e276b;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);cursor:pointer}.loro-modal__dialog{position:relative;z-index:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:min(100%,32rem);max-height:min(42rem,calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 2.5rem));overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:1.25rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-panel);color:var(--loro-text);transition:transform .22s cubic-bezier(.22,1,.36,1)}.loro-modal__dialog--sm{width:min(100%,24rem)}.loro-modal__dialog--lg{width:min(100%,44rem)}.loro-modal__header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;padding:1rem 1.15rem;border-bottom:1px solid var(--loro-border-subtle)}h2{margin:0;color:var(--loro-text-strong);font-size:1.08rem;font-weight:950;line-height:1.2}.loro-modal__close{display:grid;width:2.25rem;height:2.25rem;place-items:center;border:0;border-radius:50%;background:#6c3cff14;color:var(--loro-text-strong);font:inherit;font-weight:950;cursor:pointer}.loro-modal__content{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:1.15rem}::ng-deep [loro-modal-actions]{display:flex;justify-content:flex-end;gap:.75rem;padding:.9rem 1.15rem 1.15rem;border-top:1px solid var(--loro-border-subtle)}@media(max-width:1023.88px){.loro-modal{align-items:end;padding:0}.loro-modal--sheet{place-items:end stretch}.loro-modal__dialog,.loro-modal__dialog--sm,.loro-modal__dialog--md,.loro-modal__dialog--lg{width:100%;max-height:calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 1rem);border-radius:1.75rem 1.75rem 0 0}.loro-modal--sheet .loro-modal__dialog,.loro-modal--sheet .loro-modal__dialog--sm,.loro-modal--sheet .loro-modal__dialog--md,.loro-modal--sheet .loro-modal__dialog--lg{--loro-modal-sheet-rest-top: max( calc(var(--app-fill-height, 100dvh) * .3), calc(env(safe-area-inset-top, 0px) + .65rem) );position:fixed;right:0;bottom:0;left:0;top:max(var(--loro-modal-sheet-rest-top),calc(env(safe-area-inset-top,0px) + .65rem));width:100%;max-height:none;background:var(--loro-surface);overscroll-behavior-y:contain;transform:translate3d(0,var(--loro-modal-sheet-drag-y, 0px),0)}.loro-modal--sheet .loro-modal__dialog--dragging{transition:none}.loro-modal--sheet .loro-modal__content{display:grid;height:100%;min-height:0;overflow:hidden;overscroll-behavior-y:contain;padding:.85rem;background:var(--loro-surface);touch-action:pan-y}.loro-modal--sheet .loro-modal__content--flush{padding:0}.loro-modal--center{align-items:center;padding:1rem}.loro-modal--center .loro-modal__dialog{border-radius:1.15rem}::ng-deep [loro-modal-actions]{flex-direction:column-reverse;padding:.7rem .9rem max(.85rem,env(safe-area-inset-bottom,0px));background:var(--loro-surface)}}@media(min-width:1024px){.loro-modal{place-items:center;padding:2rem}.loro-modal__backdrop{background:#070a129e;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.loro-modal--center .loro-modal__dialog,.loro-modal--sheet .loro-modal__dialog{position:relative;inset:auto;max-height:min(46rem,calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 4rem));border-radius:1.5rem}.loro-modal__dialog--sm{width:min(100%,28rem)}.loro-modal__dialog--md{width:min(100%,36rem)}.loro-modal__dialog--lg{width:min(100%,60rem)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3343
|
+
}
|
|
3344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroModal, decorators: [{
|
|
3345
|
+
type: Component,
|
|
3346
|
+
args: [{ selector: 'loro-modal', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3347
|
+
@if (open()) {
|
|
3348
|
+
<div class="loro-modal" [class]="'loro-modal loro-modal--' + placement()" role="presentation">
|
|
3349
|
+
@if (showBackdrop()) {
|
|
3350
|
+
<button
|
|
3351
|
+
type="button"
|
|
3352
|
+
class="loro-modal__backdrop"
|
|
3353
|
+
aria-label="Close modal"
|
|
3354
|
+
[style.opacity]="backdropOpacity()"
|
|
3355
|
+
(click)="closeOnBackdrop() && requestClose()"></button>
|
|
3356
|
+
}
|
|
3357
|
+
<section
|
|
3358
|
+
#dialog
|
|
3359
|
+
class="loro-modal__dialog"
|
|
3360
|
+
[class]="'loro-modal__dialog loro-modal__dialog--' + size()"
|
|
3361
|
+
[class.loro-modal__dialog--dragging]="sheetDragging()"
|
|
3362
|
+
[style.--loro-modal-sheet-drag-y]="sheetDragOffsetCss()"
|
|
3363
|
+
[style.--loro-modal-sheet-rest-top]="sheetRestTop() || sheetRestTopCss()"
|
|
3364
|
+
role="dialog"
|
|
3365
|
+
aria-modal="true"
|
|
3366
|
+
[attr.aria-label]="ariaLabel() || title()"
|
|
3367
|
+
(touchstart)="onSheetTouchStart($event, dialog)"
|
|
3368
|
+
(touchmove)="onSheetTouchMove($event)"
|
|
3369
|
+
(touchend)="onSheetTouchEnd()"
|
|
3370
|
+
(touchcancel)="onSheetTouchEnd()">
|
|
3371
|
+
@if (title() || dismissible()) {
|
|
3372
|
+
<header class="loro-modal__header">
|
|
3373
|
+
@if (title()) {
|
|
3374
|
+
<h2>{{ title() }}</h2>
|
|
3375
|
+
}
|
|
3376
|
+
@if (dismissible()) {
|
|
3377
|
+
<button type="button" class="loro-modal__close" aria-label="Cerrar modal" (click)="requestClose()">
|
|
3378
|
+
X
|
|
3379
|
+
</button>
|
|
3380
|
+
}
|
|
3381
|
+
</header>
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
<div
|
|
3385
|
+
class="loro-modal__content"
|
|
3386
|
+
[class.loro-modal__content--flush]="placement() === 'sheet' && !title()">
|
|
3387
|
+
<ng-content />
|
|
3388
|
+
</div>
|
|
3389
|
+
|
|
3390
|
+
<ng-content select="[loro-modal-actions]" />
|
|
3391
|
+
</section>
|
|
3392
|
+
</div>
|
|
3393
|
+
}
|
|
3394
|
+
`, styles: [":host{display:contents;font-family:var(--loro-font-brand)}.loro-modal{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;width:100vw;height:100vh;height:var(--app-fill-height, var(--app-viewport-height, 100dvh));padding:1.25rem;isolation:isolate}.loro-modal__backdrop{position:absolute;inset:0;border:0;background:#140e276b;backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);cursor:pointer}.loro-modal__dialog{position:relative;z-index:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:min(100%,32rem);max-height:min(42rem,calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 2.5rem));overflow:hidden;border:1px solid var(--loro-border-subtle);border-radius:1.25rem;background:var(--loro-surface);box-shadow:var(--loro-shadow-panel);color:var(--loro-text);transition:transform .22s cubic-bezier(.22,1,.36,1)}.loro-modal__dialog--sm{width:min(100%,24rem)}.loro-modal__dialog--lg{width:min(100%,44rem)}.loro-modal__header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:1rem;padding:1rem 1.15rem;border-bottom:1px solid var(--loro-border-subtle)}h2{margin:0;color:var(--loro-text-strong);font-size:1.08rem;font-weight:950;line-height:1.2}.loro-modal__close{display:grid;width:2.25rem;height:2.25rem;place-items:center;border:0;border-radius:50%;background:#6c3cff14;color:var(--loro-text-strong);font:inherit;font-weight:950;cursor:pointer}.loro-modal__content{min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:1.15rem}::ng-deep [loro-modal-actions]{display:flex;justify-content:flex-end;gap:.75rem;padding:.9rem 1.15rem 1.15rem;border-top:1px solid var(--loro-border-subtle)}@media(max-width:1023.88px){.loro-modal{align-items:end;padding:0}.loro-modal--sheet{place-items:end stretch}.loro-modal__dialog,.loro-modal__dialog--sm,.loro-modal__dialog--md,.loro-modal__dialog--lg{width:100%;max-height:calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 1rem);border-radius:1.75rem 1.75rem 0 0}.loro-modal--sheet .loro-modal__dialog,.loro-modal--sheet .loro-modal__dialog--sm,.loro-modal--sheet .loro-modal__dialog--md,.loro-modal--sheet .loro-modal__dialog--lg{--loro-modal-sheet-rest-top: max( calc(var(--app-fill-height, 100dvh) * .3), calc(env(safe-area-inset-top, 0px) + .65rem) );position:fixed;right:0;bottom:0;left:0;top:max(var(--loro-modal-sheet-rest-top),calc(env(safe-area-inset-top,0px) + .65rem));width:100%;max-height:none;background:var(--loro-surface);overscroll-behavior-y:contain;transform:translate3d(0,var(--loro-modal-sheet-drag-y, 0px),0)}.loro-modal--sheet .loro-modal__dialog--dragging{transition:none}.loro-modal--sheet .loro-modal__content{display:grid;height:100%;min-height:0;overflow:hidden;overscroll-behavior-y:contain;padding:.85rem;background:var(--loro-surface);touch-action:pan-y}.loro-modal--sheet .loro-modal__content--flush{padding:0}.loro-modal--center{align-items:center;padding:1rem}.loro-modal--center .loro-modal__dialog{border-radius:1.15rem}::ng-deep [loro-modal-actions]{flex-direction:column-reverse;padding:.7rem .9rem max(.85rem,env(safe-area-inset-bottom,0px));background:var(--loro-surface)}}@media(min-width:1024px){.loro-modal{place-items:center;padding:2rem}.loro-modal__backdrop{background:#070a129e;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.loro-modal--center .loro-modal__dialog,.loro-modal--sheet .loro-modal__dialog{position:relative;inset:auto;max-height:min(46rem,calc(var(--app-fill-height, var(--app-viewport-height, 100dvh)) - 4rem));border-radius:1.5rem}.loro-modal__dialog--sm{width:min(100%,28rem)}.loro-modal__dialog--md{width:min(100%,36rem)}.loro-modal__dialog--lg{width:min(100%,60rem)}}\n"] }]
|
|
3395
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], sheetDragToClose: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheetDragToClose", required: false }] }], sheetRestTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "sheetRestTop", required: false }] }], showBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "showBackdrop", required: false }] }], closeOnBackdrop: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeOnBackdrop", required: false }] }], modalClose: [{ type: i0.Output, args: ["modalClose"] }] } });
|
|
3396
|
+
|
|
3397
|
+
const LORO_ICON_COLOR_TOKENS = {
|
|
3398
|
+
default: 'currentColor',
|
|
3399
|
+
primary: 'var(--loro-primary-500)',
|
|
3400
|
+
'primary-strong': 'var(--loro-primary-700)',
|
|
3401
|
+
'primary-deep': 'var(--loro-primary-900)',
|
|
3402
|
+
text: 'var(--loro-text)',
|
|
3403
|
+
muted: 'var(--loro-muted)',
|
|
3404
|
+
success: '#1f9d55',
|
|
3405
|
+
danger: 'var(--loro-danger-text)',
|
|
3406
|
+
warning: 'var(--loro-warning)',
|
|
3407
|
+
inverse: 'var(--loro-text-inverse)',
|
|
3408
|
+
};
|
|
3409
|
+
class LoroIcon {
|
|
3410
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3411
|
+
size = input(48, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3412
|
+
alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
3413
|
+
decorative = input(false, ...(ngDevMode ? [{ debugName: "decorative" }] : /* istanbul ignore next */ []));
|
|
3414
|
+
color = input('default', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
3415
|
+
renderMode = input('mask', ...(ngDevMode ? [{ debugName: "renderMode" }] : /* istanbul ignore next */ []));
|
|
3416
|
+
assetName = computed(() => {
|
|
3417
|
+
const name = this.name();
|
|
3418
|
+
return (name in LORO_ICON_PATHS$1
|
|
3419
|
+
? name
|
|
3420
|
+
: LORO_ICON_LEGACY_NAMES$1[name]);
|
|
3421
|
+
}, ...(ngDevMode ? [{ debugName: "assetName" }] : /* istanbul ignore next */ []));
|
|
3422
|
+
src = computed(() => LORO_ICON_PATHS$1[this.assetName()], ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
3423
|
+
altText = computed(() => (this.decorative() ? '' : this.alt() || this.name()), ...(ngDevMode ? [{ debugName: "altText" }] : /* istanbul ignore next */ []));
|
|
3424
|
+
resolvedSize = computed(() => {
|
|
3425
|
+
const size = this.size();
|
|
3426
|
+
return typeof size === 'number' ? `${size}px` : size;
|
|
3427
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSize" }] : /* istanbul ignore next */ []));
|
|
3428
|
+
resolvedColor = computed(() => {
|
|
3429
|
+
const color = this.color();
|
|
3430
|
+
return color in LORO_ICON_COLOR_TOKENS
|
|
3431
|
+
? LORO_ICON_COLOR_TOKENS[color]
|
|
3432
|
+
: color;
|
|
3433
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedColor" }] : /* istanbul ignore next */ []));
|
|
3434
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3435
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: LoroIcon, isStandalone: true, selector: "loro-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, renderMode: { classPropertyName: "renderMode", publicName: "renderMode", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3436
|
+
<span
|
|
3437
|
+
class="loro-icon"
|
|
3438
|
+
role="img"
|
|
3439
|
+
[attr.aria-label]="decorative() ? null : altText()"
|
|
3440
|
+
[attr.aria-hidden]="decorative() ? 'true' : null"
|
|
3441
|
+
[style.width]="resolvedSize()"
|
|
3442
|
+
[style.height]="resolvedSize()"
|
|
3443
|
+
>
|
|
3444
|
+
@if (renderMode() === 'origin') {
|
|
3445
|
+
<img class="loro-icon__origin" [src]="src()" alt="" aria-hidden="true" />
|
|
3446
|
+
} @else {
|
|
3447
|
+
<span
|
|
3448
|
+
class="loro-icon__mask"
|
|
3449
|
+
[style.--loro-icon-mask]="'url(' + src() + ')'"
|
|
3450
|
+
[style.--loro-icon-color]="resolvedColor()"
|
|
3451
|
+
></span>
|
|
3452
|
+
}
|
|
3453
|
+
</span>
|
|
3454
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex:0 0 auto}.loro-icon{display:inline-flex;width:100%;height:100%}.loro-icon__origin,.loro-icon__mask{display:block;width:100%;height:100%}.loro-icon__origin{object-fit:contain}.loro-icon__mask{background-color:var(--loro-icon-color);mask-image:var(--loro-icon-mask);mask-repeat:no-repeat;mask-position:center;mask-size:contain;-webkit-mask-image:var(--loro-icon-mask);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3455
|
+
}
|
|
3456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroIcon, decorators: [{
|
|
3457
|
+
type: Component,
|
|
3458
|
+
args: [{ selector: 'loro-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3459
|
+
<span
|
|
3460
|
+
class="loro-icon"
|
|
3461
|
+
role="img"
|
|
3462
|
+
[attr.aria-label]="decorative() ? null : altText()"
|
|
3463
|
+
[attr.aria-hidden]="decorative() ? 'true' : null"
|
|
3464
|
+
[style.width]="resolvedSize()"
|
|
3465
|
+
[style.height]="resolvedSize()"
|
|
3466
|
+
>
|
|
3467
|
+
@if (renderMode() === 'origin') {
|
|
3468
|
+
<img class="loro-icon__origin" [src]="src()" alt="" aria-hidden="true" />
|
|
3469
|
+
} @else {
|
|
3470
|
+
<span
|
|
3471
|
+
class="loro-icon__mask"
|
|
3472
|
+
[style.--loro-icon-mask]="'url(' + src() + ')'"
|
|
3473
|
+
[style.--loro-icon-color]="resolvedColor()"
|
|
3474
|
+
></span>
|
|
3475
|
+
}
|
|
3476
|
+
</span>
|
|
3477
|
+
`, styles: [":host{display:inline-flex;align-items:center;justify-content:center;line-height:0;flex:0 0 auto}.loro-icon{display:inline-flex;width:100%;height:100%}.loro-icon__origin,.loro-icon__mask{display:block;width:100%;height:100%}.loro-icon__origin{object-fit:contain}.loro-icon__mask{background-color:var(--loro-icon-color);mask-image:var(--loro-icon-mask);mask-repeat:no-repeat;mask-position:center;mask-size:contain;-webkit-mask-image:var(--loro-icon-mask);-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;-webkit-mask-size:contain}\n"] }]
|
|
3478
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], renderMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "renderMode", required: false }] }] } });
|
|
3479
|
+
|
|
3480
|
+
class LoroImage {
|
|
3481
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
3482
|
+
alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : /* istanbul ignore next */ []));
|
|
3483
|
+
size = input('', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
3484
|
+
width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
3485
|
+
height = input('auto', ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
|
|
3486
|
+
fit = input('contain', ...(ngDevMode ? [{ debugName: "fit" }] : /* istanbul ignore next */ []));
|
|
3487
|
+
assetName = computed(() => {
|
|
3488
|
+
const name = this.name();
|
|
3489
|
+
return (name in LORO_IMAGE_PATHS
|
|
3490
|
+
? name
|
|
3491
|
+
: LORO_IMAGE_LEGACY_NAMES[name]);
|
|
3492
|
+
}, ...(ngDevMode ? [{ debugName: "assetName" }] : /* istanbul ignore next */ []));
|
|
3493
|
+
src = computed(() => LORO_IMAGE_PATHS[this.assetName()], ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
3494
|
+
altText = computed(() => this.alt(), ...(ngDevMode ? [{ debugName: "altText" }] : /* istanbul ignore next */ []));
|
|
3495
|
+
resolvedWidth = computed(() => this.size() || this.width(), ...(ngDevMode ? [{ debugName: "resolvedWidth" }] : /* istanbul ignore next */ []));
|
|
3496
|
+
resolvedHeight = computed(() => this.size() || this.height(), ...(ngDevMode ? [{ debugName: "resolvedHeight" }] : /* istanbul ignore next */ []));
|
|
3497
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroImage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3498
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: LoroImage, isStandalone: true, selector: "loro-image", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, fit: { classPropertyName: "fit", publicName: "fit", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3499
|
+
<img
|
|
3500
|
+
class="loro-image"
|
|
3501
|
+
[src]="src()"
|
|
3502
|
+
[alt]="altText()"
|
|
3503
|
+
[style.width]="resolvedWidth()"
|
|
3504
|
+
[style.height]="resolvedHeight()"
|
|
3505
|
+
[style.object-fit]="fit()"
|
|
3506
|
+
[style.display]="'block'"
|
|
3507
|
+
/>
|
|
3508
|
+
`, isInline: true, styles: [":host{display:block}.loro-image{max-width:100%}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3509
|
+
}
|
|
3510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroImage, decorators: [{
|
|
3511
|
+
type: Component,
|
|
3512
|
+
args: [{ selector: 'loro-image', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
3513
|
+
<img
|
|
3514
|
+
class="loro-image"
|
|
3515
|
+
[src]="src()"
|
|
3516
|
+
[alt]="altText()"
|
|
3517
|
+
[style.width]="resolvedWidth()"
|
|
3518
|
+
[style.height]="resolvedHeight()"
|
|
3519
|
+
[style.object-fit]="fit()"
|
|
3520
|
+
[style.display]="'block'"
|
|
3521
|
+
/>
|
|
3522
|
+
`, styles: [":host{display:block}.loro-image{max-width:100%}\n"] }]
|
|
3523
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], fit: [{ type: i0.Input, args: [{ isSignal: true, alias: "fit", required: false }] }] } });
|
|
3524
|
+
|
|
3525
|
+
class LoroHapticsService {
|
|
3526
|
+
document = inject(DOCUMENT);
|
|
3527
|
+
vibration = 'vibrate' in navigator ? navigator.vibrate.bind(navigator) : null;
|
|
3528
|
+
impact(style = 'light') {
|
|
3529
|
+
if (Capacitor.isNativePlatform()) {
|
|
3530
|
+
const nativeStyle = {
|
|
3531
|
+
light: ImpactStyle.Light,
|
|
3532
|
+
medium: ImpactStyle.Medium,
|
|
3533
|
+
heavy: ImpactStyle.Heavy,
|
|
3534
|
+
};
|
|
3535
|
+
void Haptics.impact({ style: nativeStyle[style] });
|
|
3536
|
+
return;
|
|
3537
|
+
}
|
|
3538
|
+
const pattern = {
|
|
3539
|
+
light: 10,
|
|
3540
|
+
medium: [12, 18, 12],
|
|
3541
|
+
heavy: [18, 24, 18],
|
|
3542
|
+
};
|
|
3543
|
+
this.trigger(pattern[style]);
|
|
3544
|
+
}
|
|
3545
|
+
selection() {
|
|
3546
|
+
if (Capacitor.isNativePlatform()) {
|
|
3547
|
+
void Haptics.selectionStart()
|
|
3548
|
+
.then(() => Haptics.selectionChanged())
|
|
3549
|
+
.then(() => Haptics.selectionEnd());
|
|
3550
|
+
return;
|
|
3551
|
+
}
|
|
3552
|
+
this.trigger(8);
|
|
3553
|
+
}
|
|
3554
|
+
notification(type = 'success') {
|
|
3555
|
+
if (Capacitor.isNativePlatform()) {
|
|
3556
|
+
const nativeType = {
|
|
3557
|
+
success: NotificationType.Success,
|
|
3558
|
+
warning: NotificationType.Warning,
|
|
3559
|
+
error: NotificationType.Error,
|
|
3560
|
+
};
|
|
3561
|
+
void Haptics.notification({ type: nativeType[type] });
|
|
3562
|
+
return;
|
|
3563
|
+
}
|
|
3564
|
+
const pattern = {
|
|
3565
|
+
success: [12, 24, 12],
|
|
3566
|
+
warning: [18, 18, 18],
|
|
3567
|
+
error: [30, 24, 30],
|
|
3568
|
+
};
|
|
3569
|
+
this.trigger(pattern[type]);
|
|
3570
|
+
}
|
|
3571
|
+
trigger(pattern) {
|
|
3572
|
+
if (!this.vibration || this.document.visibilityState !== 'visible') {
|
|
3573
|
+
return;
|
|
3574
|
+
}
|
|
3575
|
+
this.vibration(pattern);
|
|
3576
|
+
}
|
|
3577
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroHapticsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3578
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroHapticsService, providedIn: 'root' });
|
|
3579
|
+
}
|
|
3580
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: LoroHapticsService, decorators: [{
|
|
3581
|
+
type: Injectable,
|
|
3582
|
+
args: [{
|
|
3583
|
+
providedIn: 'root'
|
|
3584
|
+
}]
|
|
3585
|
+
}] });
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* Generated bundle index. Do not edit.
|
|
3589
|
+
*/
|
|
3590
|
+
|
|
3591
|
+
export { Footer, LoroAccordion, LoroAlert, LoroAppNav, LoroAssistantCard, LoroAuthField, LoroAuthSocialButton, LoroBadge, LoroButton, LoroCard, LoroCardNav, LoroCheckbox, LoroDashboardCard, LoroDivider, LoroDropdown, LoroFilterChip, LoroHapticsService, LoroIcon, LoroImage, LoroInput, LoroModal, LoroNotification, LoroNotificationPanel, LoroNotificationRow, LoroProductRow, LoroProductSection, LoroProfileCard, LoroProfileHero, LoroRadio, LoroSegmentedControl, LoroSelect, LoroSpinner, LoroStatCard, LoroStoreRankCard, LoroSummaryBar, LoroTab, LoroTextArea, LoroToast, LoroToggle, LoroUpload };
|
|
3592
|
+
//# sourceMappingURL=juligc99-loro-ui.mjs.map
|