@camp2gether/c2g-ui 0.0.7
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 +95 -0
- package/charts/index.d.ts +199 -0
- package/fesm2022/camp2gether-c2g-ui-beach-animation-ipi3OoKW.mjs +54156 -0
- package/fesm2022/camp2gether-c2g-ui-beach-animation-ipi3OoKW.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-camping-animation-DY6XWXyF.mjs +35807 -0
- package/fesm2022/camp2gether-c2g-ui-camping-animation-DY6XWXyF.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-car-animation-DnDp7WfG.mjs +45189 -0
- package/fesm2022/camp2gether-c2g-ui-car-animation-DnDp7WfG.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-car-driving-landscape-animation-CawNeMKD.mjs +43833 -0
- package/fesm2022/camp2gether-c2g-ui-car-driving-landscape-animation-CawNeMKD.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-cat-love-animation-ewC7fZyY.mjs +30789 -0
- package/fesm2022/camp2gether-c2g-ui-cat-love-animation-ewC7fZyY.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-charts.mjs +404 -0
- package/fesm2022/camp2gether-c2g-ui-charts.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-checklist-animation-DqUkcLqI.mjs +19868 -0
- package/fesm2022/camp2gether-c2g-ui-checklist-animation-DqUkcLqI.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-coffee-time-animation-DQilaE0A.mjs +6816 -0
- package/fesm2022/camp2gether-c2g-ui-coffee-time-animation-DQilaE0A.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-error-404-pdjg-EHb.mjs +49742 -0
- package/fesm2022/camp2gether-c2g-ui-error-404-pdjg-EHb.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-fishing-animation-DwE3IF-V.mjs +38941 -0
- package/fesm2022/camp2gether-c2g-ui-fishing-animation-DwE3IF-V.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-layout.mjs +768 -0
- package/fesm2022/camp2gether-c2g-ui-layout.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-maps.mjs +223 -0
- package/fesm2022/camp2gether-c2g-ui-maps.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-mountain-search-animation-TebM1gS4.mjs +69245 -0
- package/fesm2022/camp2gether-c2g-ui-mountain-search-animation-TebM1gS4.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-planning-animation-D8QSsZk6.mjs +28330 -0
- package/fesm2022/camp2gether-c2g-ui-planning-animation-D8QSsZk6.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-presets.mjs +2855 -0
- package/fesm2022/camp2gether-c2g-ui-presets.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-share-animation-qgqs-k59.mjs +59129 -0
- package/fesm2022/camp2gether-c2g-ui-share-animation-qgqs-k59.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-summer-camp-animation-DPzirVNH.mjs +89317 -0
- package/fesm2022/camp2gether-c2g-ui-summer-camp-animation-DPzirVNH.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-theme.mjs +479 -0
- package/fesm2022/camp2gether-c2g-ui-theme.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-thinking-animation--X3er_pf.mjs +27929 -0
- package/fesm2022/camp2gether-c2g-ui-thinking-animation--X3er_pf.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-walking-avocado-animation-CQMU2C9-.mjs +4064 -0
- package/fesm2022/camp2gether-c2g-ui-walking-avocado-animation-CQMU2C9-.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-walking-orange-animation-CTJniCsF.mjs +3113 -0
- package/fesm2022/camp2gether-c2g-ui-walking-orange-animation-CTJniCsF.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui-weather-partly-cloudy-animation-Cnw3W4cS.mjs +1731 -0
- package/fesm2022/camp2gether-c2g-ui-weather-partly-cloudy-animation-Cnw3W4cS.mjs.map +1 -0
- package/fesm2022/camp2gether-c2g-ui.mjs +2099 -0
- package/fesm2022/camp2gether-c2g-ui.mjs.map +1 -0
- package/index.d.ts +578 -0
- package/layout/index.d.ts +443 -0
- package/maps/index.d.ts +62 -0
- package/package.json +51 -0
- package/presets/index.d.ts +1437 -0
- package/src/lib/styles/design-tokens.css +153 -0
- package/src/lib/styles/themes.scss +346 -0
- package/theme/index.d.ts +63 -0
|
@@ -0,0 +1,2099 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, makeEnvironmentProviders, provideAppInitializer, inject, input, output, computed, ChangeDetectionStrategy, signal, effect, forwardRef, DOCUMENT, Injectable, model } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/icon';
|
|
4
|
+
import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
6
|
+
import { LottieComponent } from 'ngx-lottie';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import * as i1$1 from '@angular/cdk/a11y';
|
|
9
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
10
|
+
|
|
11
|
+
class C2gUi {
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: C2gUi, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: C2gUi, isStandalone: true, selector: "c2g-c2g-ui", ngImport: i0, template: `
|
|
14
|
+
<p>
|
|
15
|
+
c2g-ui works!
|
|
16
|
+
</p>
|
|
17
|
+
`, isInline: true, styles: [""] });
|
|
18
|
+
}
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: C2gUi, decorators: [{
|
|
20
|
+
type: Component,
|
|
21
|
+
args: [{ selector: 'c2g-c2g-ui', imports: [], template: `
|
|
22
|
+
<p>
|
|
23
|
+
c2g-ui works!
|
|
24
|
+
</p>
|
|
25
|
+
` }]
|
|
26
|
+
}] });
|
|
27
|
+
|
|
28
|
+
const VARIANT_MAP = {
|
|
29
|
+
filled: { fontClass: 'material-icons', alias: 'material-icons' },
|
|
30
|
+
outlined: { fontClass: 'material-icons-outlined', alias: 'material-icons-outlined' },
|
|
31
|
+
round: { fontClass: 'material-icons-round', alias: 'material-icons-round' },
|
|
32
|
+
sharp: { fontClass: 'material-icons-sharp', alias: 'material-icons-sharp' },
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Registers Material Icons font variants with MatIconRegistry.
|
|
36
|
+
*
|
|
37
|
+
* Add to your app config:
|
|
38
|
+
* ```ts
|
|
39
|
+
* providers: [provideC2gIcons()]
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* Then use in templates:
|
|
43
|
+
* ```html
|
|
44
|
+
* <mat-icon>hiking</mat-icon>
|
|
45
|
+
* <mat-icon fontSet="material-icons-outlined">map</mat-icon>
|
|
46
|
+
* <mat-icon fontSet="material-icons-round">star</mat-icon>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* The consuming app must load the font CSS — either via Google Fonts or self-hosted:
|
|
50
|
+
* ```html
|
|
51
|
+
* <link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Round|Material+Icons+Sharp" rel="stylesheet">
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
function provideC2gIcons(options) {
|
|
55
|
+
const variants = options?.variants ?? ['filled', 'outlined', 'round', 'sharp'];
|
|
56
|
+
return makeEnvironmentProviders([
|
|
57
|
+
provideAppInitializer(() => {
|
|
58
|
+
const registry = inject(MatIconRegistry);
|
|
59
|
+
for (const variant of variants) {
|
|
60
|
+
const { fontClass, alias } = VARIANT_MAP[variant];
|
|
61
|
+
registry.registerFontClassAlias(alias, fontClass);
|
|
62
|
+
}
|
|
63
|
+
// Set outlined as the default font set for c2g components
|
|
64
|
+
registry.setDefaultFontSetClass('material-icons-outlined');
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
class AvatarComponent {
|
|
70
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
71
|
+
initials = input('', ...(ngDevMode ? [{ debugName: "initials" }] : []));
|
|
72
|
+
imageUrl = input(null, ...(ngDevMode ? [{ debugName: "imageUrl" }] : []));
|
|
73
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
74
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
75
|
+
backgroundColor = input('', ...(ngDevMode ? [{ debugName: "backgroundColor" }] : []));
|
|
76
|
+
textColor = input('', ...(ngDevMode ? [{ debugName: "textColor" }] : []));
|
|
77
|
+
ringTone = input('none', ...(ngDevMode ? [{ debugName: "ringTone" }] : []));
|
|
78
|
+
ringColor = input('', ...(ngDevMode ? [{ debugName: "ringColor" }] : []));
|
|
79
|
+
clickable = input(false, ...(ngDevMode ? [{ debugName: "clickable" }] : []));
|
|
80
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
81
|
+
badge = input(null, ...(ngDevMode ? [{ debugName: "badge" }] : []));
|
|
82
|
+
avatarClick = output();
|
|
83
|
+
resolvedInitials = computed(() => {
|
|
84
|
+
const explicitInitials = this.initials().trim();
|
|
85
|
+
if (explicitInitials) {
|
|
86
|
+
return explicitInitials.slice(0, 3).toUpperCase();
|
|
87
|
+
}
|
|
88
|
+
const name = this.name().trim();
|
|
89
|
+
if (!name) {
|
|
90
|
+
return '?';
|
|
91
|
+
}
|
|
92
|
+
return name
|
|
93
|
+
.split(/\s+/)
|
|
94
|
+
.slice(0, 2)
|
|
95
|
+
.map(part => part[0])
|
|
96
|
+
.join('')
|
|
97
|
+
.toUpperCase();
|
|
98
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedInitials" }] : []));
|
|
99
|
+
resolvedAriaLabel = computed(() => this.ariaLabel().trim() || this.name().trim() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : []));
|
|
100
|
+
hasImage = computed(() => !!this.imageUrl(), ...(ngDevMode ? [{ debugName: "hasImage" }] : []));
|
|
101
|
+
ringStyle = computed(() => {
|
|
102
|
+
if (this.ringTone() !== 'custom' || !this.ringColor().trim()) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
return this.ringColor();
|
|
106
|
+
}, ...(ngDevMode ? [{ debugName: "ringStyle" }] : []));
|
|
107
|
+
badgeBackground = computed(() => {
|
|
108
|
+
const badge = this.badge();
|
|
109
|
+
if (!badge) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
if (badge.tone === 'custom' && badge.backgroundColor?.trim()) {
|
|
113
|
+
return badge.backgroundColor;
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}, ...(ngDevMode ? [{ debugName: "badgeBackground" }] : []));
|
|
117
|
+
badgeColor = computed(() => {
|
|
118
|
+
const badge = this.badge();
|
|
119
|
+
if (!badge) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
if (badge.tone === 'custom' && badge.color?.trim()) {
|
|
123
|
+
return badge.color;
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}, ...(ngDevMode ? [{ debugName: "badgeColor" }] : []));
|
|
127
|
+
onAvatarClick() {
|
|
128
|
+
if (!this.clickable() || this.disabled()) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.avatarClick.emit();
|
|
132
|
+
}
|
|
133
|
+
onAvatarKeydown(event) {
|
|
134
|
+
if (!this.clickable() || this.disabled()) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
this.avatarClick.emit();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
143
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AvatarComponent, isStandalone: true, selector: "c2g-avatar", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, imageUrl: { classPropertyName: "imageUrl", publicName: "imageUrl", 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 }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, textColor: { classPropertyName: "textColor", publicName: "textColor", isSignal: true, isRequired: false, transformFunction: null }, ringTone: { classPropertyName: "ringTone", publicName: "ringTone", isSignal: true, isRequired: false, transformFunction: null }, ringColor: { classPropertyName: "ringColor", publicName: "ringColor", isSignal: true, isRequired: false, transformFunction: null }, clickable: { classPropertyName: "clickable", publicName: "clickable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { avatarClick: "avatarClick" }, ngImport: i0, template: "<span\n class=\"c2g-avatar\"\n [class.c2g-avatar--clickable]=\"clickable() && !disabled()\"\n [class.c2g-avatar--disabled]=\"disabled()\"\n [class.c2g-avatar--sm]=\"size() === 'sm'\"\n [class.c2g-avatar--md]=\"size() === 'md'\"\n [class.c2g-avatar--lg]=\"size() === 'lg'\"\n [class.c2g-avatar--ring-neutral]=\"ringTone() === 'neutral'\"\n [class.c2g-avatar--ring-success]=\"ringTone() === 'success'\"\n [class.c2g-avatar--ring-danger]=\"ringTone() === 'danger'\"\n [class.c2g-avatar--ring-muted]=\"ringTone() === 'muted'\"\n [class.c2g-avatar--ring-custom]=\"ringTone() === 'custom'\"\n [style.--c2g-avatar-bg]=\"backgroundColor() || null\"\n [style.--c2g-avatar-color]=\"textColor() || null\"\n [style.--c2g-avatar-ring]=\"ringStyle()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-disabled]=\"clickable() && disabled() ? 'true' : null\"\n [attr.role]=\"clickable() ? 'button' : 'img'\"\n [attr.tabindex]=\"clickable() && !disabled() ? 0 : null\"\n (click)=\"onAvatarClick()\"\n (keydown)=\"onAvatarKeydown($event)\">\n @if (hasImage()) {\n <img class=\"c2g-avatar__image\" [src]=\"imageUrl()!\" [alt]=\"resolvedAriaLabel() ?? ''\" />\n } @else {\n <span class=\"c2g-avatar__initials\">{{ resolvedInitials() }}</span>\n }\n\n @if (badge()) {\n <span\n class=\"c2g-avatar__badge\"\n [class.c2g-avatar__badge--neutral]=\"badge()!.tone === 'neutral'\"\n [class.c2g-avatar__badge--success]=\"badge()!.tone === 'success'\"\n [class.c2g-avatar__badge--danger]=\"badge()!.tone === 'danger'\"\n [class.c2g-avatar__badge--muted]=\"badge()!.tone === 'muted'\"\n [class.c2g-avatar__badge--custom]=\"badge()!.tone === 'custom'\"\n [style.--c2g-avatar-badge-bg]=\"badgeBackground()\"\n [style.--c2g-avatar-badge-color]=\"badgeColor()\"\n [attr.aria-label]=\"badge()!.ariaLabel || null\">\n @if (badge()!.icon) {\n <span class=\"c2g-avatar__badge-icon\" aria-hidden=\"true\">{{ badge()!.icon }}</span>\n } @else if (badge()!.text) {\n <span class=\"c2g-avatar__badge-text\" aria-hidden=\"true\">{{ badge()!.text }}</span>\n }\n </span>\n }\n</span>", styles: [".c2g-avatar{--c2g-avatar-bg: var(--c2g-color-secondary-container);--c2g-avatar-color: var(--c2g-color-secondary-dark);--c2g-avatar-ring: transparent;--c2g-avatar-badge-bg: var(--c2g-color-neutral-100);--c2g-avatar-badge-color: var(--c2g-color-text-primary);position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--c2g-avatar-bg);color:var(--c2g-avatar-color);font-weight:800;overflow:visible;isolation:isolate}.c2g-avatar--clickable{cursor:pointer}.c2g-avatar--clickable:focus-visible{outline:2px solid var(--c2g-color-secondary-dark);outline-offset:2px}.c2g-avatar--disabled{opacity:.6;cursor:not-allowed}.c2g-avatar:before{content:\"\";position:absolute;inset:-2px;border-radius:50%;border:2px solid transparent;z-index:-1}.c2g-avatar--sm{width:28px;height:28px;font-size:.68rem}.c2g-avatar--md{width:40px;height:40px;font-size:.78rem}.c2g-avatar--lg{width:56px;height:56px;font-size:1rem}.c2g-avatar--ring-neutral:before{border-color:var(--c2g-color-border-subtle)}.c2g-avatar--ring-success:before{border-color:var(--c2g-color-success)}.c2g-avatar--ring-danger:before{border-color:var(--c2g-color-error)}.c2g-avatar--ring-muted:before{border-color:var(--c2g-color-outline)}.c2g-avatar--ring-custom:before{border-color:var(--c2g-avatar-ring)}.c2g-avatar__image{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}.c2g-avatar__initials{line-height:1;letter-spacing:.03em}.c2g-avatar__badge{position:absolute;right:-2px;bottom:-2px;min-width:14px;height:14px;padding:0 2px;border-radius:999px;background:var(--c2g-avatar-badge-bg);color:var(--c2g-avatar-badge-color);border:2px solid var(--c2g-color-surface);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}.c2g-avatar--lg .c2g-avatar__badge{min-width:18px;height:18px}.c2g-avatar__badge--neutral{--c2g-avatar-badge-bg: var(--c2g-color-neutral-100);--c2g-avatar-badge-color: var(--c2g-color-text-primary)}.c2g-avatar__badge--success{--c2g-avatar-badge-bg: var(--c2g-color-success);--c2g-avatar-badge-color: var(--c2g-color-surface)}.c2g-avatar__badge--danger{--c2g-avatar-badge-bg: var(--c2g-color-error);--c2g-avatar-badge-color: var(--c2g-color-surface)}.c2g-avatar__badge--muted{--c2g-avatar-badge-bg: var(--c2g-color-neutral-300);--c2g-avatar-badge-color: var(--c2g-color-text-muted)}.c2g-avatar__badge--custom{--c2g-avatar-badge-bg: var(--c2g-avatar-badge-bg);--c2g-avatar-badge-color: var(--c2g-avatar-badge-color)}.c2g-avatar__badge-icon,.c2g-avatar__badge-text{font-size:.5rem;line-height:1;font-weight:700}.c2g-avatar--lg .c2g-avatar__badge-icon,.c2g-avatar--lg .c2g-avatar__badge-text{font-size:.62rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
144
|
+
}
|
|
145
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AvatarComponent, decorators: [{
|
|
146
|
+
type: Component,
|
|
147
|
+
args: [{ selector: 'c2g-avatar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"c2g-avatar\"\n [class.c2g-avatar--clickable]=\"clickable() && !disabled()\"\n [class.c2g-avatar--disabled]=\"disabled()\"\n [class.c2g-avatar--sm]=\"size() === 'sm'\"\n [class.c2g-avatar--md]=\"size() === 'md'\"\n [class.c2g-avatar--lg]=\"size() === 'lg'\"\n [class.c2g-avatar--ring-neutral]=\"ringTone() === 'neutral'\"\n [class.c2g-avatar--ring-success]=\"ringTone() === 'success'\"\n [class.c2g-avatar--ring-danger]=\"ringTone() === 'danger'\"\n [class.c2g-avatar--ring-muted]=\"ringTone() === 'muted'\"\n [class.c2g-avatar--ring-custom]=\"ringTone() === 'custom'\"\n [style.--c2g-avatar-bg]=\"backgroundColor() || null\"\n [style.--c2g-avatar-color]=\"textColor() || null\"\n [style.--c2g-avatar-ring]=\"ringStyle()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-disabled]=\"clickable() && disabled() ? 'true' : null\"\n [attr.role]=\"clickable() ? 'button' : 'img'\"\n [attr.tabindex]=\"clickable() && !disabled() ? 0 : null\"\n (click)=\"onAvatarClick()\"\n (keydown)=\"onAvatarKeydown($event)\">\n @if (hasImage()) {\n <img class=\"c2g-avatar__image\" [src]=\"imageUrl()!\" [alt]=\"resolvedAriaLabel() ?? ''\" />\n } @else {\n <span class=\"c2g-avatar__initials\">{{ resolvedInitials() }}</span>\n }\n\n @if (badge()) {\n <span\n class=\"c2g-avatar__badge\"\n [class.c2g-avatar__badge--neutral]=\"badge()!.tone === 'neutral'\"\n [class.c2g-avatar__badge--success]=\"badge()!.tone === 'success'\"\n [class.c2g-avatar__badge--danger]=\"badge()!.tone === 'danger'\"\n [class.c2g-avatar__badge--muted]=\"badge()!.tone === 'muted'\"\n [class.c2g-avatar__badge--custom]=\"badge()!.tone === 'custom'\"\n [style.--c2g-avatar-badge-bg]=\"badgeBackground()\"\n [style.--c2g-avatar-badge-color]=\"badgeColor()\"\n [attr.aria-label]=\"badge()!.ariaLabel || null\">\n @if (badge()!.icon) {\n <span class=\"c2g-avatar__badge-icon\" aria-hidden=\"true\">{{ badge()!.icon }}</span>\n } @else if (badge()!.text) {\n <span class=\"c2g-avatar__badge-text\" aria-hidden=\"true\">{{ badge()!.text }}</span>\n }\n </span>\n }\n</span>", styles: [".c2g-avatar{--c2g-avatar-bg: var(--c2g-color-secondary-container);--c2g-avatar-color: var(--c2g-color-secondary-dark);--c2g-avatar-ring: transparent;--c2g-avatar-badge-bg: var(--c2g-color-neutral-100);--c2g-avatar-badge-color: var(--c2g-color-text-primary);position:relative;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--c2g-avatar-bg);color:var(--c2g-avatar-color);font-weight:800;overflow:visible;isolation:isolate}.c2g-avatar--clickable{cursor:pointer}.c2g-avatar--clickable:focus-visible{outline:2px solid var(--c2g-color-secondary-dark);outline-offset:2px}.c2g-avatar--disabled{opacity:.6;cursor:not-allowed}.c2g-avatar:before{content:\"\";position:absolute;inset:-2px;border-radius:50%;border:2px solid transparent;z-index:-1}.c2g-avatar--sm{width:28px;height:28px;font-size:.68rem}.c2g-avatar--md{width:40px;height:40px;font-size:.78rem}.c2g-avatar--lg{width:56px;height:56px;font-size:1rem}.c2g-avatar--ring-neutral:before{border-color:var(--c2g-color-border-subtle)}.c2g-avatar--ring-success:before{border-color:var(--c2g-color-success)}.c2g-avatar--ring-danger:before{border-color:var(--c2g-color-error)}.c2g-avatar--ring-muted:before{border-color:var(--c2g-color-outline)}.c2g-avatar--ring-custom:before{border-color:var(--c2g-avatar-ring)}.c2g-avatar__image{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}.c2g-avatar__initials{line-height:1;letter-spacing:.03em}.c2g-avatar__badge{position:absolute;right:-2px;bottom:-2px;min-width:14px;height:14px;padding:0 2px;border-radius:999px;background:var(--c2g-avatar-badge-bg);color:var(--c2g-avatar-badge-color);border:2px solid var(--c2g-color-surface);display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}.c2g-avatar--lg .c2g-avatar__badge{min-width:18px;height:18px}.c2g-avatar__badge--neutral{--c2g-avatar-badge-bg: var(--c2g-color-neutral-100);--c2g-avatar-badge-color: var(--c2g-color-text-primary)}.c2g-avatar__badge--success{--c2g-avatar-badge-bg: var(--c2g-color-success);--c2g-avatar-badge-color: var(--c2g-color-surface)}.c2g-avatar__badge--danger{--c2g-avatar-badge-bg: var(--c2g-color-error);--c2g-avatar-badge-color: var(--c2g-color-surface)}.c2g-avatar__badge--muted{--c2g-avatar-badge-bg: var(--c2g-color-neutral-300);--c2g-avatar-badge-color: var(--c2g-color-text-muted)}.c2g-avatar__badge--custom{--c2g-avatar-badge-bg: var(--c2g-avatar-badge-bg);--c2g-avatar-badge-color: var(--c2g-avatar-badge-color)}.c2g-avatar__badge-icon,.c2g-avatar__badge-text{font-size:.5rem;line-height:1;font-weight:700}.c2g-avatar--lg .c2g-avatar__badge-icon,.c2g-avatar--lg .c2g-avatar__badge-text{font-size:.62rem}\n"] }]
|
|
148
|
+
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageUrl", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], backgroundColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "backgroundColor", required: false }] }], textColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "textColor", required: false }] }], ringTone: [{ type: i0.Input, args: [{ isSignal: true, alias: "ringTone", required: false }] }], ringColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "ringColor", required: false }] }], clickable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clickable", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], avatarClick: [{ type: i0.Output, args: ["avatarClick"] }] } });
|
|
149
|
+
|
|
150
|
+
class ButtonComponent {
|
|
151
|
+
variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
152
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
153
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
154
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
155
|
+
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
156
|
+
iconPosition = input('start', ...(ngDevMode ? [{ debugName: "iconPosition" }] : []));
|
|
157
|
+
iconOnly = input(false, ...(ngDevMode ? [{ debugName: "iconOnly" }] : []));
|
|
158
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
159
|
+
loadingAriaLabel = input('Lädt', ...(ngDevMode ? [{ debugName: "loadingAriaLabel" }] : []));
|
|
160
|
+
type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
161
|
+
clicked = output();
|
|
162
|
+
isInteractionDisabled = computed(() => this.disabled() || this.loading(), ...(ngDevMode ? [{ debugName: "isInteractionDisabled" }] : []));
|
|
163
|
+
showLeadingSpinner = computed(() => this.loading() && this.iconPosition() === 'start', ...(ngDevMode ? [{ debugName: "showLeadingSpinner" }] : []));
|
|
164
|
+
showTrailingSpinner = computed(() => this.loading() && this.iconPosition() === 'end', ...(ngDevMode ? [{ debugName: "showTrailingSpinner" }] : []));
|
|
165
|
+
hasIcon = computed(() => this.icon().trim().length > 0, ...(ngDevMode ? [{ debugName: "hasIcon" }] : []));
|
|
166
|
+
showLeadingIcon = computed(() => this.hasIcon() && !this.loading() && this.iconPosition() === 'start', ...(ngDevMode ? [{ debugName: "showLeadingIcon" }] : []));
|
|
167
|
+
showTrailingIcon = computed(() => this.hasIcon() && !this.loading() && this.iconPosition() === 'end', ...(ngDevMode ? [{ debugName: "showTrailingIcon" }] : []));
|
|
168
|
+
computedAriaLabel = computed(() => {
|
|
169
|
+
if (this.loading()) {
|
|
170
|
+
return this.loadingAriaLabel();
|
|
171
|
+
}
|
|
172
|
+
if (this.iconOnly()) {
|
|
173
|
+
return this.ariaLabel().trim() || 'Aktion';
|
|
174
|
+
}
|
|
175
|
+
return this.ariaLabel().trim() || null;
|
|
176
|
+
}, ...(ngDevMode ? [{ debugName: "computedAriaLabel" }] : []));
|
|
177
|
+
buttonClasses = computed(() => `c2g-btn--${this.size()} c2g-btn--${this.variant()}${this.iconOnly() ? ' c2g-btn--icon-only' : ''}${this.loading() ? ' c2g-btn--loading' : ''}`, ...(ngDevMode ? [{ debugName: "buttonClasses" }] : []));
|
|
178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
179
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ButtonComponent, isStandalone: true, selector: "c2g-button", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", 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 }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconPosition: { classPropertyName: "iconPosition", publicName: "iconPosition", isSignal: true, isRequired: false, transformFunction: null }, iconOnly: { classPropertyName: "iconOnly", publicName: "iconOnly", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, loadingAriaLabel: { classPropertyName: "loadingAriaLabel", publicName: "loadingAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, ngImport: i0, template: `
|
|
180
|
+
<button
|
|
181
|
+
[type]="type()"
|
|
182
|
+
[disabled]="isInteractionDisabled()"
|
|
183
|
+
[class]="buttonClasses()"
|
|
184
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
185
|
+
[attr.aria-disabled]="isInteractionDisabled() ? 'true' : null"
|
|
186
|
+
[attr.aria-label]="computedAriaLabel()"
|
|
187
|
+
(click)="clicked.emit($event)"
|
|
188
|
+
>
|
|
189
|
+
@if (showLeadingSpinner()) {
|
|
190
|
+
<span class="c2g-btn__spinner" aria-hidden="true"></span>
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@if (showLeadingIcon()) {
|
|
194
|
+
<span class="c2g-btn__icon" aria-hidden="true">{{ icon() }}</span>
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@if (!iconOnly()) {
|
|
198
|
+
<span class="c2g-btn__content">
|
|
199
|
+
<ng-content />
|
|
200
|
+
</span>
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
@if (showTrailingIcon()) {
|
|
204
|
+
<span class="c2g-btn__icon" aria-hidden="true">{{ icon() }}</span>
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@if (showTrailingSpinner()) {
|
|
208
|
+
<span class="c2g-btn__spinner" aria-hidden="true"></span>
|
|
209
|
+
}
|
|
210
|
+
</button>
|
|
211
|
+
`, isInline: true, styles: ["button{display:inline-flex;align-items:center;justify-content:center;gap:var(--c2g-space-2, .5rem);border:none;cursor:pointer;min-height:2rem;font-weight:var(--c2g-font-weight-semibold, 600);font-family:var(--c2g-font-family-base, \"Inter\", \"Segoe UI\", sans-serif);border-radius:var(--c2g-radius-sm, .375rem);transition:background-color var(--c2g-motion-duration-base, .2s) var(--c2g-motion-ease-standard, ease),opacity var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}button:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-button-primary, #2563eb) 30%,transparent)}button:disabled{opacity:.5;cursor:not-allowed}.c2g-btn--loading{cursor:wait}.c2g-btn--sm{padding:calc(var(--c2g-space-1, .25rem) + var(--c2g-space-1, .25rem)) var(--c2g-space-3, .75rem);font-size:var(--c2g-font-size-xs, .75rem)}.c2g-btn--md{padding:calc(var(--c2g-space-2, .5rem) + var(--c2g-space-1, .25rem)) var(--c2g-space-5, 1.25rem);font-size:var(--c2g-font-size-sm, .875rem)}.c2g-btn--lg{padding:var(--c2g-space-4, 1rem) calc(var(--c2g-space-5, 1.25rem) + var(--c2g-space-2, .5rem));font-size:var(--c2g-font-size-md, 1rem)}.c2g-btn--primary{background:var(--c2g-color-button-primary, #2563eb);color:var(--c2g-color-button-primary-text, #1a1714)}.c2g-btn--primary:hover:not(:disabled){background:var(--c2g-color-button-primary-hover, #1d4ed8)}.c2g-btn--secondary{background:var(--c2g-color-button-secondary, #e5e7eb);color:var(--c2g-color-button-secondary-text, #111827)}.c2g-btn--secondary:hover:not(:disabled){background:var(--c2g-color-button-secondary-hover, #d1d5db)}.c2g-btn--ghost{background:transparent;color:var(--c2g-color-button-primary, #2563eb)}.c2g-btn--ghost:hover:not(:disabled){background:var(--c2g-color-button-ghost-hover, #eff6ff)}.c2g-btn--destructive{background:var(--c2g-color-semantic-error, #b23a2b);color:var(--c2g-color-surface, #ffffff)}.c2g-btn--destructive:hover:not(:disabled){background:var(--c2g-color-semantic-error-dark, #8c2d22)}.c2g-btn--icon{background:transparent;color:var(--c2g-color-text-primary, #1a1714);border:1px solid var(--c2g-color-border-soft, #e7ddd5);padding-inline:var(--c2g-space-2, .5rem)}.c2g-btn--icon:hover:not(:disabled){background:var(--c2g-color-bg-subtle, #f6ede7)}.c2g-btn--icon-only{padding:0;width:2.5rem;aspect-ratio:1}.c2g-btn--sm.c2g-btn--icon-only{width:2rem}.c2g-btn--lg.c2g-btn--icon-only{width:3rem}.c2g-btn__content{line-height:1}.c2g-btn__icon{display:inline-flex;font-size:1.05em;line-height:1}.c2g-btn__spinner{width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:c2g-btn-spin .7s linear infinite;display:inline-block}@keyframes c2g-btn-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
212
|
+
}
|
|
213
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
214
|
+
type: Component,
|
|
215
|
+
args: [{ selector: 'c2g-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
216
|
+
<button
|
|
217
|
+
[type]="type()"
|
|
218
|
+
[disabled]="isInteractionDisabled()"
|
|
219
|
+
[class]="buttonClasses()"
|
|
220
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
221
|
+
[attr.aria-disabled]="isInteractionDisabled() ? 'true' : null"
|
|
222
|
+
[attr.aria-label]="computedAriaLabel()"
|
|
223
|
+
(click)="clicked.emit($event)"
|
|
224
|
+
>
|
|
225
|
+
@if (showLeadingSpinner()) {
|
|
226
|
+
<span class="c2g-btn__spinner" aria-hidden="true"></span>
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
@if (showLeadingIcon()) {
|
|
230
|
+
<span class="c2g-btn__icon" aria-hidden="true">{{ icon() }}</span>
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@if (!iconOnly()) {
|
|
234
|
+
<span class="c2g-btn__content">
|
|
235
|
+
<ng-content />
|
|
236
|
+
</span>
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@if (showTrailingIcon()) {
|
|
240
|
+
<span class="c2g-btn__icon" aria-hidden="true">{{ icon() }}</span>
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@if (showTrailingSpinner()) {
|
|
244
|
+
<span class="c2g-btn__spinner" aria-hidden="true"></span>
|
|
245
|
+
}
|
|
246
|
+
</button>
|
|
247
|
+
`, styles: ["button{display:inline-flex;align-items:center;justify-content:center;gap:var(--c2g-space-2, .5rem);border:none;cursor:pointer;min-height:2rem;font-weight:var(--c2g-font-weight-semibold, 600);font-family:var(--c2g-font-family-base, \"Inter\", \"Segoe UI\", sans-serif);border-radius:var(--c2g-radius-sm, .375rem);transition:background-color var(--c2g-motion-duration-base, .2s) var(--c2g-motion-ease-standard, ease),opacity var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}button:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-button-primary, #2563eb) 30%,transparent)}button:disabled{opacity:.5;cursor:not-allowed}.c2g-btn--loading{cursor:wait}.c2g-btn--sm{padding:calc(var(--c2g-space-1, .25rem) + var(--c2g-space-1, .25rem)) var(--c2g-space-3, .75rem);font-size:var(--c2g-font-size-xs, .75rem)}.c2g-btn--md{padding:calc(var(--c2g-space-2, .5rem) + var(--c2g-space-1, .25rem)) var(--c2g-space-5, 1.25rem);font-size:var(--c2g-font-size-sm, .875rem)}.c2g-btn--lg{padding:var(--c2g-space-4, 1rem) calc(var(--c2g-space-5, 1.25rem) + var(--c2g-space-2, .5rem));font-size:var(--c2g-font-size-md, 1rem)}.c2g-btn--primary{background:var(--c2g-color-button-primary, #2563eb);color:var(--c2g-color-button-primary-text, #1a1714)}.c2g-btn--primary:hover:not(:disabled){background:var(--c2g-color-button-primary-hover, #1d4ed8)}.c2g-btn--secondary{background:var(--c2g-color-button-secondary, #e5e7eb);color:var(--c2g-color-button-secondary-text, #111827)}.c2g-btn--secondary:hover:not(:disabled){background:var(--c2g-color-button-secondary-hover, #d1d5db)}.c2g-btn--ghost{background:transparent;color:var(--c2g-color-button-primary, #2563eb)}.c2g-btn--ghost:hover:not(:disabled){background:var(--c2g-color-button-ghost-hover, #eff6ff)}.c2g-btn--destructive{background:var(--c2g-color-semantic-error, #b23a2b);color:var(--c2g-color-surface, #ffffff)}.c2g-btn--destructive:hover:not(:disabled){background:var(--c2g-color-semantic-error-dark, #8c2d22)}.c2g-btn--icon{background:transparent;color:var(--c2g-color-text-primary, #1a1714);border:1px solid var(--c2g-color-border-soft, #e7ddd5);padding-inline:var(--c2g-space-2, .5rem)}.c2g-btn--icon:hover:not(:disabled){background:var(--c2g-color-bg-subtle, #f6ede7)}.c2g-btn--icon-only{padding:0;width:2.5rem;aspect-ratio:1}.c2g-btn--sm.c2g-btn--icon-only{width:2rem}.c2g-btn--lg.c2g-btn--icon-only{width:3rem}.c2g-btn__content{line-height:1}.c2g-btn__icon{display:inline-flex;font-size:1.05em;line-height:1}.c2g-btn__spinner{width:1em;height:1em;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:c2g-btn-spin .7s linear infinite;display:inline-block}@keyframes c2g-btn-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
248
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconPosition", required: false }] }], iconOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconOnly", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], loadingAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingAriaLabel", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
249
|
+
|
|
250
|
+
class BadgeComponent {
|
|
251
|
+
value = input('1', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
252
|
+
tone = input('accent', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
253
|
+
variant = input('solid', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
254
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
255
|
+
max = input(99, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
256
|
+
dot = input(false, ...(ngDevMode ? [{ debugName: "dot" }] : []));
|
|
257
|
+
dotOnly = input(false, ...(ngDevMode ? [{ debugName: "dotOnly" }] : []));
|
|
258
|
+
dotRing = input(true, ...(ngDevMode ? [{ debugName: "dotRing" }] : []));
|
|
259
|
+
dotPulse = input(false, ...(ngDevMode ? [{ debugName: "dotPulse" }] : []));
|
|
260
|
+
dotColor = input('', ...(ngDevMode ? [{ debugName: "dotColor" }] : []));
|
|
261
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
262
|
+
resolvedAriaLabel = computed(() => this.ariaLabel().trim() || null, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : []));
|
|
263
|
+
content = computed(() => {
|
|
264
|
+
const value = this.value();
|
|
265
|
+
if (typeof value === 'number' && value > this.max()) {
|
|
266
|
+
return `${this.max()}+`;
|
|
267
|
+
}
|
|
268
|
+
return `${value}`;
|
|
269
|
+
}, ...(ngDevMode ? [{ debugName: "content" }] : []));
|
|
270
|
+
classes = computed(() => `c2g-badge c2g-badge--${this.size()} c2g-badge--${this.variant()} c2g-badge--${this.tone()} ${this.dot() && this.dotOnly() ? 'c2g-badge--dot-only' : ''} ${this.dot() && this.dotOnly() && !this.dotRing() ? 'c2g-badge--dot-no-ring' : ''}`, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
271
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
272
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: BadgeComponent, isStandalone: true, selector: "c2g-badge", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, dot: { classPropertyName: "dot", publicName: "dot", isSignal: true, isRequired: false, transformFunction: null }, dotOnly: { classPropertyName: "dotOnly", publicName: "dotOnly", isSignal: true, isRequired: false, transformFunction: null }, dotRing: { classPropertyName: "dotRing", publicName: "dotRing", isSignal: true, isRequired: false, transformFunction: null }, dotPulse: { classPropertyName: "dotPulse", publicName: "dotPulse", isSignal: true, isRequired: false, transformFunction: null }, dotColor: { classPropertyName: "dotColor", publicName: "dotColor", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
273
|
+
<span
|
|
274
|
+
class="c2g-badge"
|
|
275
|
+
[class]="classes()"
|
|
276
|
+
[style.--c2g-badge-dot-color]="dotColor()"
|
|
277
|
+
[attr.role]="dot() && resolvedAriaLabel() ? 'status' : null"
|
|
278
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
279
|
+
[attr.aria-hidden]="dot() && !resolvedAriaLabel() ? 'true' : null"
|
|
280
|
+
>
|
|
281
|
+
@if (dot()) {
|
|
282
|
+
<span class="c2g-badge__dot" [class.c2g-badge__dot--pulse]="dotPulse()" aria-hidden="true"></span>
|
|
283
|
+
}
|
|
284
|
+
@if (!dot() || !dotOnly()) {
|
|
285
|
+
<span>{{ content() }}</span>
|
|
286
|
+
}
|
|
287
|
+
</span>
|
|
288
|
+
`, isInline: true, styles: [".c2g-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;border:1px solid transparent;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);font-weight:var(--c2g-font-weight-semibold, 600);line-height:1;min-width:1.25rem}.c2g-badge--sm{font-size:.6875rem;padding:.16rem .4rem;min-height:1rem}.c2g-badge--md{font-size:var(--c2g-font-size-xs, .75rem);padding:.22rem .5rem;min-height:1.125rem}.c2g-badge__dot{width:.5rem;height:.5rem;border-radius:999px;background:var(--c2g-badge-dot-color, currentColor);margin-right:var(--c2g-space-1, .25rem);flex:0 0 auto}.c2g-badge__dot--pulse{animation:c2g-badge-dot-pulse 1.5s ease-in-out infinite;transform-origin:center}@keyframes c2g-badge-dot-pulse{0%{box-shadow:0 0 color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 45%,transparent);transform:scale(1)}70%{box-shadow:0 0 0 .4rem color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 0%,transparent);transform:scale(1.05)}to{box-shadow:0 0 color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 0%,transparent);transform:scale(1)}}.c2g-badge--dot-only{width:1rem;height:1rem;min-width:1rem;min-height:1rem;padding:0;border-radius:50%}.c2g-badge--dot-only.c2g-badge--sm{width:.875rem;height:.875rem;min-width:.875rem;min-height:.875rem}.c2g-badge--dot-only.c2g-badge--md{width:1rem;height:1rem;min-width:1rem;min-height:1rem}.c2g-badge--dot-only .c2g-badge__dot{margin-right:0}.c2g-badge--dot-no-ring{border-color:transparent!important;background:transparent!important;box-shadow:none}.c2g-badge--solid.c2g-badge--neutral{background:var(--c2g-color-text-secondary, #4a423b);color:#fff}.c2g-badge--solid.c2g-badge--accent{background:var(--c2g-color-primary, #ff6b35);color:#fff}.c2g-badge--solid.c2g-badge--info{background:#1565c0;color:#fff}.c2g-badge--solid.c2g-badge--success{background:#2e7d32;color:#fff}.c2g-badge--solid.c2g-badge--warning{background:#ef6c00;color:#fff}.c2g-badge--solid.c2g-badge--danger{background:#c62828;color:#fff}.c2g-badge--subtle.c2g-badge--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-badge--subtle.c2g-badge--accent{background:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 14%,#ffffff);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 80%,#000000)}.c2g-badge--subtle.c2g-badge--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1}.c2g-badge--subtle.c2g-badge--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20}.c2g-badge--subtle.c2g-badge--warning{background:color-mix(in srgb,#ef6c00 12%,#ffffff);color:#e65100}.c2g-badge--subtle.c2g-badge--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c}.c2g-badge--outline.c2g-badge--neutral{border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 35%,transparent);color:var(--c2g-color-text-secondary, #4a423b);background:transparent}.c2g-badge--outline.c2g-badge--accent{border-color:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 40%,transparent);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 80%,#000000);background:transparent}.c2g-badge--outline.c2g-badge--info{border-color:color-mix(in srgb,#1565c0 40%,transparent);color:#0d47a1;background:transparent}.c2g-badge--outline.c2g-badge--success{border-color:color-mix(in srgb,#2e7d32 40%,transparent);color:#1b5e20;background:transparent}.c2g-badge--outline.c2g-badge--warning{border-color:color-mix(in srgb,#ef6c00 40%,transparent);color:#e65100;background:transparent}.c2g-badge--outline.c2g-badge--danger{border-color:color-mix(in srgb,#c62828 40%,transparent);color:#b71c1c;background:transparent}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
289
|
+
}
|
|
290
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: BadgeComponent, decorators: [{
|
|
291
|
+
type: Component,
|
|
292
|
+
args: [{ selector: 'c2g-badge', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
293
|
+
<span
|
|
294
|
+
class="c2g-badge"
|
|
295
|
+
[class]="classes()"
|
|
296
|
+
[style.--c2g-badge-dot-color]="dotColor()"
|
|
297
|
+
[attr.role]="dot() && resolvedAriaLabel() ? 'status' : null"
|
|
298
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
299
|
+
[attr.aria-hidden]="dot() && !resolvedAriaLabel() ? 'true' : null"
|
|
300
|
+
>
|
|
301
|
+
@if (dot()) {
|
|
302
|
+
<span class="c2g-badge__dot" [class.c2g-badge__dot--pulse]="dotPulse()" aria-hidden="true"></span>
|
|
303
|
+
}
|
|
304
|
+
@if (!dot() || !dotOnly()) {
|
|
305
|
+
<span>{{ content() }}</span>
|
|
306
|
+
}
|
|
307
|
+
</span>
|
|
308
|
+
`, styles: [".c2g-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;border:1px solid transparent;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);font-weight:var(--c2g-font-weight-semibold, 600);line-height:1;min-width:1.25rem}.c2g-badge--sm{font-size:.6875rem;padding:.16rem .4rem;min-height:1rem}.c2g-badge--md{font-size:var(--c2g-font-size-xs, .75rem);padding:.22rem .5rem;min-height:1.125rem}.c2g-badge__dot{width:.5rem;height:.5rem;border-radius:999px;background:var(--c2g-badge-dot-color, currentColor);margin-right:var(--c2g-space-1, .25rem);flex:0 0 auto}.c2g-badge__dot--pulse{animation:c2g-badge-dot-pulse 1.5s ease-in-out infinite;transform-origin:center}@keyframes c2g-badge-dot-pulse{0%{box-shadow:0 0 color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 45%,transparent);transform:scale(1)}70%{box-shadow:0 0 0 .4rem color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 0%,transparent);transform:scale(1.05)}to{box-shadow:0 0 color-mix(in srgb,var(--c2g-badge-dot-color, currentColor) 0%,transparent);transform:scale(1)}}.c2g-badge--dot-only{width:1rem;height:1rem;min-width:1rem;min-height:1rem;padding:0;border-radius:50%}.c2g-badge--dot-only.c2g-badge--sm{width:.875rem;height:.875rem;min-width:.875rem;min-height:.875rem}.c2g-badge--dot-only.c2g-badge--md{width:1rem;height:1rem;min-width:1rem;min-height:1rem}.c2g-badge--dot-only .c2g-badge__dot{margin-right:0}.c2g-badge--dot-no-ring{border-color:transparent!important;background:transparent!important;box-shadow:none}.c2g-badge--solid.c2g-badge--neutral{background:var(--c2g-color-text-secondary, #4a423b);color:#fff}.c2g-badge--solid.c2g-badge--accent{background:var(--c2g-color-primary, #ff6b35);color:#fff}.c2g-badge--solid.c2g-badge--info{background:#1565c0;color:#fff}.c2g-badge--solid.c2g-badge--success{background:#2e7d32;color:#fff}.c2g-badge--solid.c2g-badge--warning{background:#ef6c00;color:#fff}.c2g-badge--solid.c2g-badge--danger{background:#c62828;color:#fff}.c2g-badge--subtle.c2g-badge--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-badge--subtle.c2g-badge--accent{background:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 14%,#ffffff);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 80%,#000000)}.c2g-badge--subtle.c2g-badge--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1}.c2g-badge--subtle.c2g-badge--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20}.c2g-badge--subtle.c2g-badge--warning{background:color-mix(in srgb,#ef6c00 12%,#ffffff);color:#e65100}.c2g-badge--subtle.c2g-badge--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c}.c2g-badge--outline.c2g-badge--neutral{border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 35%,transparent);color:var(--c2g-color-text-secondary, #4a423b);background:transparent}.c2g-badge--outline.c2g-badge--accent{border-color:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 40%,transparent);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 80%,#000000);background:transparent}.c2g-badge--outline.c2g-badge--info{border-color:color-mix(in srgb,#1565c0 40%,transparent);color:#0d47a1;background:transparent}.c2g-badge--outline.c2g-badge--success{border-color:color-mix(in srgb,#2e7d32 40%,transparent);color:#1b5e20;background:transparent}.c2g-badge--outline.c2g-badge--warning{border-color:color-mix(in srgb,#ef6c00 40%,transparent);color:#e65100;background:transparent}.c2g-badge--outline.c2g-badge--danger{border-color:color-mix(in srgb,#c62828 40%,transparent);color:#b71c1c;background:transparent}\n"] }]
|
|
309
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], dot: [{ type: i0.Input, args: [{ isSignal: true, alias: "dot", required: false }] }], dotOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotOnly", required: false }] }], dotRing: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotRing", required: false }] }], dotPulse: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotPulse", required: false }] }], dotColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotColor", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
|
|
310
|
+
|
|
311
|
+
class ChipComponent {
|
|
312
|
+
label = input('Chip', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
313
|
+
tone = input('neutral', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
314
|
+
selected = input(false, ...(ngDevMode ? [{ debugName: "selected" }] : []));
|
|
315
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
316
|
+
removable = input(false, ...(ngDevMode ? [{ debugName: "removable" }] : []));
|
|
317
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
318
|
+
removeAriaLabel = input('Chip entfernen', ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : []));
|
|
319
|
+
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
320
|
+
iconAriaLabel = input('', ...(ngDevMode ? [{ debugName: "iconAriaLabel" }] : []));
|
|
321
|
+
iconFontSet = input('', ...(ngDevMode ? [{ debugName: "iconFontSet" }] : []));
|
|
322
|
+
iconFontIcon = input('', ...(ngDevMode ? [{ debugName: "iconFontIcon" }] : []));
|
|
323
|
+
selectedChange = output();
|
|
324
|
+
removed = output();
|
|
325
|
+
isSelected = signal(false, ...(ngDevMode ? [{ debugName: "isSelected" }] : []));
|
|
326
|
+
chipClasses = computed(() => `c2g-chip c2g-chip--${this.tone()} ${this.isSelected() ? 'c2g-chip--selected' : ''}`, ...(ngDevMode ? [{ debugName: "chipClasses" }] : []));
|
|
327
|
+
constructor() {
|
|
328
|
+
effect(() => {
|
|
329
|
+
this.isSelected.set(this.selected());
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
toggleSelected() {
|
|
333
|
+
if (this.disabled()) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
const next = !this.isSelected();
|
|
337
|
+
this.isSelected.set(next);
|
|
338
|
+
this.selectedChange.emit(next);
|
|
339
|
+
}
|
|
340
|
+
remove(event) {
|
|
341
|
+
event.stopPropagation();
|
|
342
|
+
if (this.disabled()) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this.removed.emit();
|
|
346
|
+
}
|
|
347
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ChipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
348
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ChipComponent, isStandalone: true, selector: "c2g-chip", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, removable: { classPropertyName: "removable", publicName: "removable", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, removeAriaLabel: { classPropertyName: "removeAriaLabel", publicName: "removeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconAriaLabel: { classPropertyName: "iconAriaLabel", publicName: "iconAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, iconFontSet: { classPropertyName: "iconFontSet", publicName: "iconFontSet", isSignal: true, isRequired: false, transformFunction: null }, iconFontIcon: { classPropertyName: "iconFontIcon", publicName: "iconFontIcon", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange", removed: "removed" }, ngImport: i0, template: `
|
|
349
|
+
<span class="c2g-chip" [class]="chipClasses()">
|
|
350
|
+
<button
|
|
351
|
+
type="button"
|
|
352
|
+
class="c2g-chip__action"
|
|
353
|
+
[disabled]="disabled()"
|
|
354
|
+
[attr.aria-pressed]="isSelected() ? 'true' : 'false'"
|
|
355
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
356
|
+
(click)="toggleSelected()"
|
|
357
|
+
>
|
|
358
|
+
@if (icon() || iconFontIcon()) {
|
|
359
|
+
<mat-icon
|
|
360
|
+
class="c2g-chip__icon"
|
|
361
|
+
[fontSet]="iconFontSet()"
|
|
362
|
+
[fontIcon]="iconFontIcon()"
|
|
363
|
+
[attr.aria-label]="iconAriaLabel() || null"
|
|
364
|
+
[attr.aria-hidden]="iconAriaLabel() ? null : 'true'"
|
|
365
|
+
>
|
|
366
|
+
{{ icon() }}
|
|
367
|
+
</mat-icon>
|
|
368
|
+
}
|
|
369
|
+
<span>{{ label() }}</span>
|
|
370
|
+
</button>
|
|
371
|
+
|
|
372
|
+
@if (removable()) {
|
|
373
|
+
<button
|
|
374
|
+
type="button"
|
|
375
|
+
class="c2g-chip__remove"
|
|
376
|
+
[disabled]="disabled()"
|
|
377
|
+
[attr.aria-label]="removeAriaLabel()"
|
|
378
|
+
(click)="remove($event)"
|
|
379
|
+
>
|
|
380
|
+
<mat-icon class="c2g-chip__remove-icon" aria-hidden="true">close</mat-icon>
|
|
381
|
+
</button>
|
|
382
|
+
}
|
|
383
|
+
</span>
|
|
384
|
+
`, isInline: true, styles: [".c2g-chip{display:inline-flex;align-items:center;border-radius:999px;border:1px solid transparent;overflow:hidden;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-chip__action,.c2g-chip__remove{border:none;background:transparent;color:inherit;display:inline-flex;align-items:center;cursor:pointer;font:inherit;line-height:1}.c2g-chip__action{gap:var(--c2g-space-1, .25rem);padding:.35rem .6rem}.c2g-chip__remove{padding:.35rem .45rem .35rem .25rem;border-left:1px solid color-mix(in srgb,currentColor 24%,transparent)}.c2g-chip__icon,.c2g-chip__remove-icon{width:.875rem;height:.875rem;font-size:.8125rem;line-height:1}.c2g-chip__action:focus-visible,.c2g-chip__remove:focus-visible{outline:none;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-chip__action:disabled,.c2g-chip__remove:disabled{cursor:not-allowed;opacity:.6}.c2g-chip--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b);border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 20%,transparent)}.c2g-chip--accent{background:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 13%,#ffffff);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 78%,#000000);border-color:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 35%,transparent)}.c2g-chip--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1;border-color:color-mix(in srgb,#1565c0 36%,transparent)}.c2g-chip--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20;border-color:color-mix(in srgb,#2e7d32 36%,transparent)}.c2g-chip--warning{background:color-mix(in srgb,#ef6c00 13%,#ffffff);color:#e65100;border-color:color-mix(in srgb,#ef6c00 36%,transparent)}.c2g-chip--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c;border-color:color-mix(in srgb,#c62828 36%,transparent)}.c2g-chip--selected{box-shadow:inset 0 0 0 1px color-mix(in srgb,currentColor 40%,transparent);background:color-mix(in srgb,currentColor 18%,#ffffff)}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
385
|
+
}
|
|
386
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ChipComponent, decorators: [{
|
|
387
|
+
type: Component,
|
|
388
|
+
args: [{ selector: 'c2g-chip', standalone: true, imports: [MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
389
|
+
<span class="c2g-chip" [class]="chipClasses()">
|
|
390
|
+
<button
|
|
391
|
+
type="button"
|
|
392
|
+
class="c2g-chip__action"
|
|
393
|
+
[disabled]="disabled()"
|
|
394
|
+
[attr.aria-pressed]="isSelected() ? 'true' : 'false'"
|
|
395
|
+
[attr.aria-label]="ariaLabel() || null"
|
|
396
|
+
(click)="toggleSelected()"
|
|
397
|
+
>
|
|
398
|
+
@if (icon() || iconFontIcon()) {
|
|
399
|
+
<mat-icon
|
|
400
|
+
class="c2g-chip__icon"
|
|
401
|
+
[fontSet]="iconFontSet()"
|
|
402
|
+
[fontIcon]="iconFontIcon()"
|
|
403
|
+
[attr.aria-label]="iconAriaLabel() || null"
|
|
404
|
+
[attr.aria-hidden]="iconAriaLabel() ? null : 'true'"
|
|
405
|
+
>
|
|
406
|
+
{{ icon() }}
|
|
407
|
+
</mat-icon>
|
|
408
|
+
}
|
|
409
|
+
<span>{{ label() }}</span>
|
|
410
|
+
</button>
|
|
411
|
+
|
|
412
|
+
@if (removable()) {
|
|
413
|
+
<button
|
|
414
|
+
type="button"
|
|
415
|
+
class="c2g-chip__remove"
|
|
416
|
+
[disabled]="disabled()"
|
|
417
|
+
[attr.aria-label]="removeAriaLabel()"
|
|
418
|
+
(click)="remove($event)"
|
|
419
|
+
>
|
|
420
|
+
<mat-icon class="c2g-chip__remove-icon" aria-hidden="true">close</mat-icon>
|
|
421
|
+
</button>
|
|
422
|
+
}
|
|
423
|
+
</span>
|
|
424
|
+
`, styles: [".c2g-chip{display:inline-flex;align-items:center;border-radius:999px;border:1px solid transparent;overflow:hidden;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-chip__action,.c2g-chip__remove{border:none;background:transparent;color:inherit;display:inline-flex;align-items:center;cursor:pointer;font:inherit;line-height:1}.c2g-chip__action{gap:var(--c2g-space-1, .25rem);padding:.35rem .6rem}.c2g-chip__remove{padding:.35rem .45rem .35rem .25rem;border-left:1px solid color-mix(in srgb,currentColor 24%,transparent)}.c2g-chip__icon,.c2g-chip__remove-icon{width:.875rem;height:.875rem;font-size:.8125rem;line-height:1}.c2g-chip__action:focus-visible,.c2g-chip__remove:focus-visible{outline:none;box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-chip__action:disabled,.c2g-chip__remove:disabled{cursor:not-allowed;opacity:.6}.c2g-chip--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b);border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 20%,transparent)}.c2g-chip--accent{background:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 13%,#ffffff);color:color-mix(in srgb,var(--c2g-color-primary-dark, #e55623) 78%,#000000);border-color:color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 35%,transparent)}.c2g-chip--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1;border-color:color-mix(in srgb,#1565c0 36%,transparent)}.c2g-chip--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20;border-color:color-mix(in srgb,#2e7d32 36%,transparent)}.c2g-chip--warning{background:color-mix(in srgb,#ef6c00 13%,#ffffff);color:#e65100;border-color:color-mix(in srgb,#ef6c00 36%,transparent)}.c2g-chip--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c;border-color:color-mix(in srgb,#c62828 36%,transparent)}.c2g-chip--selected{box-shadow:inset 0 0 0 1px color-mix(in srgb,currentColor 40%,transparent);background:color-mix(in srgb,currentColor 18%,#ffffff)}\n"] }]
|
|
425
|
+
}], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], removeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAriaLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAriaLabel", required: false }] }], iconFontSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconFontSet", required: false }] }], iconFontIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconFontIcon", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }], removed: [{ type: i0.Output, args: ["removed"] }] } });
|
|
426
|
+
|
|
427
|
+
let nextCheckboxId = 0;
|
|
428
|
+
class CheckboxComponent {
|
|
429
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
430
|
+
label = input('Option', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
431
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
432
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
433
|
+
checkedChange = output();
|
|
434
|
+
checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
435
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
436
|
+
generatedId = `c2g-checkbox-${++nextCheckboxId}`;
|
|
437
|
+
checkboxId = computed(() => this.id().trim() || this.generatedId, ...(ngDevMode ? [{ debugName: "checkboxId" }] : []));
|
|
438
|
+
hintId = computed(() => `${this.checkboxId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : []));
|
|
439
|
+
describedBy = computed(() => (this.hint().trim() ? this.hintId() : null), ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
440
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
441
|
+
onChange = () => { };
|
|
442
|
+
onTouched = () => { };
|
|
443
|
+
writeValue(value) {
|
|
444
|
+
this.checked.set(!!value);
|
|
445
|
+
}
|
|
446
|
+
registerOnChange(fn) {
|
|
447
|
+
this.onChange = fn;
|
|
448
|
+
}
|
|
449
|
+
registerOnTouched(fn) {
|
|
450
|
+
this.onTouched = fn;
|
|
451
|
+
}
|
|
452
|
+
setDisabledState(isDisabled) {
|
|
453
|
+
this.cvaDisabled.set(isDisabled);
|
|
454
|
+
}
|
|
455
|
+
onInput(event) {
|
|
456
|
+
const next = event.target.checked;
|
|
457
|
+
this.checked.set(next);
|
|
458
|
+
this.onChange(next);
|
|
459
|
+
this.checkedChange.emit(next);
|
|
460
|
+
}
|
|
461
|
+
onBlur() {
|
|
462
|
+
this.onTouched();
|
|
463
|
+
}
|
|
464
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
465
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: CheckboxComponent, isStandalone: true, selector: "c2g-checkbox", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
466
|
+
{
|
|
467
|
+
provide: NG_VALUE_ACCESSOR,
|
|
468
|
+
useExisting: forwardRef(() => CheckboxComponent),
|
|
469
|
+
multi: true,
|
|
470
|
+
},
|
|
471
|
+
], ngImport: i0, template: `
|
|
472
|
+
<label class="c2g-checkbox" [class.c2g-checkbox--disabled]="isDisabled()" [attr.for]="checkboxId()">
|
|
473
|
+
<input
|
|
474
|
+
class="c2g-checkbox__input"
|
|
475
|
+
type="checkbox"
|
|
476
|
+
[id]="checkboxId()"
|
|
477
|
+
[checked]="checked()"
|
|
478
|
+
[disabled]="isDisabled()"
|
|
479
|
+
[attr.aria-describedby]="describedBy()"
|
|
480
|
+
(change)="onInput($event)"
|
|
481
|
+
(blur)="onBlur()"
|
|
482
|
+
/>
|
|
483
|
+
<span class="c2g-checkbox__box" aria-hidden="true"></span>
|
|
484
|
+
<span class="c2g-checkbox__label">{{ label() }}</span>
|
|
485
|
+
</label>
|
|
486
|
+
|
|
487
|
+
@if (hint().trim()) {
|
|
488
|
+
<p class="c2g-checkbox__hint" [id]="hintId()">{{ hint() }}</p>
|
|
489
|
+
}
|
|
490
|
+
`, isInline: true, styles: [".c2g-checkbox{display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-primary, #1a1714)}.c2g-checkbox--disabled{opacity:.55;cursor:not-allowed}.c2g-checkbox__input{position:absolute;opacity:0;pointer-events:none}.c2g-checkbox__box{width:1.125rem;height:1.125rem;border-radius:var(--c2g-radius-sm, .375rem);border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));background:var(--c2g-color-surface, #ffffff);display:inline-block;transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease);position:relative}.c2g-checkbox__input:checked+.c2g-checkbox__box{border-color:var(--c2g-color-primary-dark, #e55623);background:var(--c2g-color-primary, #ff6b35)}.c2g-checkbox__input:checked+.c2g-checkbox__box:after{content:\"\";position:absolute;left:.33rem;top:.12rem;width:.27rem;height:.55rem;border:solid var(--c2g-color-surface, #ffffff);border-width:0 2px 2px 0;transform:rotate(45deg)}.c2g-checkbox__input:focus-visible+.c2g-checkbox__box{box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-checkbox__label{font-size:var(--c2g-font-size-sm, .875rem)}.c2g-checkbox__hint{margin:var(--c2g-space-1, .25rem) 0 0 1.65rem;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
491
|
+
}
|
|
492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: CheckboxComponent, decorators: [{
|
|
493
|
+
type: Component,
|
|
494
|
+
args: [{ selector: 'c2g-checkbox', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
495
|
+
{
|
|
496
|
+
provide: NG_VALUE_ACCESSOR,
|
|
497
|
+
useExisting: forwardRef(() => CheckboxComponent),
|
|
498
|
+
multi: true,
|
|
499
|
+
},
|
|
500
|
+
], template: `
|
|
501
|
+
<label class="c2g-checkbox" [class.c2g-checkbox--disabled]="isDisabled()" [attr.for]="checkboxId()">
|
|
502
|
+
<input
|
|
503
|
+
class="c2g-checkbox__input"
|
|
504
|
+
type="checkbox"
|
|
505
|
+
[id]="checkboxId()"
|
|
506
|
+
[checked]="checked()"
|
|
507
|
+
[disabled]="isDisabled()"
|
|
508
|
+
[attr.aria-describedby]="describedBy()"
|
|
509
|
+
(change)="onInput($event)"
|
|
510
|
+
(blur)="onBlur()"
|
|
511
|
+
/>
|
|
512
|
+
<span class="c2g-checkbox__box" aria-hidden="true"></span>
|
|
513
|
+
<span class="c2g-checkbox__label">{{ label() }}</span>
|
|
514
|
+
</label>
|
|
515
|
+
|
|
516
|
+
@if (hint().trim()) {
|
|
517
|
+
<p class="c2g-checkbox__hint" [id]="hintId()">{{ hint() }}</p>
|
|
518
|
+
}
|
|
519
|
+
`, styles: [".c2g-checkbox{display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);cursor:pointer;-webkit-user-select:none;user-select:none;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-primary, #1a1714)}.c2g-checkbox--disabled{opacity:.55;cursor:not-allowed}.c2g-checkbox__input{position:absolute;opacity:0;pointer-events:none}.c2g-checkbox__box{width:1.125rem;height:1.125rem;border-radius:var(--c2g-radius-sm, .375rem);border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));background:var(--c2g-color-surface, #ffffff);display:inline-block;transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease);position:relative}.c2g-checkbox__input:checked+.c2g-checkbox__box{border-color:var(--c2g-color-primary-dark, #e55623);background:var(--c2g-color-primary, #ff6b35)}.c2g-checkbox__input:checked+.c2g-checkbox__box:after{content:\"\";position:absolute;left:.33rem;top:.12rem;width:.27rem;height:.55rem;border:solid var(--c2g-color-surface, #ffffff);border-width:0 2px 2px 0;transform:rotate(45deg)}.c2g-checkbox__input:focus-visible+.c2g-checkbox__box{box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-checkbox__label{font-size:var(--c2g-font-size-sm, .875rem)}.c2g-checkbox__hint{margin:var(--c2g-space-1, .25rem) 0 0 1.65rem;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}\n"] }]
|
|
520
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
521
|
+
|
|
522
|
+
class LoaderComponent {
|
|
523
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
524
|
+
tone = input('primary', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
525
|
+
label = input('Laden...', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
526
|
+
showLabel = input(true, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
527
|
+
inline = input(true, ...(ngDevMode ? [{ debugName: "inline" }] : []));
|
|
528
|
+
ariaLabel = computed(() => this.label().trim() || 'Ladevorgang', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
529
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
530
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LoaderComponent, isStandalone: true, selector: "c2g-loader", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
531
|
+
<span
|
|
532
|
+
class="c2g-loader"
|
|
533
|
+
role="status"
|
|
534
|
+
[class.c2g-loader--inline]="inline()"
|
|
535
|
+
[class.c2g-loader--block]="!inline()"
|
|
536
|
+
[class.c2g-loader--sm]="size() === 'sm'"
|
|
537
|
+
[class.c2g-loader--md]="size() === 'md'"
|
|
538
|
+
[class.c2g-loader--lg]="size() === 'lg'"
|
|
539
|
+
[class.c2g-loader--primary]="tone() === 'primary'"
|
|
540
|
+
[class.c2g-loader--neutral]="tone() === 'neutral'"
|
|
541
|
+
[class.c2g-loader--inverse]="tone() === 'inverse'"
|
|
542
|
+
[attr.aria-label]="ariaLabel()"
|
|
543
|
+
>
|
|
544
|
+
<span class="c2g-loader__spinner" aria-hidden="true"></span>
|
|
545
|
+
@if (showLabel()) {
|
|
546
|
+
<span class="c2g-loader__label">{{ label() }}</span>
|
|
547
|
+
}
|
|
548
|
+
</span>
|
|
549
|
+
`, isInline: true, styles: [".c2g-loader{--loader-color: var(--c2g-color-primary, #ff6b35);--loader-size: 1.25rem;display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-loader--inline{display:inline-flex}.c2g-loader--block{display:flex;width:100%}.c2g-loader--sm{--loader-size: .9rem;font-size:var(--c2g-font-size-xs, .75rem)}.c2g-loader--md{--loader-size: 1.25rem;font-size:var(--c2g-font-size-sm, .875rem)}.c2g-loader--lg{--loader-size: 1.75rem;font-size:var(--c2g-font-size-md, 1rem)}.c2g-loader--primary{--loader-color: var(--c2g-color-primary, #ff6b35)}.c2g-loader--neutral{--loader-color: var(--c2g-color-text-muted, #6b5e52)}.c2g-loader--inverse{--loader-color: var(--c2g-color-surface, #ffffff);color:var(--c2g-color-surface, #ffffff)}.c2g-loader__spinner{width:var(--loader-size);height:var(--loader-size);border-radius:999px;border:2px solid color-mix(in srgb,var(--loader-color) 24%,transparent);border-top-color:var(--loader-color);animation:c2g-loader-spin .8s linear infinite;flex-shrink:0}.c2g-loader__label{line-height:1.2}@keyframes c2g-loader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
550
|
+
}
|
|
551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LoaderComponent, decorators: [{
|
|
552
|
+
type: Component,
|
|
553
|
+
args: [{ selector: 'c2g-loader', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
554
|
+
<span
|
|
555
|
+
class="c2g-loader"
|
|
556
|
+
role="status"
|
|
557
|
+
[class.c2g-loader--inline]="inline()"
|
|
558
|
+
[class.c2g-loader--block]="!inline()"
|
|
559
|
+
[class.c2g-loader--sm]="size() === 'sm'"
|
|
560
|
+
[class.c2g-loader--md]="size() === 'md'"
|
|
561
|
+
[class.c2g-loader--lg]="size() === 'lg'"
|
|
562
|
+
[class.c2g-loader--primary]="tone() === 'primary'"
|
|
563
|
+
[class.c2g-loader--neutral]="tone() === 'neutral'"
|
|
564
|
+
[class.c2g-loader--inverse]="tone() === 'inverse'"
|
|
565
|
+
[attr.aria-label]="ariaLabel()"
|
|
566
|
+
>
|
|
567
|
+
<span class="c2g-loader__spinner" aria-hidden="true"></span>
|
|
568
|
+
@if (showLabel()) {
|
|
569
|
+
<span class="c2g-loader__label">{{ label() }}</span>
|
|
570
|
+
}
|
|
571
|
+
</span>
|
|
572
|
+
`, styles: [".c2g-loader{--loader-color: var(--c2g-color-primary, #ff6b35);--loader-size: 1.25rem;display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-loader--inline{display:inline-flex}.c2g-loader--block{display:flex;width:100%}.c2g-loader--sm{--loader-size: .9rem;font-size:var(--c2g-font-size-xs, .75rem)}.c2g-loader--md{--loader-size: 1.25rem;font-size:var(--c2g-font-size-sm, .875rem)}.c2g-loader--lg{--loader-size: 1.75rem;font-size:var(--c2g-font-size-md, 1rem)}.c2g-loader--primary{--loader-color: var(--c2g-color-primary, #ff6b35)}.c2g-loader--neutral{--loader-color: var(--c2g-color-text-muted, #6b5e52)}.c2g-loader--inverse{--loader-color: var(--c2g-color-surface, #ffffff);color:var(--c2g-color-surface, #ffffff)}.c2g-loader__spinner{width:var(--loader-size);height:var(--loader-size);border-radius:999px;border:2px solid color-mix(in srgb,var(--loader-color) 24%,transparent);border-top-color:var(--loader-color);animation:c2g-loader-spin .8s linear infinite;flex-shrink:0}.c2g-loader__label{line-height:1.2}@keyframes c2g-loader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
573
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], inline: [{ type: i0.Input, args: [{ isSignal: true, alias: "inline", required: false }] }] } });
|
|
574
|
+
|
|
575
|
+
const C2G_LOTTIE_PRESET_OPTIONS = [
|
|
576
|
+
'beach',
|
|
577
|
+
'camping',
|
|
578
|
+
'car',
|
|
579
|
+
'cat-love',
|
|
580
|
+
'checklist',
|
|
581
|
+
'coffee-time',
|
|
582
|
+
'car-driving-landscape',
|
|
583
|
+
'error-404',
|
|
584
|
+
'fishing',
|
|
585
|
+
'mountain-search',
|
|
586
|
+
'planning',
|
|
587
|
+
'share',
|
|
588
|
+
'summer-camp',
|
|
589
|
+
'thinking',
|
|
590
|
+
'walking-orange',
|
|
591
|
+
'walking-avocado',
|
|
592
|
+
'weather-partly-cloudy',
|
|
593
|
+
];
|
|
594
|
+
const C2G_LOTTIE_PRESET_PATHS = {
|
|
595
|
+
beach: '/assets/animations/beach-animation.json',
|
|
596
|
+
camping: '/assets/animations/camping-animation.json',
|
|
597
|
+
car: '/assets/animations/car-animation.json',
|
|
598
|
+
'cat-love': '/assets/animations/cat-love-animation.json',
|
|
599
|
+
checklist: '/assets/animations/checklist-animation.json',
|
|
600
|
+
'error-404': '/assets/animations/error-404.json',
|
|
601
|
+
fishing: '/assets/animations/fishing-animation.json',
|
|
602
|
+
'mountain-search': '/assets/animations/mountain-search-animation.json',
|
|
603
|
+
planning: '/assets/animations/planning-animation.json',
|
|
604
|
+
share: '/assets/animations/share-animation.json',
|
|
605
|
+
'summer-camp': '/assets/animations/summer-camp-animation.json',
|
|
606
|
+
thinking: '/assets/animations/thinking-animation.json',
|
|
607
|
+
'coffee-time': '/assets/animations/coffee-time-animation.json',
|
|
608
|
+
'car-driving-landscape': '/assets/animations/car-driving-landscape-animation.json',
|
|
609
|
+
'walking-orange': '/assets/animations/walking-orange-animation.json',
|
|
610
|
+
'walking-avocado': '/assets/animations/walking-avocado-animation.json',
|
|
611
|
+
'weather-partly-cloudy': '/assets/animations/weather-partly-cloudy-animation.json',
|
|
612
|
+
};
|
|
613
|
+
const C2G_LOTTIE_PRESET_IMPORTERS = {
|
|
614
|
+
beach: () => import('./camp2gether-c2g-ui-beach-animation-ipi3OoKW.mjs'),
|
|
615
|
+
camping: () => import('./camp2gether-c2g-ui-camping-animation-DY6XWXyF.mjs'),
|
|
616
|
+
car: () => import('./camp2gether-c2g-ui-car-animation-DnDp7WfG.mjs'),
|
|
617
|
+
'cat-love': () => import('./camp2gether-c2g-ui-cat-love-animation-ewC7fZyY.mjs'),
|
|
618
|
+
checklist: () => import('./camp2gether-c2g-ui-checklist-animation-DqUkcLqI.mjs'),
|
|
619
|
+
'error-404': () => import('./camp2gether-c2g-ui-error-404-pdjg-EHb.mjs'),
|
|
620
|
+
fishing: () => import('./camp2gether-c2g-ui-fishing-animation-DwE3IF-V.mjs'),
|
|
621
|
+
'mountain-search': () => import('./camp2gether-c2g-ui-mountain-search-animation-TebM1gS4.mjs'),
|
|
622
|
+
planning: () => import('./camp2gether-c2g-ui-planning-animation-D8QSsZk6.mjs'),
|
|
623
|
+
share: () => import('./camp2gether-c2g-ui-share-animation-qgqs-k59.mjs'),
|
|
624
|
+
'summer-camp': () => import('./camp2gether-c2g-ui-summer-camp-animation-DPzirVNH.mjs'),
|
|
625
|
+
thinking: () => import('./camp2gether-c2g-ui-thinking-animation--X3er_pf.mjs'),
|
|
626
|
+
'coffee-time': () => import('./camp2gether-c2g-ui-coffee-time-animation-DQilaE0A.mjs'),
|
|
627
|
+
'car-driving-landscape': () => import('./camp2gether-c2g-ui-car-driving-landscape-animation-CawNeMKD.mjs'),
|
|
628
|
+
'walking-orange': () => import('./camp2gether-c2g-ui-walking-orange-animation-CTJniCsF.mjs'),
|
|
629
|
+
'walking-avocado': () => import('./camp2gether-c2g-ui-walking-avocado-animation-CQMU2C9-.mjs'),
|
|
630
|
+
'weather-partly-cloudy': () => import('./camp2gether-c2g-ui-weather-partly-cloudy-animation-Cnw3W4cS.mjs'),
|
|
631
|
+
};
|
|
632
|
+
async function loadC2gLottiePresetData(preset) {
|
|
633
|
+
const module = await C2G_LOTTIE_PRESET_IMPORTERS[preset]();
|
|
634
|
+
return module.default;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
class LottieLoaderComponent {
|
|
638
|
+
preset = input('cat-love', ...(ngDevMode ? [{ debugName: "preset" }] : []));
|
|
639
|
+
presetMode = input('embedded', ...(ngDevMode ? [{ debugName: "presetMode" }] : []));
|
|
640
|
+
animationPath = input('', ...(ngDevMode ? [{ debugName: "animationPath" }] : []));
|
|
641
|
+
animationData = input(null, ...(ngDevMode ? [{ debugName: "animationData" }] : []));
|
|
642
|
+
loop = input(true, ...(ngDevMode ? [{ debugName: "loop" }] : []));
|
|
643
|
+
autoplay = input(true, ...(ngDevMode ? [{ debugName: "autoplay" }] : []));
|
|
644
|
+
width = input('96px', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
645
|
+
height = input('96px', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
646
|
+
label = input('Lade...', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
647
|
+
showLabel = input(true, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
648
|
+
ariaLabel = computed(() => this.label().trim() || 'Ladevorgang', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
649
|
+
lazyPresetData = signal(null, ...(ngDevMode ? [{ debugName: "lazyPresetData" }] : []));
|
|
650
|
+
hasRenderableAnimation = computed(() => {
|
|
651
|
+
const animationData = this.animationData();
|
|
652
|
+
if (animationData) {
|
|
653
|
+
return true;
|
|
654
|
+
}
|
|
655
|
+
if (this.animationPath().trim()) {
|
|
656
|
+
return true;
|
|
657
|
+
}
|
|
658
|
+
if (this.presetMode() === 'path') {
|
|
659
|
+
return true;
|
|
660
|
+
}
|
|
661
|
+
return this.lazyPresetData() !== null;
|
|
662
|
+
}, ...(ngDevMode ? [{ debugName: "hasRenderableAnimation" }] : []));
|
|
663
|
+
constructor() {
|
|
664
|
+
effect((onCleanup) => {
|
|
665
|
+
const hasCustomData = this.animationData() !== null;
|
|
666
|
+
const hasCustomPath = this.animationPath().trim().length > 0;
|
|
667
|
+
const mode = this.presetMode();
|
|
668
|
+
const preset = this.preset();
|
|
669
|
+
if (hasCustomData || hasCustomPath || mode === 'path') {
|
|
670
|
+
this.lazyPresetData.set(null);
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
let cancelled = false;
|
|
674
|
+
this.lazyPresetData.set(null);
|
|
675
|
+
void loadC2gLottiePresetData(preset)
|
|
676
|
+
.then((data) => {
|
|
677
|
+
if (!cancelled) {
|
|
678
|
+
this.lazyPresetData.set(data);
|
|
679
|
+
}
|
|
680
|
+
})
|
|
681
|
+
.catch(() => {
|
|
682
|
+
if (!cancelled) {
|
|
683
|
+
this.lazyPresetData.set(null);
|
|
684
|
+
}
|
|
685
|
+
});
|
|
686
|
+
onCleanup(() => {
|
|
687
|
+
cancelled = true;
|
|
688
|
+
});
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
cloneAnimationData(value) {
|
|
692
|
+
if (typeof structuredClone === 'function') {
|
|
693
|
+
return structuredClone(value);
|
|
694
|
+
}
|
|
695
|
+
return JSON.parse(JSON.stringify(value));
|
|
696
|
+
}
|
|
697
|
+
options = computed(() => {
|
|
698
|
+
const base = {
|
|
699
|
+
loop: this.loop(),
|
|
700
|
+
autoplay: this.autoplay(),
|
|
701
|
+
};
|
|
702
|
+
const animationData = this.animationData();
|
|
703
|
+
if (animationData) {
|
|
704
|
+
return {
|
|
705
|
+
...base,
|
|
706
|
+
// ngx-lottie/lottie-web may mutate animationData; clone to avoid shared-state issues.
|
|
707
|
+
animationData: this.cloneAnimationData(animationData),
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
const explicitPath = this.animationPath().trim();
|
|
711
|
+
if (explicitPath) {
|
|
712
|
+
return {
|
|
713
|
+
...base,
|
|
714
|
+
path: explicitPath,
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
if (this.presetMode() === 'path') {
|
|
718
|
+
return {
|
|
719
|
+
...base,
|
|
720
|
+
path: C2G_LOTTIE_PRESET_PATHS[this.preset()],
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
const lazyData = this.lazyPresetData();
|
|
724
|
+
if (!lazyData) {
|
|
725
|
+
return base;
|
|
726
|
+
}
|
|
727
|
+
return {
|
|
728
|
+
...base,
|
|
729
|
+
animationData: this.cloneAnimationData(lazyData),
|
|
730
|
+
};
|
|
731
|
+
}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
732
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LottieLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
733
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: LottieLoaderComponent, isStandalone: true, selector: "c2g-lottie-loader", inputs: { preset: { classPropertyName: "preset", publicName: "preset", isSignal: true, isRequired: false, transformFunction: null }, presetMode: { classPropertyName: "presetMode", publicName: "presetMode", isSignal: true, isRequired: false, transformFunction: null }, animationPath: { classPropertyName: "animationPath", publicName: "animationPath", isSignal: true, isRequired: false, transformFunction: null }, animationData: { classPropertyName: "animationData", publicName: "animationData", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, autoplay: { classPropertyName: "autoplay", publicName: "autoplay", 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 }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
734
|
+
<div class="c2g-lottie-loader" role="status" [attr.aria-label]="ariaLabel()">
|
|
735
|
+
@if (hasRenderableAnimation()) {
|
|
736
|
+
<ng-lottie
|
|
737
|
+
class="c2g-lottie-loader__animation"
|
|
738
|
+
[options]="options()"
|
|
739
|
+
[width]="width()"
|
|
740
|
+
[height]="height()"
|
|
741
|
+
aria-hidden="true"
|
|
742
|
+
></ng-lottie>
|
|
743
|
+
} @else {
|
|
744
|
+
<span class="c2g-lottie-loader__fallback" aria-hidden="true"></span>
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
@if (showLabel()) {
|
|
748
|
+
<span class="c2g-lottie-loader__label">{{ label() }}</span>
|
|
749
|
+
}
|
|
750
|
+
</div>
|
|
751
|
+
`, isInline: true, styles: [".c2g-lottie-loader{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-lottie-loader__animation{display:inline-block;line-height:0}.c2g-lottie-loader__fallback{width:1.5rem;height:1.5rem;border-radius:999px;border:2px solid color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 24%,transparent);border-top-color:var(--c2g-color-primary, #ff6b35);animation:c2g-lottie-loader-fallback-spin .8s linear infinite}.c2g-lottie-loader__label{font-size:var(--c2g-font-size-sm, .875rem);line-height:1.2;text-align:center}@keyframes c2g-lottie-loader-fallback-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "component", type: LottieComponent, selector: "ng-lottie", inputs: ["width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
752
|
+
}
|
|
753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: LottieLoaderComponent, decorators: [{
|
|
754
|
+
type: Component,
|
|
755
|
+
args: [{ selector: 'c2g-lottie-loader', standalone: true, imports: [LottieComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
756
|
+
<div class="c2g-lottie-loader" role="status" [attr.aria-label]="ariaLabel()">
|
|
757
|
+
@if (hasRenderableAnimation()) {
|
|
758
|
+
<ng-lottie
|
|
759
|
+
class="c2g-lottie-loader__animation"
|
|
760
|
+
[options]="options()"
|
|
761
|
+
[width]="width()"
|
|
762
|
+
[height]="height()"
|
|
763
|
+
aria-hidden="true"
|
|
764
|
+
></ng-lottie>
|
|
765
|
+
} @else {
|
|
766
|
+
<span class="c2g-lottie-loader__fallback" aria-hidden="true"></span>
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
@if (showLabel()) {
|
|
770
|
+
<span class="c2g-lottie-loader__label">{{ label() }}</span>
|
|
771
|
+
}
|
|
772
|
+
</div>
|
|
773
|
+
`, styles: [".c2g-lottie-loader{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-lottie-loader__animation{display:inline-block;line-height:0}.c2g-lottie-loader__fallback{width:1.5rem;height:1.5rem;border-radius:999px;border:2px solid color-mix(in srgb,var(--c2g-color-primary, #ff6b35) 24%,transparent);border-top-color:var(--c2g-color-primary, #ff6b35);animation:c2g-lottie-loader-fallback-spin .8s linear infinite}.c2g-lottie-loader__label{font-size:var(--c2g-font-size-sm, .875rem);line-height:1.2;text-align:center}@keyframes c2g-lottie-loader-fallback-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
774
|
+
}], ctorParameters: () => [], propDecorators: { preset: [{ type: i0.Input, args: [{ isSignal: true, alias: "preset", required: false }] }], presetMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "presetMode", required: false }] }], animationPath: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationPath", required: false }] }], animationData: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationData", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], autoplay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoplay", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }] } });
|
|
775
|
+
|
|
776
|
+
class SkeletonComponent {
|
|
777
|
+
variant = input('text', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
778
|
+
width = input('100%', ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
779
|
+
height = input('', ...(ngDevMode ? [{ debugName: "height" }] : []));
|
|
780
|
+
radius = input('', ...(ngDevMode ? [{ debugName: "radius" }] : []));
|
|
781
|
+
animated = input(true, ...(ngDevMode ? [{ debugName: "animated" }] : []));
|
|
782
|
+
resolvedWidth = computed(() => (this.width().trim() ? this.width() : '100%'), ...(ngDevMode ? [{ debugName: "resolvedWidth" }] : []));
|
|
783
|
+
resolvedHeight = computed(() => {
|
|
784
|
+
if (this.height().trim()) {
|
|
785
|
+
return this.height();
|
|
786
|
+
}
|
|
787
|
+
if (this.variant() === 'avatar') {
|
|
788
|
+
return '2.5rem';
|
|
789
|
+
}
|
|
790
|
+
if (this.variant() === 'block') {
|
|
791
|
+
return '5.5rem';
|
|
792
|
+
}
|
|
793
|
+
return '0.95rem';
|
|
794
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedHeight" }] : []));
|
|
795
|
+
resolvedRadius = computed(() => {
|
|
796
|
+
if (this.radius().trim()) {
|
|
797
|
+
return this.radius();
|
|
798
|
+
}
|
|
799
|
+
return this.variant() === 'avatar' ? '999px' : '0.45rem';
|
|
800
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedRadius" }] : []));
|
|
801
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
802
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.19", type: SkeletonComponent, isStandalone: true, selector: "c2g-skeleton", inputs: { variant: { classPropertyName: "variant", publicName: "variant", 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 }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
803
|
+
<span
|
|
804
|
+
class="c2g-skeleton"
|
|
805
|
+
[class.c2g-skeleton--animated]="animated()"
|
|
806
|
+
[class.c2g-skeleton--text]="variant() === 'text'"
|
|
807
|
+
[class.c2g-skeleton--block]="variant() === 'block'"
|
|
808
|
+
[class.c2g-skeleton--avatar]="variant() === 'avatar'"
|
|
809
|
+
[style.width]="resolvedWidth()"
|
|
810
|
+
[style.height]="resolvedHeight()"
|
|
811
|
+
[style.borderRadius]="resolvedRadius()"
|
|
812
|
+
aria-hidden="true"
|
|
813
|
+
></span>
|
|
814
|
+
`, isInline: true, styles: [".c2g-skeleton{display:inline-block;width:100%;height:1rem;border-radius:var(--c2g-radius-sm, .375rem);background:linear-gradient(90deg,color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 78%,#ffffff),color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 56%,#ffffff) 45%,color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 78%,#ffffff));background-size:240% 100%}.c2g-skeleton--animated{animation:c2g-skeleton-shimmer 1.5s ease-in-out infinite}.c2g-skeleton--text{height:.95rem;border-radius:.45rem}.c2g-skeleton--block{height:5.5rem}.c2g-skeleton--avatar{width:2.5rem;height:2.5rem;border-radius:999px}@keyframes c2g-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-40% 0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
815
|
+
}
|
|
816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SkeletonComponent, decorators: [{
|
|
817
|
+
type: Component,
|
|
818
|
+
args: [{ selector: 'c2g-skeleton', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
819
|
+
<span
|
|
820
|
+
class="c2g-skeleton"
|
|
821
|
+
[class.c2g-skeleton--animated]="animated()"
|
|
822
|
+
[class.c2g-skeleton--text]="variant() === 'text'"
|
|
823
|
+
[class.c2g-skeleton--block]="variant() === 'block'"
|
|
824
|
+
[class.c2g-skeleton--avatar]="variant() === 'avatar'"
|
|
825
|
+
[style.width]="resolvedWidth()"
|
|
826
|
+
[style.height]="resolvedHeight()"
|
|
827
|
+
[style.borderRadius]="resolvedRadius()"
|
|
828
|
+
aria-hidden="true"
|
|
829
|
+
></span>
|
|
830
|
+
`, styles: [".c2g-skeleton{display:inline-block;width:100%;height:1rem;border-radius:var(--c2g-radius-sm, .375rem);background:linear-gradient(90deg,color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 78%,#ffffff),color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 56%,#ffffff) 45%,color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 78%,#ffffff));background-size:240% 100%}.c2g-skeleton--animated{animation:c2g-skeleton-shimmer 1.5s ease-in-out infinite}.c2g-skeleton--text{height:.95rem;border-radius:.45rem}.c2g-skeleton--block{height:5.5rem}.c2g-skeleton--avatar{width:2.5rem;height:2.5rem;border-radius:999px}@keyframes c2g-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-40% 0}}\n"] }]
|
|
831
|
+
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }] } });
|
|
832
|
+
|
|
833
|
+
class AlertComponent {
|
|
834
|
+
tone = input('info', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
835
|
+
variant = input('soft', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
836
|
+
title = input('Hinweis', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
837
|
+
message = input('', ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
838
|
+
open = input(undefined, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
839
|
+
dismissible = input(false, ...(ngDevMode ? [{ debugName: "dismissible" }] : []));
|
|
840
|
+
closeLabel = input('Hinweis schliessen', ...(ngDevMode ? [{ debugName: "closeLabel" }] : []));
|
|
841
|
+
dismissed = output();
|
|
842
|
+
internalVisible = signal(true, ...(ngDevMode ? [{ debugName: "internalVisible" }] : []));
|
|
843
|
+
visible = computed(() => {
|
|
844
|
+
const externallyControlled = this.open();
|
|
845
|
+
return externallyControlled === undefined ? this.internalVisible() : externallyControlled;
|
|
846
|
+
}, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
847
|
+
liveRole = computed(() => (this.tone() === 'danger' || this.tone() === 'warning' ? 'alert' : 'status'), ...(ngDevMode ? [{ debugName: "liveRole" }] : []));
|
|
848
|
+
ariaLive = computed(() => (this.liveRole() === 'alert' ? 'assertive' : 'polite'), ...(ngDevMode ? [{ debugName: "ariaLive" }] : []));
|
|
849
|
+
iconSymbol = computed(() => {
|
|
850
|
+
switch (this.tone()) {
|
|
851
|
+
case 'success':
|
|
852
|
+
return 'v';
|
|
853
|
+
case 'warning':
|
|
854
|
+
return '!';
|
|
855
|
+
case 'danger':
|
|
856
|
+
return 'x';
|
|
857
|
+
default:
|
|
858
|
+
return 'i';
|
|
859
|
+
}
|
|
860
|
+
}, ...(ngDevMode ? [{ debugName: "iconSymbol" }] : []));
|
|
861
|
+
dismiss() {
|
|
862
|
+
if (this.open() === undefined) {
|
|
863
|
+
this.internalVisible.set(false);
|
|
864
|
+
}
|
|
865
|
+
this.dismissed.emit();
|
|
866
|
+
}
|
|
867
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
868
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AlertComponent, isStandalone: true, selector: "c2g-alert", inputs: { tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, closeLabel: { classPropertyName: "closeLabel", publicName: "closeLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismissed: "dismissed" }, ngImport: i0, template: `
|
|
869
|
+
@if (visible()) {
|
|
870
|
+
<section
|
|
871
|
+
class="c2g-alert"
|
|
872
|
+
[class.c2g-alert--soft]="variant() === 'soft'"
|
|
873
|
+
[class.c2g-alert--solid]="variant() === 'solid'"
|
|
874
|
+
[class.c2g-alert--outline]="variant() === 'outline'"
|
|
875
|
+
[class.c2g-alert--info]="tone() === 'info'"
|
|
876
|
+
[class.c2g-alert--success]="tone() === 'success'"
|
|
877
|
+
[class.c2g-alert--warning]="tone() === 'warning'"
|
|
878
|
+
[class.c2g-alert--danger]="tone() === 'danger'"
|
|
879
|
+
[attr.role]="liveRole()"
|
|
880
|
+
[attr.aria-live]="ariaLive()"
|
|
881
|
+
>
|
|
882
|
+
<span class="c2g-alert__icon" aria-hidden="true">{{ iconSymbol() }}</span>
|
|
883
|
+
|
|
884
|
+
<div class="c2g-alert__content">
|
|
885
|
+
@if (title().trim()) {
|
|
886
|
+
<h4 class="c2g-alert__title">{{ title() }}</h4>
|
|
887
|
+
}
|
|
888
|
+
@if (message().trim()) {
|
|
889
|
+
<p class="c2g-alert__message">{{ message() }}</p>
|
|
890
|
+
}
|
|
891
|
+
</div>
|
|
892
|
+
|
|
893
|
+
@if (dismissible()) {
|
|
894
|
+
<button
|
|
895
|
+
type="button"
|
|
896
|
+
class="c2g-alert__close"
|
|
897
|
+
(click)="dismiss()"
|
|
898
|
+
[attr.aria-label]="closeLabel()"
|
|
899
|
+
>
|
|
900
|
+
x
|
|
901
|
+
</button>
|
|
902
|
+
}
|
|
903
|
+
</section>
|
|
904
|
+
}
|
|
905
|
+
`, isInline: true, styles: [".c2g-alert{--alert-fg: #1a1714;--alert-bg: color-mix(in srgb, var(--c2g-color-neutral-200, #e1d9ce) 35%, #ffffff);--alert-border: color-mix(in srgb, var(--c2g-color-border-subtle, rgba(74, 66, 59, .18)) 100%, transparent);display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:var(--c2g-space-3, .75rem);padding:var(--c2g-space-3, .75rem) var(--c2g-space-4, 1rem);border-radius:var(--c2g-radius-md, .625rem);border:1px solid var(--alert-border);color:var(--alert-fg);background:var(--alert-bg);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-alert--info{--alert-fg: #134a7c;--alert-bg: color-mix(in srgb, #4aa3ff 14%, #ffffff);--alert-border: color-mix(in srgb, #4aa3ff 36%, transparent)}.c2g-alert--success{--alert-fg: #1f6b41;--alert-bg: color-mix(in srgb, #43b581 14%, #ffffff);--alert-border: color-mix(in srgb, #43b581 36%, transparent)}.c2g-alert--warning{--alert-fg: #6c4a0a;--alert-bg: color-mix(in srgb, #ffb020 16%, #ffffff);--alert-border: color-mix(in srgb, #ffb020 42%, transparent)}.c2g-alert--danger{--alert-fg: #802e2e;--alert-bg: color-mix(in srgb, #ef4444 14%, #ffffff);--alert-border: color-mix(in srgb, #ef4444 40%, transparent)}.c2g-alert--solid{background:color-mix(in srgb,var(--alert-fg) 88%,#000000 0%);color:#fff;border-color:transparent}.c2g-alert--outline{background:transparent;border-width:2px}.c2g-alert__icon{width:1.25rem;line-height:1.25rem;text-align:center;font-weight:700;margin-top:.08rem}.c2g-alert__title{margin:0;font-size:var(--c2g-font-size-sm, .875rem);font-weight:var(--c2g-font-weight-semibold, 600);line-height:1.2}.c2g-alert__message{margin:.2rem 0 0;font-size:var(--c2g-font-size-sm, .875rem);line-height:1.35}.c2g-alert__close{border:none;background:transparent;color:inherit;font-weight:700;font-size:.875rem;line-height:1;cursor:pointer;border-radius:var(--c2g-radius-sm, .375rem);padding:.25rem}.c2g-alert__close:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 24%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
906
|
+
}
|
|
907
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AlertComponent, decorators: [{
|
|
908
|
+
type: Component,
|
|
909
|
+
args: [{ selector: 'c2g-alert', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
910
|
+
@if (visible()) {
|
|
911
|
+
<section
|
|
912
|
+
class="c2g-alert"
|
|
913
|
+
[class.c2g-alert--soft]="variant() === 'soft'"
|
|
914
|
+
[class.c2g-alert--solid]="variant() === 'solid'"
|
|
915
|
+
[class.c2g-alert--outline]="variant() === 'outline'"
|
|
916
|
+
[class.c2g-alert--info]="tone() === 'info'"
|
|
917
|
+
[class.c2g-alert--success]="tone() === 'success'"
|
|
918
|
+
[class.c2g-alert--warning]="tone() === 'warning'"
|
|
919
|
+
[class.c2g-alert--danger]="tone() === 'danger'"
|
|
920
|
+
[attr.role]="liveRole()"
|
|
921
|
+
[attr.aria-live]="ariaLive()"
|
|
922
|
+
>
|
|
923
|
+
<span class="c2g-alert__icon" aria-hidden="true">{{ iconSymbol() }}</span>
|
|
924
|
+
|
|
925
|
+
<div class="c2g-alert__content">
|
|
926
|
+
@if (title().trim()) {
|
|
927
|
+
<h4 class="c2g-alert__title">{{ title() }}</h4>
|
|
928
|
+
}
|
|
929
|
+
@if (message().trim()) {
|
|
930
|
+
<p class="c2g-alert__message">{{ message() }}</p>
|
|
931
|
+
}
|
|
932
|
+
</div>
|
|
933
|
+
|
|
934
|
+
@if (dismissible()) {
|
|
935
|
+
<button
|
|
936
|
+
type="button"
|
|
937
|
+
class="c2g-alert__close"
|
|
938
|
+
(click)="dismiss()"
|
|
939
|
+
[attr.aria-label]="closeLabel()"
|
|
940
|
+
>
|
|
941
|
+
x
|
|
942
|
+
</button>
|
|
943
|
+
}
|
|
944
|
+
</section>
|
|
945
|
+
}
|
|
946
|
+
`, styles: [".c2g-alert{--alert-fg: #1a1714;--alert-bg: color-mix(in srgb, var(--c2g-color-neutral-200, #e1d9ce) 35%, #ffffff);--alert-border: color-mix(in srgb, var(--c2g-color-border-subtle, rgba(74, 66, 59, .18)) 100%, transparent);display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:var(--c2g-space-3, .75rem);padding:var(--c2g-space-3, .75rem) var(--c2g-space-4, 1rem);border-radius:var(--c2g-radius-md, .625rem);border:1px solid var(--alert-border);color:var(--alert-fg);background:var(--alert-bg);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-alert--info{--alert-fg: #134a7c;--alert-bg: color-mix(in srgb, #4aa3ff 14%, #ffffff);--alert-border: color-mix(in srgb, #4aa3ff 36%, transparent)}.c2g-alert--success{--alert-fg: #1f6b41;--alert-bg: color-mix(in srgb, #43b581 14%, #ffffff);--alert-border: color-mix(in srgb, #43b581 36%, transparent)}.c2g-alert--warning{--alert-fg: #6c4a0a;--alert-bg: color-mix(in srgb, #ffb020 16%, #ffffff);--alert-border: color-mix(in srgb, #ffb020 42%, transparent)}.c2g-alert--danger{--alert-fg: #802e2e;--alert-bg: color-mix(in srgb, #ef4444 14%, #ffffff);--alert-border: color-mix(in srgb, #ef4444 40%, transparent)}.c2g-alert--solid{background:color-mix(in srgb,var(--alert-fg) 88%,#000000 0%);color:#fff;border-color:transparent}.c2g-alert--outline{background:transparent;border-width:2px}.c2g-alert__icon{width:1.25rem;line-height:1.25rem;text-align:center;font-weight:700;margin-top:.08rem}.c2g-alert__title{margin:0;font-size:var(--c2g-font-size-sm, .875rem);font-weight:var(--c2g-font-weight-semibold, 600);line-height:1.2}.c2g-alert__message{margin:.2rem 0 0;font-size:var(--c2g-font-size-sm, .875rem);line-height:1.35}.c2g-alert__close{border:none;background:transparent;color:inherit;font-weight:700;font-size:.875rem;line-height:1;cursor:pointer;border-radius:var(--c2g-radius-sm, .375rem);padding:.25rem}.c2g-alert__close:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,currentColor 24%,transparent)}\n"] }]
|
|
947
|
+
}], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], closeLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeLabel", required: false }] }], dismissed: [{ type: i0.Output, args: ["dismissed"] }] } });
|
|
948
|
+
|
|
949
|
+
class ProgressComponent {
|
|
950
|
+
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
951
|
+
max = input(100, ...(ngDevMode ? [{ debugName: "max" }] : []));
|
|
952
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
953
|
+
tone = input('primary', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
954
|
+
label = input('Fortschritt', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
955
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
956
|
+
showLabel = input(true, ...(ngDevMode ? [{ debugName: "showLabel" }] : []));
|
|
957
|
+
striped = input(false, ...(ngDevMode ? [{ debugName: "striped" }] : []));
|
|
958
|
+
animated = input(false, ...(ngDevMode ? [{ debugName: "animated" }] : []));
|
|
959
|
+
indeterminate = input(false, ...(ngDevMode ? [{ debugName: "indeterminate" }] : []));
|
|
960
|
+
safeMax = computed(() => (this.max() > 0 ? this.max() : 100), ...(ngDevMode ? [{ debugName: "safeMax" }] : []));
|
|
961
|
+
clampedValue = computed(() => {
|
|
962
|
+
const next = this.value();
|
|
963
|
+
return Math.min(Math.max(next, 0), this.safeMax());
|
|
964
|
+
}, ...(ngDevMode ? [{ debugName: "clampedValue" }] : []));
|
|
965
|
+
percent = computed(() => (this.clampedValue() / this.safeMax()) * 100, ...(ngDevMode ? [{ debugName: "percent" }] : []));
|
|
966
|
+
percentLabel = computed(() => `${Math.round(this.percent())}%`, ...(ngDevMode ? [{ debugName: "percentLabel" }] : []));
|
|
967
|
+
resolvedAriaLabel = computed(() => {
|
|
968
|
+
const explicit = this.ariaLabel().trim();
|
|
969
|
+
if (explicit) {
|
|
970
|
+
return explicit;
|
|
971
|
+
}
|
|
972
|
+
const fromLabel = this.label().trim();
|
|
973
|
+
return fromLabel || 'Fortschritt';
|
|
974
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : []));
|
|
975
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ProgressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
976
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ProgressComponent, isStandalone: true, selector: "c2g-progress", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, striped: { classPropertyName: "striped", publicName: "striped", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
977
|
+
<div class="c2g-progress" [class.c2g-progress--indeterminate]="indeterminate()">
|
|
978
|
+
@if (showLabel()) {
|
|
979
|
+
<div class="c2g-progress__meta">
|
|
980
|
+
<span class="c2g-progress__label">{{ label() }}</span>
|
|
981
|
+
@if (!indeterminate()) {
|
|
982
|
+
<span class="c2g-progress__value">{{ percentLabel() }}</span>
|
|
983
|
+
}
|
|
984
|
+
</div>
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
<div
|
|
988
|
+
class="c2g-progress__track"
|
|
989
|
+
role="progressbar"
|
|
990
|
+
[class.c2g-progress__track--sm]="size() === 'sm'"
|
|
991
|
+
[class.c2g-progress__track--md]="size() === 'md'"
|
|
992
|
+
[class.c2g-progress__track--lg]="size() === 'lg'"
|
|
993
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
994
|
+
[attr.aria-valuemin]="indeterminate() ? null : 0"
|
|
995
|
+
[attr.aria-valuemax]="indeterminate() ? null : safeMax()"
|
|
996
|
+
[attr.aria-valuenow]="indeterminate() ? null : clampedValue()"
|
|
997
|
+
>
|
|
998
|
+
<span
|
|
999
|
+
class="c2g-progress__bar"
|
|
1000
|
+
[class.c2g-progress__bar--primary]="tone() === 'primary'"
|
|
1001
|
+
[class.c2g-progress__bar--success]="tone() === 'success'"
|
|
1002
|
+
[class.c2g-progress__bar--warning]="tone() === 'warning'"
|
|
1003
|
+
[class.c2g-progress__bar--danger]="tone() === 'danger'"
|
|
1004
|
+
[class.c2g-progress__bar--striped]="striped()"
|
|
1005
|
+
[class.c2g-progress__bar--animated]="animated()"
|
|
1006
|
+
[style.width.%]="indeterminate() ? 38 : percent()"
|
|
1007
|
+
></span>
|
|
1008
|
+
</div>
|
|
1009
|
+
</div>
|
|
1010
|
+
`, isInline: true, styles: [".c2g-progress{display:grid;gap:var(--c2g-space-2, .5rem);width:100%;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-progress__meta{display:flex;justify-content:space-between;align-items:center;gap:var(--c2g-space-3, .75rem);font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-progress__label{font-weight:var(--c2g-font-weight-semibold, 600)}.c2g-progress__track{width:100%;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 70%,#ffffff)}.c2g-progress__track--sm{height:.375rem}.c2g-progress__track--md{height:.625rem}.c2g-progress__track--lg{height:.875rem}.c2g-progress__bar{display:block;height:100%;width:0;border-radius:inherit;transition:width .22s ease;background:var(--c2g-color-primary, #ff6b35)}.c2g-progress__bar--primary{background:var(--c2g-color-primary, #ff6b35)}.c2g-progress__bar--success{background:#43b581}.c2g-progress__bar--warning{background:#ffb020}.c2g-progress__bar--danger{background:#ef4444}.c2g-progress__bar--striped{background-image:linear-gradient(45deg,color-mix(in srgb,#ffffff 18%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,#ffffff 18%,transparent) 50%,color-mix(in srgb,#ffffff 18%,transparent) 75%,transparent 75%,transparent);background-size:1rem 1rem}.c2g-progress__bar--animated{animation:c2g-progress-shift .9s linear infinite}.c2g-progress--indeterminate .c2g-progress__bar{animation:c2g-progress-indeterminate 1.2s ease-in-out infinite;transform-origin:left center}@keyframes c2g-progress-shift{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes c2g-progress-indeterminate{0%{transform:translate(-120%)}50%{transform:translate(120%)}to{transform:translate(220%)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1011
|
+
}
|
|
1012
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ProgressComponent, decorators: [{
|
|
1013
|
+
type: Component,
|
|
1014
|
+
args: [{ selector: 'c2g-progress', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1015
|
+
<div class="c2g-progress" [class.c2g-progress--indeterminate]="indeterminate()">
|
|
1016
|
+
@if (showLabel()) {
|
|
1017
|
+
<div class="c2g-progress__meta">
|
|
1018
|
+
<span class="c2g-progress__label">{{ label() }}</span>
|
|
1019
|
+
@if (!indeterminate()) {
|
|
1020
|
+
<span class="c2g-progress__value">{{ percentLabel() }}</span>
|
|
1021
|
+
}
|
|
1022
|
+
</div>
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
<div
|
|
1026
|
+
class="c2g-progress__track"
|
|
1027
|
+
role="progressbar"
|
|
1028
|
+
[class.c2g-progress__track--sm]="size() === 'sm'"
|
|
1029
|
+
[class.c2g-progress__track--md]="size() === 'md'"
|
|
1030
|
+
[class.c2g-progress__track--lg]="size() === 'lg'"
|
|
1031
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
1032
|
+
[attr.aria-valuemin]="indeterminate() ? null : 0"
|
|
1033
|
+
[attr.aria-valuemax]="indeterminate() ? null : safeMax()"
|
|
1034
|
+
[attr.aria-valuenow]="indeterminate() ? null : clampedValue()"
|
|
1035
|
+
>
|
|
1036
|
+
<span
|
|
1037
|
+
class="c2g-progress__bar"
|
|
1038
|
+
[class.c2g-progress__bar--primary]="tone() === 'primary'"
|
|
1039
|
+
[class.c2g-progress__bar--success]="tone() === 'success'"
|
|
1040
|
+
[class.c2g-progress__bar--warning]="tone() === 'warning'"
|
|
1041
|
+
[class.c2g-progress__bar--danger]="tone() === 'danger'"
|
|
1042
|
+
[class.c2g-progress__bar--striped]="striped()"
|
|
1043
|
+
[class.c2g-progress__bar--animated]="animated()"
|
|
1044
|
+
[style.width.%]="indeterminate() ? 38 : percent()"
|
|
1045
|
+
></span>
|
|
1046
|
+
</div>
|
|
1047
|
+
</div>
|
|
1048
|
+
`, styles: [".c2g-progress{display:grid;gap:var(--c2g-space-2, .5rem);width:100%;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-progress__meta{display:flex;justify-content:space-between;align-items:center;gap:var(--c2g-space-3, .75rem);font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-progress__label{font-weight:var(--c2g-font-weight-semibold, 600)}.c2g-progress__track{width:100%;border-radius:999px;overflow:hidden;background:color-mix(in srgb,var(--c2g-color-neutral-200, #e1d9ce) 70%,#ffffff)}.c2g-progress__track--sm{height:.375rem}.c2g-progress__track--md{height:.625rem}.c2g-progress__track--lg{height:.875rem}.c2g-progress__bar{display:block;height:100%;width:0;border-radius:inherit;transition:width .22s ease;background:var(--c2g-color-primary, #ff6b35)}.c2g-progress__bar--primary{background:var(--c2g-color-primary, #ff6b35)}.c2g-progress__bar--success{background:#43b581}.c2g-progress__bar--warning{background:#ffb020}.c2g-progress__bar--danger{background:#ef4444}.c2g-progress__bar--striped{background-image:linear-gradient(45deg,color-mix(in srgb,#ffffff 18%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,#ffffff 18%,transparent) 50%,color-mix(in srgb,#ffffff 18%,transparent) 75%,transparent 75%,transparent);background-size:1rem 1rem}.c2g-progress__bar--animated{animation:c2g-progress-shift .9s linear infinite}.c2g-progress--indeterminate .c2g-progress__bar{animation:c2g-progress-indeterminate 1.2s ease-in-out infinite;transform-origin:left center}@keyframes c2g-progress-shift{0%{background-position:1rem 0}to{background-position:0 0}}@keyframes c2g-progress-indeterminate{0%{transform:translate(-120%)}50%{transform:translate(120%)}to{transform:translate(220%)}}\n"] }]
|
|
1049
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], striped: [{ type: i0.Input, args: [{ isSignal: true, alias: "striped", required: false }] }], animated: [{ type: i0.Input, args: [{ isSignal: true, alias: "animated", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }] } });
|
|
1050
|
+
|
|
1051
|
+
let nextInputId = 0;
|
|
1052
|
+
class InputComponent {
|
|
1053
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1054
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1055
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1056
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1057
|
+
prefix = input('', ...(ngDevMode ? [{ debugName: "prefix" }] : []));
|
|
1058
|
+
suffix = input('', ...(ngDevMode ? [{ debugName: "suffix" }] : []));
|
|
1059
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1060
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1061
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
1062
|
+
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
|
|
1063
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1064
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
1065
|
+
valueChanged = output();
|
|
1066
|
+
value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1067
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
1068
|
+
generatedId = `c2g-input-${++nextInputId}`;
|
|
1069
|
+
inputId = computed(() => this.id().trim() || this.generatedId, ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
1070
|
+
hintId = computed(() => `${this.inputId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : []));
|
|
1071
|
+
errorId = computed(() => `${this.inputId()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : []));
|
|
1072
|
+
counterId = computed(() => `${this.inputId()}-counter`, ...(ngDevMode ? [{ debugName: "counterId" }] : []));
|
|
1073
|
+
describedBy = computed(() => {
|
|
1074
|
+
const ids = [];
|
|
1075
|
+
if (this.error().trim()) {
|
|
1076
|
+
ids.push(this.errorId());
|
|
1077
|
+
}
|
|
1078
|
+
else if (this.hint().trim()) {
|
|
1079
|
+
ids.push(this.hintId());
|
|
1080
|
+
}
|
|
1081
|
+
if (this.showCounter()) {
|
|
1082
|
+
ids.push(this.counterId());
|
|
1083
|
+
}
|
|
1084
|
+
return ids.length > 0 ? ids.join(' ') : null;
|
|
1085
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1086
|
+
valueLength = computed(() => this.value().length, ...(ngDevMode ? [{ debugName: "valueLength" }] : []));
|
|
1087
|
+
showCounter = computed(() => (this.maxLength() ?? 0) > 0, ...(ngDevMode ? [{ debugName: "showCounter" }] : []));
|
|
1088
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1089
|
+
onChange = () => { };
|
|
1090
|
+
onTouched = () => { };
|
|
1091
|
+
writeValue(value) {
|
|
1092
|
+
this.value.set(value ?? '');
|
|
1093
|
+
}
|
|
1094
|
+
registerOnChange(fn) {
|
|
1095
|
+
this.onChange = fn;
|
|
1096
|
+
}
|
|
1097
|
+
registerOnTouched(fn) {
|
|
1098
|
+
this.onTouched = fn;
|
|
1099
|
+
}
|
|
1100
|
+
setDisabledState(isDisabled) {
|
|
1101
|
+
this.cvaDisabled.set(isDisabled);
|
|
1102
|
+
}
|
|
1103
|
+
onInput(event) {
|
|
1104
|
+
const nextValue = event.target.value;
|
|
1105
|
+
this.value.set(nextValue);
|
|
1106
|
+
this.onChange(nextValue);
|
|
1107
|
+
this.valueChanged.emit(nextValue);
|
|
1108
|
+
}
|
|
1109
|
+
onBlur() {
|
|
1110
|
+
this.onTouched();
|
|
1111
|
+
}
|
|
1112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: InputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: InputComponent, isStandalone: true, selector: "c2g-input", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, providers: [
|
|
1114
|
+
{
|
|
1115
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1116
|
+
useExisting: forwardRef(() => InputComponent),
|
|
1117
|
+
multi: true,
|
|
1118
|
+
},
|
|
1119
|
+
], ngImport: i0, template: `
|
|
1120
|
+
<div class="c2g-field">
|
|
1121
|
+
@if (label().trim()) {
|
|
1122
|
+
<label class="c2g-field__label" [attr.for]="inputId()">
|
|
1123
|
+
{{ label() }}
|
|
1124
|
+
@if (required()) {
|
|
1125
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1126
|
+
}
|
|
1127
|
+
</label>
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1131
|
+
@if (prefix().trim()) {
|
|
1132
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ prefix() }}</span>
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
<input
|
|
1136
|
+
class="c2g-field__control"
|
|
1137
|
+
[id]="inputId()"
|
|
1138
|
+
[type]="type()"
|
|
1139
|
+
[value]="value()"
|
|
1140
|
+
[placeholder]="placeholder()"
|
|
1141
|
+
[disabled]="isDisabled()"
|
|
1142
|
+
[required]="required()"
|
|
1143
|
+
[attr.maxlength]="maxLength() || null"
|
|
1144
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1145
|
+
[attr.aria-describedby]="describedBy()"
|
|
1146
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
1147
|
+
(input)="onInput($event)"
|
|
1148
|
+
(blur)="onBlur()"
|
|
1149
|
+
/>
|
|
1150
|
+
|
|
1151
|
+
@if (loading()) {
|
|
1152
|
+
<span class="c2g-field__spinner" aria-hidden="true"></span>
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
@if (suffix().trim()) {
|
|
1156
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ suffix() }}</span>
|
|
1157
|
+
}
|
|
1158
|
+
</div>
|
|
1159
|
+
|
|
1160
|
+
<div class="c2g-field__meta">
|
|
1161
|
+
@if (error().trim()) {
|
|
1162
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1163
|
+
} @else if (hint().trim()) {
|
|
1164
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
@if (showCounter()) {
|
|
1168
|
+
<span class="c2g-field__counter" [id]="counterId()">{{ valueLength() }} / {{ maxLength() }}</span>
|
|
1169
|
+
}
|
|
1170
|
+
</div>
|
|
1171
|
+
</div>
|
|
1172
|
+
`, isInline: true, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{min-height:2.75rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:center;gap:var(--c2g-space-2, .5rem);padding:0 var(--c2g-space-3, .75rem);transition:border-color var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;padding:0}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__affix{color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-sm, .875rem);white-space:nowrap}.c2g-field__spinner{width:1rem;height:1rem;border:2px solid var(--c2g-color-primary, #ff6b35);border-right-color:transparent;border-radius:999px;animation:c2g-field-spin .8s linear infinite;flex:0 0 auto}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-field__counter{margin-left:auto;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52);font-variant-numeric:tabular-nums}@keyframes c2g-field-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1173
|
+
}
|
|
1174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: InputComponent, decorators: [{
|
|
1175
|
+
type: Component,
|
|
1176
|
+
args: [{ selector: 'c2g-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1177
|
+
{
|
|
1178
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1179
|
+
useExisting: forwardRef(() => InputComponent),
|
|
1180
|
+
multi: true,
|
|
1181
|
+
},
|
|
1182
|
+
], template: `
|
|
1183
|
+
<div class="c2g-field">
|
|
1184
|
+
@if (label().trim()) {
|
|
1185
|
+
<label class="c2g-field__label" [attr.for]="inputId()">
|
|
1186
|
+
{{ label() }}
|
|
1187
|
+
@if (required()) {
|
|
1188
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1189
|
+
}
|
|
1190
|
+
</label>
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1194
|
+
@if (prefix().trim()) {
|
|
1195
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ prefix() }}</span>
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
<input
|
|
1199
|
+
class="c2g-field__control"
|
|
1200
|
+
[id]="inputId()"
|
|
1201
|
+
[type]="type()"
|
|
1202
|
+
[value]="value()"
|
|
1203
|
+
[placeholder]="placeholder()"
|
|
1204
|
+
[disabled]="isDisabled()"
|
|
1205
|
+
[required]="required()"
|
|
1206
|
+
[attr.maxlength]="maxLength() || null"
|
|
1207
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1208
|
+
[attr.aria-describedby]="describedBy()"
|
|
1209
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
1210
|
+
(input)="onInput($event)"
|
|
1211
|
+
(blur)="onBlur()"
|
|
1212
|
+
/>
|
|
1213
|
+
|
|
1214
|
+
@if (loading()) {
|
|
1215
|
+
<span class="c2g-field__spinner" aria-hidden="true"></span>
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
@if (suffix().trim()) {
|
|
1219
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ suffix() }}</span>
|
|
1220
|
+
}
|
|
1221
|
+
</div>
|
|
1222
|
+
|
|
1223
|
+
<div class="c2g-field__meta">
|
|
1224
|
+
@if (error().trim()) {
|
|
1225
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1226
|
+
} @else if (hint().trim()) {
|
|
1227
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
@if (showCounter()) {
|
|
1231
|
+
<span class="c2g-field__counter" [id]="counterId()">{{ valueLength() }} / {{ maxLength() }}</span>
|
|
1232
|
+
}
|
|
1233
|
+
</div>
|
|
1234
|
+
</div>
|
|
1235
|
+
`, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{min-height:2.75rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:center;gap:var(--c2g-space-2, .5rem);padding:0 var(--c2g-space-3, .75rem);transition:border-color var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;padding:0}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__affix{color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-sm, .875rem);white-space:nowrap}.c2g-field__spinner{width:1rem;height:1rem;border:2px solid var(--c2g-color-primary, #ff6b35);border-right-color:transparent;border-radius:999px;animation:c2g-field-spin .8s linear infinite;flex:0 0 auto}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-field__counter{margin-left:auto;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52);font-variant-numeric:tabular-nums}@keyframes c2g-field-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
1236
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
1237
|
+
|
|
1238
|
+
let nextRadioGroupId = 0;
|
|
1239
|
+
class RadioGroupComponent {
|
|
1240
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1241
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1242
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1243
|
+
orientation = input('vertical', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
1244
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1245
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
1246
|
+
valueChange = output();
|
|
1247
|
+
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1248
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
1249
|
+
generatedName = `c2g-radio-group-${++nextRadioGroupId}`;
|
|
1250
|
+
groupName = computed(() => this.name().trim() || this.generatedName, ...(ngDevMode ? [{ debugName: "groupName" }] : []));
|
|
1251
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1252
|
+
onChange = () => { };
|
|
1253
|
+
onTouched = () => { };
|
|
1254
|
+
writeValue(value) {
|
|
1255
|
+
this.value.set(value);
|
|
1256
|
+
}
|
|
1257
|
+
registerOnChange(fn) {
|
|
1258
|
+
this.onChange = fn;
|
|
1259
|
+
}
|
|
1260
|
+
registerOnTouched(fn) {
|
|
1261
|
+
this.onTouched = fn;
|
|
1262
|
+
}
|
|
1263
|
+
setDisabledState(isDisabled) {
|
|
1264
|
+
this.cvaDisabled.set(isDisabled);
|
|
1265
|
+
}
|
|
1266
|
+
isOptionDisabled(option) {
|
|
1267
|
+
return this.isDisabled() || !!option.disabled;
|
|
1268
|
+
}
|
|
1269
|
+
selectOption(next) {
|
|
1270
|
+
if (this.isDisabled()) {
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
this.value.set(next);
|
|
1274
|
+
this.onChange(next);
|
|
1275
|
+
this.valueChange.emit(next);
|
|
1276
|
+
}
|
|
1277
|
+
onBlur() {
|
|
1278
|
+
this.onTouched();
|
|
1279
|
+
}
|
|
1280
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: RadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1281
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: RadioGroupComponent, isStandalone: true, selector: "c2g-radio-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, providers: [
|
|
1282
|
+
{
|
|
1283
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1284
|
+
useExisting: forwardRef(() => RadioGroupComponent),
|
|
1285
|
+
multi: true,
|
|
1286
|
+
},
|
|
1287
|
+
], ngImport: i0, template: `
|
|
1288
|
+
<fieldset class="c2g-radio-group" [disabled]="isDisabled()">
|
|
1289
|
+
@if (label().trim()) {
|
|
1290
|
+
<legend class="c2g-radio-group__legend">{{ label() }}</legend>
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
<div class="c2g-radio-group__options" [class.c2g-radio-group__options--vertical]="orientation() === 'vertical'">
|
|
1294
|
+
@for (option of options(); track option.value) {
|
|
1295
|
+
<label class="c2g-radio-group__option" [class.c2g-radio-group__option--disabled]="isOptionDisabled(option)">
|
|
1296
|
+
<input
|
|
1297
|
+
type="radio"
|
|
1298
|
+
class="c2g-radio-group__input"
|
|
1299
|
+
[name]="groupName()"
|
|
1300
|
+
[value]="option.value"
|
|
1301
|
+
[checked]="value() === option.value"
|
|
1302
|
+
[disabled]="isDisabled() || !!option.disabled"
|
|
1303
|
+
(change)="selectOption(option.value)"
|
|
1304
|
+
(blur)="onBlur()"
|
|
1305
|
+
/>
|
|
1306
|
+
<span class="c2g-radio-group__dot" aria-hidden="true"></span>
|
|
1307
|
+
<span class="c2g-radio-group__text">{{ option.label }}</span>
|
|
1308
|
+
</label>
|
|
1309
|
+
}
|
|
1310
|
+
</div>
|
|
1311
|
+
|
|
1312
|
+
@if (hint().trim()) {
|
|
1313
|
+
<p class="c2g-radio-group__hint">{{ hint() }}</p>
|
|
1314
|
+
}
|
|
1315
|
+
</fieldset>
|
|
1316
|
+
`, isInline: true, styles: [".c2g-radio-group{border:0;margin:0;padding:0;min-width:0;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-radio-group__legend{padding:0;margin-bottom:var(--c2g-space-2, .5rem);font-size:var(--c2g-font-size-sm, .875rem);font-weight:var(--c2g-font-weight-semibold, 600);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-radio-group__options{display:flex;gap:var(--c2g-space-3, .75rem);flex-wrap:wrap}.c2g-radio-group__options--vertical{flex-direction:column;align-items:flex-start}.c2g-radio-group__option{display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);cursor:pointer;color:var(--c2g-color-text-primary, #1a1714);-webkit-user-select:none;user-select:none}.c2g-radio-group__option--disabled{cursor:not-allowed;opacity:.55}.c2g-radio-group__input{position:absolute;opacity:0;pointer-events:none}.c2g-radio-group__dot{width:1.125rem;height:1.125rem;border-radius:999px;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));display:inline-grid;place-items:center;background:var(--c2g-color-surface, #ffffff);transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease);position:relative}.c2g-radio-group__dot:after{content:\"\";width:.5rem;height:.5rem;border-radius:999px;background:var(--c2g-color-primary, #ff6b35);transform:scale(0);transition:transform var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-radio-group__input:checked+.c2g-radio-group__dot{border-color:var(--c2g-color-primary-dark, #e55623)}.c2g-radio-group__input:checked+.c2g-radio-group__dot:after{transform:scale(1)}.c2g-radio-group__input:focus-visible+.c2g-radio-group__dot{box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-radio-group__text{font-size:var(--c2g-font-size-sm, .875rem)}.c2g-radio-group__hint{margin:var(--c2g-space-2, .5rem) 0 0;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1317
|
+
}
|
|
1318
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: RadioGroupComponent, decorators: [{
|
|
1319
|
+
type: Component,
|
|
1320
|
+
args: [{ selector: 'c2g-radio-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1321
|
+
{
|
|
1322
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1323
|
+
useExisting: forwardRef(() => RadioGroupComponent),
|
|
1324
|
+
multi: true,
|
|
1325
|
+
},
|
|
1326
|
+
], template: `
|
|
1327
|
+
<fieldset class="c2g-radio-group" [disabled]="isDisabled()">
|
|
1328
|
+
@if (label().trim()) {
|
|
1329
|
+
<legend class="c2g-radio-group__legend">{{ label() }}</legend>
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
<div class="c2g-radio-group__options" [class.c2g-radio-group__options--vertical]="orientation() === 'vertical'">
|
|
1333
|
+
@for (option of options(); track option.value) {
|
|
1334
|
+
<label class="c2g-radio-group__option" [class.c2g-radio-group__option--disabled]="isOptionDisabled(option)">
|
|
1335
|
+
<input
|
|
1336
|
+
type="radio"
|
|
1337
|
+
class="c2g-radio-group__input"
|
|
1338
|
+
[name]="groupName()"
|
|
1339
|
+
[value]="option.value"
|
|
1340
|
+
[checked]="value() === option.value"
|
|
1341
|
+
[disabled]="isDisabled() || !!option.disabled"
|
|
1342
|
+
(change)="selectOption(option.value)"
|
|
1343
|
+
(blur)="onBlur()"
|
|
1344
|
+
/>
|
|
1345
|
+
<span class="c2g-radio-group__dot" aria-hidden="true"></span>
|
|
1346
|
+
<span class="c2g-radio-group__text">{{ option.label }}</span>
|
|
1347
|
+
</label>
|
|
1348
|
+
}
|
|
1349
|
+
</div>
|
|
1350
|
+
|
|
1351
|
+
@if (hint().trim()) {
|
|
1352
|
+
<p class="c2g-radio-group__hint">{{ hint() }}</p>
|
|
1353
|
+
}
|
|
1354
|
+
</fieldset>
|
|
1355
|
+
`, styles: [".c2g-radio-group{border:0;margin:0;padding:0;min-width:0;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-radio-group__legend{padding:0;margin-bottom:var(--c2g-space-2, .5rem);font-size:var(--c2g-font-size-sm, .875rem);font-weight:var(--c2g-font-weight-semibold, 600);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-radio-group__options{display:flex;gap:var(--c2g-space-3, .75rem);flex-wrap:wrap}.c2g-radio-group__options--vertical{flex-direction:column;align-items:flex-start}.c2g-radio-group__option{display:inline-flex;align-items:center;gap:var(--c2g-space-2, .5rem);cursor:pointer;color:var(--c2g-color-text-primary, #1a1714);-webkit-user-select:none;user-select:none}.c2g-radio-group__option--disabled{cursor:not-allowed;opacity:.55}.c2g-radio-group__input{position:absolute;opacity:0;pointer-events:none}.c2g-radio-group__dot{width:1.125rem;height:1.125rem;border-radius:999px;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));display:inline-grid;place-items:center;background:var(--c2g-color-surface, #ffffff);transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease);position:relative}.c2g-radio-group__dot:after{content:\"\";width:.5rem;height:.5rem;border-radius:999px;background:var(--c2g-color-primary, #ff6b35);transform:scale(0);transition:transform var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-radio-group__input:checked+.c2g-radio-group__dot{border-color:var(--c2g-color-primary-dark, #e55623)}.c2g-radio-group__input:checked+.c2g-radio-group__dot:after{transform:scale(1)}.c2g-radio-group__input:focus-visible+.c2g-radio-group__dot{box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-radio-group__text{font-size:var(--c2g-font-size-sm, .875rem)}.c2g-radio-group__hint{margin:var(--c2g-space-2, .5rem) 0 0;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem)}\n"] }]
|
|
1356
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
1357
|
+
|
|
1358
|
+
let nextSelectId = 0;
|
|
1359
|
+
class SelectComponent {
|
|
1360
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1361
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1362
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1363
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1364
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1365
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1366
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
1367
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1368
|
+
valueChanged = output();
|
|
1369
|
+
value = signal(null, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1370
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
1371
|
+
generatedId = `c2g-select-${++nextSelectId}`;
|
|
1372
|
+
selectId = computed(() => this.id().trim() || this.generatedId, ...(ngDevMode ? [{ debugName: "selectId" }] : []));
|
|
1373
|
+
hintId = computed(() => `${this.selectId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : []));
|
|
1374
|
+
errorId = computed(() => `${this.selectId()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : []));
|
|
1375
|
+
describedBy = computed(() => {
|
|
1376
|
+
const ids = [];
|
|
1377
|
+
if (this.error().trim()) {
|
|
1378
|
+
ids.push(this.errorId());
|
|
1379
|
+
}
|
|
1380
|
+
else if (this.hint().trim()) {
|
|
1381
|
+
ids.push(this.hintId());
|
|
1382
|
+
}
|
|
1383
|
+
return ids.length > 0 ? ids.join(' ') : null;
|
|
1384
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1385
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1386
|
+
onChange = () => { };
|
|
1387
|
+
onTouched = () => { };
|
|
1388
|
+
writeValue(value) {
|
|
1389
|
+
this.value.set(value ?? null);
|
|
1390
|
+
}
|
|
1391
|
+
registerOnChange(fn) {
|
|
1392
|
+
this.onChange = fn;
|
|
1393
|
+
}
|
|
1394
|
+
registerOnTouched(fn) {
|
|
1395
|
+
this.onTouched = fn;
|
|
1396
|
+
}
|
|
1397
|
+
setDisabledState(isDisabled) {
|
|
1398
|
+
this.cvaDisabled.set(isDisabled);
|
|
1399
|
+
}
|
|
1400
|
+
onSelect(event) {
|
|
1401
|
+
const nextValue = event.target.value;
|
|
1402
|
+
const typedValue = nextValue ? nextValue : null;
|
|
1403
|
+
this.value.set(typedValue);
|
|
1404
|
+
this.onChange(typedValue);
|
|
1405
|
+
this.valueChanged.emit(typedValue);
|
|
1406
|
+
}
|
|
1407
|
+
onBlur() {
|
|
1408
|
+
this.onTouched();
|
|
1409
|
+
}
|
|
1410
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1411
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: SelectComponent, isStandalone: true, selector: "c2g-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, providers: [
|
|
1412
|
+
{
|
|
1413
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1414
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1415
|
+
multi: true,
|
|
1416
|
+
},
|
|
1417
|
+
], ngImport: i0, template: `
|
|
1418
|
+
<div class="c2g-field">
|
|
1419
|
+
@if (label().trim()) {
|
|
1420
|
+
<label class="c2g-field__label" [attr.for]="selectId()">
|
|
1421
|
+
{{ label() }}
|
|
1422
|
+
@if (required()) {
|
|
1423
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1424
|
+
}
|
|
1425
|
+
</label>
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1429
|
+
<select
|
|
1430
|
+
class="c2g-field__control c2g-select__input"
|
|
1431
|
+
[id]="selectId()"
|
|
1432
|
+
[value]="value() || ''"
|
|
1433
|
+
[disabled]="isDisabled()"
|
|
1434
|
+
[required]="required()"
|
|
1435
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1436
|
+
[attr.aria-describedby]="describedBy()"
|
|
1437
|
+
(change)="onSelect($event)"
|
|
1438
|
+
(blur)="onBlur()"
|
|
1439
|
+
>
|
|
1440
|
+
@if (placeholder().trim()) {
|
|
1441
|
+
<option value="">{{ placeholder() }}</option>
|
|
1442
|
+
}
|
|
1443
|
+
@for (option of options(); track option.value) {
|
|
1444
|
+
<option [value]="option.value" [disabled]="option.disabled">
|
|
1445
|
+
{{ option.label }}
|
|
1446
|
+
</option>
|
|
1447
|
+
}
|
|
1448
|
+
</select>
|
|
1449
|
+
</div>
|
|
1450
|
+
|
|
1451
|
+
<div class="c2g-field__meta">
|
|
1452
|
+
@if (error().trim()) {
|
|
1453
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1454
|
+
} @else if (hint().trim()) {
|
|
1455
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1456
|
+
}
|
|
1457
|
+
</div>
|
|
1458
|
+
</div>
|
|
1459
|
+
`, isInline: true, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{min-height:2.75rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:center;gap:var(--c2g-space-2, .5rem);padding:0 var(--c2g-space-3, .75rem);transition:border-color .12s ease,box-shadow .12s ease}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;padding:0;font-family:inherit}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-select__input{appearance:none;background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>');background-repeat:no-repeat;background-position:right var(--c2g-space-3, .75rem) center;background-size:1.25rem;padding-right:calc(1.25rem + var(--c2g-space-4, 1rem))}.c2g-select__input:disabled{background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"rgba(107,94,82,0.5)\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>')}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1460
|
+
}
|
|
1461
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SelectComponent, decorators: [{
|
|
1462
|
+
type: Component,
|
|
1463
|
+
args: [{ selector: 'c2g-select', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1464
|
+
{
|
|
1465
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1466
|
+
useExisting: forwardRef(() => SelectComponent),
|
|
1467
|
+
multi: true,
|
|
1468
|
+
},
|
|
1469
|
+
], template: `
|
|
1470
|
+
<div class="c2g-field">
|
|
1471
|
+
@if (label().trim()) {
|
|
1472
|
+
<label class="c2g-field__label" [attr.for]="selectId()">
|
|
1473
|
+
{{ label() }}
|
|
1474
|
+
@if (required()) {
|
|
1475
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1476
|
+
}
|
|
1477
|
+
</label>
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1481
|
+
<select
|
|
1482
|
+
class="c2g-field__control c2g-select__input"
|
|
1483
|
+
[id]="selectId()"
|
|
1484
|
+
[value]="value() || ''"
|
|
1485
|
+
[disabled]="isDisabled()"
|
|
1486
|
+
[required]="required()"
|
|
1487
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1488
|
+
[attr.aria-describedby]="describedBy()"
|
|
1489
|
+
(change)="onSelect($event)"
|
|
1490
|
+
(blur)="onBlur()"
|
|
1491
|
+
>
|
|
1492
|
+
@if (placeholder().trim()) {
|
|
1493
|
+
<option value="">{{ placeholder() }}</option>
|
|
1494
|
+
}
|
|
1495
|
+
@for (option of options(); track option.value) {
|
|
1496
|
+
<option [value]="option.value" [disabled]="option.disabled">
|
|
1497
|
+
{{ option.label }}
|
|
1498
|
+
</option>
|
|
1499
|
+
}
|
|
1500
|
+
</select>
|
|
1501
|
+
</div>
|
|
1502
|
+
|
|
1503
|
+
<div class="c2g-field__meta">
|
|
1504
|
+
@if (error().trim()) {
|
|
1505
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1506
|
+
} @else if (hint().trim()) {
|
|
1507
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1508
|
+
}
|
|
1509
|
+
</div>
|
|
1510
|
+
</div>
|
|
1511
|
+
`, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{min-height:2.75rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:center;gap:var(--c2g-space-2, .5rem);padding:0 var(--c2g-space-3, .75rem);transition:border-color .12s ease,box-shadow .12s ease}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;padding:0;font-family:inherit}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-select__input{appearance:none;background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>');background-repeat:no-repeat;background-position:right var(--c2g-space-3, .75rem) center;background-size:1.25rem;padding-right:calc(1.25rem + var(--c2g-space-4, 1rem))}.c2g-select__input:disabled{background-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"rgba(107,94,82,0.5)\" stroke-width=\"2\"><polyline points=\"6 9 12 15 18 9\"></polyline></svg>')}\n"] }]
|
|
1512
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
1513
|
+
|
|
1514
|
+
let nextSwitchId = 0;
|
|
1515
|
+
class SwitchComponent {
|
|
1516
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1517
|
+
label = input('Toggle', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1518
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1519
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1520
|
+
checkedChange = output();
|
|
1521
|
+
checked = signal(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
1522
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
1523
|
+
generatedId = `c2g-switch-${++nextSwitchId}`;
|
|
1524
|
+
switchId = computed(() => this.id().trim() || this.generatedId, ...(ngDevMode ? [{ debugName: "switchId" }] : []));
|
|
1525
|
+
hintId = computed(() => `${this.switchId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : []));
|
|
1526
|
+
describedBy = computed(() => (this.hint().trim() ? this.hintId() : null), ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1527
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1528
|
+
onChange = () => { };
|
|
1529
|
+
onTouched = () => { };
|
|
1530
|
+
writeValue(value) {
|
|
1531
|
+
this.checked.set(!!value);
|
|
1532
|
+
}
|
|
1533
|
+
registerOnChange(fn) {
|
|
1534
|
+
this.onChange = fn;
|
|
1535
|
+
}
|
|
1536
|
+
registerOnTouched(fn) {
|
|
1537
|
+
this.onTouched = fn;
|
|
1538
|
+
}
|
|
1539
|
+
setDisabledState(isDisabled) {
|
|
1540
|
+
this.cvaDisabled.set(isDisabled);
|
|
1541
|
+
}
|
|
1542
|
+
toggle() {
|
|
1543
|
+
if (this.isDisabled()) {
|
|
1544
|
+
return;
|
|
1545
|
+
}
|
|
1546
|
+
const next = !this.checked();
|
|
1547
|
+
this.checked.set(next);
|
|
1548
|
+
this.onChange(next);
|
|
1549
|
+
this.checkedChange.emit(next);
|
|
1550
|
+
this.onTouched();
|
|
1551
|
+
}
|
|
1552
|
+
markTouched() {
|
|
1553
|
+
this.onTouched();
|
|
1554
|
+
}
|
|
1555
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SwitchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1556
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: SwitchComponent, isStandalone: true, selector: "c2g-switch", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
1557
|
+
{
|
|
1558
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1559
|
+
useExisting: forwardRef(() => SwitchComponent),
|
|
1560
|
+
multi: true,
|
|
1561
|
+
},
|
|
1562
|
+
], ngImport: i0, template: `
|
|
1563
|
+
<div class="c2g-switch">
|
|
1564
|
+
<button
|
|
1565
|
+
type="button"
|
|
1566
|
+
class="c2g-switch__control"
|
|
1567
|
+
role="switch"
|
|
1568
|
+
[id]="switchId()"
|
|
1569
|
+
[disabled]="isDisabled()"
|
|
1570
|
+
[attr.aria-checked]="checked() ? 'true' : 'false'"
|
|
1571
|
+
[attr.aria-describedby]="describedBy()"
|
|
1572
|
+
[class.c2g-switch__control--checked]="checked()"
|
|
1573
|
+
(click)="toggle()"
|
|
1574
|
+
(blur)="markTouched()"
|
|
1575
|
+
>
|
|
1576
|
+
<span class="c2g-switch__thumb"></span>
|
|
1577
|
+
</button>
|
|
1578
|
+
|
|
1579
|
+
<label class="c2g-switch__label" [attr.for]="switchId()">{{ label() }}</label>
|
|
1580
|
+
</div>
|
|
1581
|
+
|
|
1582
|
+
@if (hint().trim()) {
|
|
1583
|
+
<p class="c2g-switch__hint" [id]="hintId()">{{ hint() }}</p>
|
|
1584
|
+
}
|
|
1585
|
+
`, isInline: true, styles: [".c2g-switch{display:inline-flex;align-items:center;gap:var(--c2g-space-3, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-switch__control{width:2.75rem;height:1.625rem;padding:.125rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:999px;background:var(--c2g-color-neutral-200, #e1d9ce);display:inline-flex;align-items:center;justify-content:flex-start;cursor:pointer;transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-switch__control--checked{background:var(--c2g-color-primary, #ff6b35);border-color:var(--c2g-color-primary-dark, #e55623);justify-content:flex-end}.c2g-switch__control:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-switch__control:disabled{cursor:not-allowed;opacity:.55}.c2g-switch__thumb{width:1.125rem;height:1.125rem;border-radius:999px;background:var(--c2g-color-surface, #ffffff);box-shadow:var(--c2g-shadow-sm, 0 0 3px rgba(31, 28, 25, .06))}.c2g-switch__label{color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-sm, .875rem);-webkit-user-select:none;user-select:none}.c2g-switch__hint{margin:var(--c2g-space-1, .25rem) 0 0;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1586
|
+
}
|
|
1587
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
1588
|
+
type: Component,
|
|
1589
|
+
args: [{ selector: 'c2g-switch', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1590
|
+
{
|
|
1591
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1592
|
+
useExisting: forwardRef(() => SwitchComponent),
|
|
1593
|
+
multi: true,
|
|
1594
|
+
},
|
|
1595
|
+
], template: `
|
|
1596
|
+
<div class="c2g-switch">
|
|
1597
|
+
<button
|
|
1598
|
+
type="button"
|
|
1599
|
+
class="c2g-switch__control"
|
|
1600
|
+
role="switch"
|
|
1601
|
+
[id]="switchId()"
|
|
1602
|
+
[disabled]="isDisabled()"
|
|
1603
|
+
[attr.aria-checked]="checked() ? 'true' : 'false'"
|
|
1604
|
+
[attr.aria-describedby]="describedBy()"
|
|
1605
|
+
[class.c2g-switch__control--checked]="checked()"
|
|
1606
|
+
(click)="toggle()"
|
|
1607
|
+
(blur)="markTouched()"
|
|
1608
|
+
>
|
|
1609
|
+
<span class="c2g-switch__thumb"></span>
|
|
1610
|
+
</button>
|
|
1611
|
+
|
|
1612
|
+
<label class="c2g-switch__label" [attr.for]="switchId()">{{ label() }}</label>
|
|
1613
|
+
</div>
|
|
1614
|
+
|
|
1615
|
+
@if (hint().trim()) {
|
|
1616
|
+
<p class="c2g-switch__hint" [id]="hintId()">{{ hint() }}</p>
|
|
1617
|
+
}
|
|
1618
|
+
`, styles: [".c2g-switch{display:inline-flex;align-items:center;gap:var(--c2g-space-3, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-switch__control{width:2.75rem;height:1.625rem;padding:.125rem;border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:999px;background:var(--c2g-color-neutral-200, #e1d9ce);display:inline-flex;align-items:center;justify-content:flex-start;cursor:pointer;transition:all var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-switch__control--checked{background:var(--c2g-color-primary, #ff6b35);border-color:var(--c2g-color-primary-dark, #e55623);justify-content:flex-end}.c2g-switch__control:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 24%,transparent)}.c2g-switch__control:disabled{cursor:not-allowed;opacity:.55}.c2g-switch__thumb{width:1.125rem;height:1.125rem;border-radius:999px;background:var(--c2g-color-surface, #ffffff);box-shadow:var(--c2g-shadow-sm, 0 0 3px rgba(31, 28, 25, .06))}.c2g-switch__label{color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-sm, .875rem);-webkit-user-select:none;user-select:none}.c2g-switch__hint{margin:var(--c2g-space-1, .25rem) 0 0;color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-xs, .75rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}\n"] }]
|
|
1619
|
+
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], checkedChange: [{ type: i0.Output, args: ["checkedChange"] }] } });
|
|
1620
|
+
|
|
1621
|
+
class TagComponent {
|
|
1622
|
+
label = input('Tag', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1623
|
+
tone = input('neutral', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
1624
|
+
variant = input('subtle', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
1625
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1626
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
1627
|
+
icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
1628
|
+
iconAriaLabel = input('', ...(ngDevMode ? [{ debugName: "iconAriaLabel" }] : []));
|
|
1629
|
+
iconFontSet = input('', ...(ngDevMode ? [{ debugName: "iconFontSet" }] : []));
|
|
1630
|
+
iconFontIcon = input('', ...(ngDevMode ? [{ debugName: "iconFontIcon" }] : []));
|
|
1631
|
+
classes = computed(() => `c2g-tag c2g-tag--${this.size()} c2g-tag--${this.variant()} c2g-tag--${this.tone()}`, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
1632
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1633
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: TagComponent, isStandalone: true, selector: "c2g-tag", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconAriaLabel: { classPropertyName: "iconAriaLabel", publicName: "iconAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, iconFontSet: { classPropertyName: "iconFontSet", publicName: "iconFontSet", isSignal: true, isRequired: false, transformFunction: null }, iconFontIcon: { classPropertyName: "iconFontIcon", publicName: "iconFontIcon", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1634
|
+
<span class="c2g-tag" [class]="classes()" [attr.aria-label]="ariaLabel() || null">
|
|
1635
|
+
@if (icon() || iconFontIcon()) {
|
|
1636
|
+
<mat-icon
|
|
1637
|
+
class="c2g-tag__icon"
|
|
1638
|
+
[fontSet]="iconFontSet()"
|
|
1639
|
+
[fontIcon]="iconFontIcon()"
|
|
1640
|
+
[attr.aria-label]="iconAriaLabel() || null"
|
|
1641
|
+
[attr.aria-hidden]="iconAriaLabel() ? null : 'true'"
|
|
1642
|
+
>
|
|
1643
|
+
{{ icon() }}
|
|
1644
|
+
</mat-icon>
|
|
1645
|
+
}
|
|
1646
|
+
<span>{{ label() }}</span>
|
|
1647
|
+
</span>
|
|
1648
|
+
`, isInline: true, styles: [".c2g-tag{display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem);border-radius:999px;border:1px solid transparent;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);font-weight:var(--c2g-font-weight-medium, 500);line-height:1;white-space:nowrap}.c2g-tag--sm{padding:.2rem .45rem;font-size:.6875rem}.c2g-tag--md{padding:.3rem .6rem;font-size:var(--c2g-font-size-xs, .75rem)}.c2g-tag__icon{width:.875rem;height:.875rem;font-size:.8125rem;line-height:1}.c2g-tag--subtle.c2g-tag--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-tag--subtle.c2g-tag--accent,.c2g-tag--subtle.c2g-tag--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1}.c2g-tag--subtle.c2g-tag--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20}.c2g-tag--subtle.c2g-tag--warning{background:color-mix(in srgb,#ef6c00 14%,#ffffff);color:#e65100}.c2g-tag--subtle.c2g-tag--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c}.c2g-tag--solid.c2g-tag--neutral{background:var(--c2g-color-text-secondary, #4a423b);color:#fff}.c2g-tag--solid.c2g-tag--accent,.c2g-tag--solid.c2g-tag--info{background:#1565c0;color:#fff}.c2g-tag--solid.c2g-tag--success{background:#2e7d32;color:#fff}.c2g-tag--solid.c2g-tag--warning{background:#ef6c00;color:#fff}.c2g-tag--solid.c2g-tag--danger{background:#c62828;color:#fff}.c2g-tag--outline.c2g-tag--neutral{border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 35%,transparent);color:var(--c2g-color-text-secondary, #4a423b);background:transparent}.c2g-tag--outline.c2g-tag--accent,.c2g-tag--outline.c2g-tag--info{border-color:color-mix(in srgb,#1565c0 38%,transparent);color:#0d47a1;background:transparent}.c2g-tag--outline.c2g-tag--success{border-color:color-mix(in srgb,#2e7d32 38%,transparent);color:#1b5e20;background:transparent}.c2g-tag--outline.c2g-tag--warning{border-color:color-mix(in srgb,#ef6c00 38%,transparent);color:#e65100;background:transparent}.c2g-tag--outline.c2g-tag--danger{border-color:color-mix(in srgb,#c62828 38%,transparent);color:#b71c1c;background:transparent}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1649
|
+
}
|
|
1650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TagComponent, decorators: [{
|
|
1651
|
+
type: Component,
|
|
1652
|
+
args: [{ selector: 'c2g-tag', standalone: true, imports: [MatIconModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1653
|
+
<span class="c2g-tag" [class]="classes()" [attr.aria-label]="ariaLabel() || null">
|
|
1654
|
+
@if (icon() || iconFontIcon()) {
|
|
1655
|
+
<mat-icon
|
|
1656
|
+
class="c2g-tag__icon"
|
|
1657
|
+
[fontSet]="iconFontSet()"
|
|
1658
|
+
[fontIcon]="iconFontIcon()"
|
|
1659
|
+
[attr.aria-label]="iconAriaLabel() || null"
|
|
1660
|
+
[attr.aria-hidden]="iconAriaLabel() ? null : 'true'"
|
|
1661
|
+
>
|
|
1662
|
+
{{ icon() }}
|
|
1663
|
+
</mat-icon>
|
|
1664
|
+
}
|
|
1665
|
+
<span>{{ label() }}</span>
|
|
1666
|
+
</span>
|
|
1667
|
+
`, styles: [".c2g-tag{display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem);border-radius:999px;border:1px solid transparent;font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif);font-weight:var(--c2g-font-weight-medium, 500);line-height:1;white-space:nowrap}.c2g-tag--sm{padding:.2rem .45rem;font-size:.6875rem}.c2g-tag--md{padding:.3rem .6rem;font-size:var(--c2g-font-size-xs, .75rem)}.c2g-tag__icon{width:.875rem;height:.875rem;font-size:.8125rem;line-height:1}.c2g-tag--subtle.c2g-tag--neutral{background:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 10%,#ffffff);color:var(--c2g-color-text-secondary, #4a423b)}.c2g-tag--subtle.c2g-tag--accent,.c2g-tag--subtle.c2g-tag--info{background:color-mix(in srgb,#1565c0 12%,#ffffff);color:#0d47a1}.c2g-tag--subtle.c2g-tag--success{background:color-mix(in srgb,#2e7d32 12%,#ffffff);color:#1b5e20}.c2g-tag--subtle.c2g-tag--warning{background:color-mix(in srgb,#ef6c00 14%,#ffffff);color:#e65100}.c2g-tag--subtle.c2g-tag--danger{background:color-mix(in srgb,#c62828 13%,#ffffff);color:#b71c1c}.c2g-tag--solid.c2g-tag--neutral{background:var(--c2g-color-text-secondary, #4a423b);color:#fff}.c2g-tag--solid.c2g-tag--accent,.c2g-tag--solid.c2g-tag--info{background:#1565c0;color:#fff}.c2g-tag--solid.c2g-tag--success{background:#2e7d32;color:#fff}.c2g-tag--solid.c2g-tag--warning{background:#ef6c00;color:#fff}.c2g-tag--solid.c2g-tag--danger{background:#c62828;color:#fff}.c2g-tag--outline.c2g-tag--neutral{border-color:color-mix(in srgb,var(--c2g-color-text-secondary, #4a423b) 35%,transparent);color:var(--c2g-color-text-secondary, #4a423b);background:transparent}.c2g-tag--outline.c2g-tag--accent,.c2g-tag--outline.c2g-tag--info{border-color:color-mix(in srgb,#1565c0 38%,transparent);color:#0d47a1;background:transparent}.c2g-tag--outline.c2g-tag--success{border-color:color-mix(in srgb,#2e7d32 38%,transparent);color:#1b5e20;background:transparent}.c2g-tag--outline.c2g-tag--warning{border-color:color-mix(in srgb,#ef6c00 38%,transparent);color:#e65100;background:transparent}.c2g-tag--outline.c2g-tag--danger{border-color:color-mix(in srgb,#c62828 38%,transparent);color:#b71c1c;background:transparent}\n"] }]
|
|
1668
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAriaLabel", required: false }] }], iconFontSet: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconFontSet", required: false }] }], iconFontIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconFontIcon", required: false }] }] } });
|
|
1669
|
+
|
|
1670
|
+
let nextTextareaId = 0;
|
|
1671
|
+
class TextareaComponent {
|
|
1672
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
1673
|
+
hint = input('', ...(ngDevMode ? [{ debugName: "hint" }] : []));
|
|
1674
|
+
error = input('', ...(ngDevMode ? [{ debugName: "error" }] : []));
|
|
1675
|
+
placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1676
|
+
prefix = input('', ...(ngDevMode ? [{ debugName: "prefix" }] : []));
|
|
1677
|
+
suffix = input('', ...(ngDevMode ? [{ debugName: "suffix" }] : []));
|
|
1678
|
+
loading = input(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
1679
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
1680
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : []));
|
|
1681
|
+
maxLength = input(null, ...(ngDevMode ? [{ debugName: "maxLength" }] : []));
|
|
1682
|
+
rows = input(4, ...(ngDevMode ? [{ debugName: "rows" }] : []));
|
|
1683
|
+
id = input('', ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1684
|
+
valueChanged = output();
|
|
1685
|
+
value = signal('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1686
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : []));
|
|
1687
|
+
generatedId = `c2g-textarea-${++nextTextareaId}`;
|
|
1688
|
+
textareaId = computed(() => this.id().trim() || this.generatedId, ...(ngDevMode ? [{ debugName: "textareaId" }] : []));
|
|
1689
|
+
hintId = computed(() => `${this.textareaId()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : []));
|
|
1690
|
+
errorId = computed(() => `${this.textareaId()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : []));
|
|
1691
|
+
counterId = computed(() => `${this.textareaId()}-counter`, ...(ngDevMode ? [{ debugName: "counterId" }] : []));
|
|
1692
|
+
describedBy = computed(() => {
|
|
1693
|
+
const ids = [];
|
|
1694
|
+
if (this.error().trim()) {
|
|
1695
|
+
ids.push(this.errorId());
|
|
1696
|
+
}
|
|
1697
|
+
else if (this.hint().trim()) {
|
|
1698
|
+
ids.push(this.hintId());
|
|
1699
|
+
}
|
|
1700
|
+
if (this.showCounter()) {
|
|
1701
|
+
ids.push(this.counterId());
|
|
1702
|
+
}
|
|
1703
|
+
return ids.length > 0 ? ids.join(' ') : null;
|
|
1704
|
+
}, ...(ngDevMode ? [{ debugName: "describedBy" }] : []));
|
|
1705
|
+
valueLength = computed(() => this.value().length, ...(ngDevMode ? [{ debugName: "valueLength" }] : []));
|
|
1706
|
+
showCounter = computed(() => (this.maxLength() ?? 0) > 0, ...(ngDevMode ? [{ debugName: "showCounter" }] : []));
|
|
1707
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : []));
|
|
1708
|
+
onChange = () => { };
|
|
1709
|
+
onTouched = () => { };
|
|
1710
|
+
writeValue(value) {
|
|
1711
|
+
this.value.set(value ?? '');
|
|
1712
|
+
}
|
|
1713
|
+
registerOnChange(fn) {
|
|
1714
|
+
this.onChange = fn;
|
|
1715
|
+
}
|
|
1716
|
+
registerOnTouched(fn) {
|
|
1717
|
+
this.onTouched = fn;
|
|
1718
|
+
}
|
|
1719
|
+
setDisabledState(isDisabled) {
|
|
1720
|
+
this.cvaDisabled.set(isDisabled);
|
|
1721
|
+
}
|
|
1722
|
+
onInput(event) {
|
|
1723
|
+
const nextValue = event.target.value;
|
|
1724
|
+
this.value.set(nextValue);
|
|
1725
|
+
this.onChange(nextValue);
|
|
1726
|
+
this.valueChanged.emit(nextValue);
|
|
1727
|
+
}
|
|
1728
|
+
onBlur() {
|
|
1729
|
+
this.onTouched();
|
|
1730
|
+
}
|
|
1731
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1732
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: TextareaComponent, isStandalone: true, selector: "c2g-textarea", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, prefix: { classPropertyName: "prefix", publicName: "prefix", isSignal: true, isRequired: false, transformFunction: null }, suffix: { classPropertyName: "suffix", publicName: "suffix", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChanged: "valueChanged" }, providers: [
|
|
1733
|
+
{
|
|
1734
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1735
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1736
|
+
multi: true,
|
|
1737
|
+
},
|
|
1738
|
+
], ngImport: i0, template: `
|
|
1739
|
+
<div class="c2g-field">
|
|
1740
|
+
@if (label().trim()) {
|
|
1741
|
+
<label class="c2g-field__label" [attr.for]="textareaId()">
|
|
1742
|
+
{{ label() }}
|
|
1743
|
+
@if (required()) {
|
|
1744
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1745
|
+
}
|
|
1746
|
+
</label>
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1750
|
+
@if (prefix().trim()) {
|
|
1751
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ prefix() }}</span>
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
<textarea
|
|
1755
|
+
class="c2g-field__control"
|
|
1756
|
+
[id]="textareaId()"
|
|
1757
|
+
[value]="value()"
|
|
1758
|
+
[placeholder]="placeholder()"
|
|
1759
|
+
[disabled]="isDisabled()"
|
|
1760
|
+
[required]="required()"
|
|
1761
|
+
[attr.maxlength]="maxLength() || null"
|
|
1762
|
+
[rows]="rows()"
|
|
1763
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1764
|
+
[attr.aria-describedby]="describedBy()"
|
|
1765
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
1766
|
+
(input)="onInput($event)"
|
|
1767
|
+
(blur)="onBlur()"
|
|
1768
|
+
></textarea>
|
|
1769
|
+
|
|
1770
|
+
@if (loading()) {
|
|
1771
|
+
<span class="c2g-field__spinner" aria-hidden="true"></span>
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
@if (suffix().trim()) {
|
|
1775
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ suffix() }}</span>
|
|
1776
|
+
}
|
|
1777
|
+
</div>
|
|
1778
|
+
|
|
1779
|
+
<div class="c2g-field__meta">
|
|
1780
|
+
@if (error().trim()) {
|
|
1781
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1782
|
+
} @else if (hint().trim()) {
|
|
1783
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
@if (showCounter()) {
|
|
1787
|
+
<span class="c2g-field__counter" [id]="counterId()">{{ valueLength() }} / {{ maxLength() }}</span>
|
|
1788
|
+
}
|
|
1789
|
+
</div>
|
|
1790
|
+
</div>
|
|
1791
|
+
`, isInline: true, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:flex-start;gap:var(--c2g-space-2, .5rem);padding:var(--c2g-space-2, .5rem) var(--c2g-space-3, .75rem);transition:border-color var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;resize:vertical;min-height:5.5rem;padding:0;margin:0;font-family:inherit}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__affix{color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-sm, .875rem);line-height:1.5;white-space:nowrap;margin-top:var(--c2g-space-1, .25rem)}.c2g-field__spinner{width:1rem;height:1rem;border:2px solid var(--c2g-color-primary, #ff6b35);border-right-color:transparent;border-radius:999px;animation:c2g-field-spin .8s linear infinite;flex:0 0 auto;margin-top:var(--c2g-space-1, .25rem)}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-field__counter{margin-left:auto;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52);font-variant-numeric:tabular-nums}@keyframes c2g-field-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1792
|
+
}
|
|
1793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
1794
|
+
type: Component,
|
|
1795
|
+
args: [{ selector: 'c2g-textarea', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1796
|
+
{
|
|
1797
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1798
|
+
useExisting: forwardRef(() => TextareaComponent),
|
|
1799
|
+
multi: true,
|
|
1800
|
+
},
|
|
1801
|
+
], template: `
|
|
1802
|
+
<div class="c2g-field">
|
|
1803
|
+
@if (label().trim()) {
|
|
1804
|
+
<label class="c2g-field__label" [attr.for]="textareaId()">
|
|
1805
|
+
{{ label() }}
|
|
1806
|
+
@if (required()) {
|
|
1807
|
+
<span class="c2g-field__required" aria-hidden="true">*</span>
|
|
1808
|
+
}
|
|
1809
|
+
</label>
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
<div class="c2g-field__control-shell" [class.c2g-field__control-shell--error]="!!error().trim()">
|
|
1813
|
+
@if (prefix().trim()) {
|
|
1814
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ prefix() }}</span>
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
<textarea
|
|
1818
|
+
class="c2g-field__control"
|
|
1819
|
+
[id]="textareaId()"
|
|
1820
|
+
[value]="value()"
|
|
1821
|
+
[placeholder]="placeholder()"
|
|
1822
|
+
[disabled]="isDisabled()"
|
|
1823
|
+
[required]="required()"
|
|
1824
|
+
[attr.maxlength]="maxLength() || null"
|
|
1825
|
+
[rows]="rows()"
|
|
1826
|
+
[attr.aria-invalid]="error().trim() ? 'true' : null"
|
|
1827
|
+
[attr.aria-describedby]="describedBy()"
|
|
1828
|
+
[attr.aria-busy]="loading() ? 'true' : null"
|
|
1829
|
+
(input)="onInput($event)"
|
|
1830
|
+
(blur)="onBlur()"
|
|
1831
|
+
></textarea>
|
|
1832
|
+
|
|
1833
|
+
@if (loading()) {
|
|
1834
|
+
<span class="c2g-field__spinner" aria-hidden="true"></span>
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
@if (suffix().trim()) {
|
|
1838
|
+
<span class="c2g-field__affix" aria-hidden="true">{{ suffix() }}</span>
|
|
1839
|
+
}
|
|
1840
|
+
</div>
|
|
1841
|
+
|
|
1842
|
+
<div class="c2g-field__meta">
|
|
1843
|
+
@if (error().trim()) {
|
|
1844
|
+
<p class="c2g-field__message c2g-field__message--error" [id]="errorId()">{{ error() }}</p>
|
|
1845
|
+
} @else if (hint().trim()) {
|
|
1846
|
+
<p class="c2g-field__message" [id]="hintId()">{{ hint() }}</p>
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
@if (showCounter()) {
|
|
1850
|
+
<span class="c2g-field__counter" [id]="counterId()">{{ valueLength() }} / {{ maxLength() }}</span>
|
|
1851
|
+
}
|
|
1852
|
+
</div>
|
|
1853
|
+
</div>
|
|
1854
|
+
`, styles: [".c2g-field{width:100%;display:grid;gap:var(--c2g-space-2, .5rem);font-family:var(--c2g-font-family-base, \"Quicksand\", \"Segoe UI\", sans-serif)}.c2g-field__label{color:var(--c2g-color-text-secondary, #4a423b);font-weight:var(--c2g-font-weight-semibold, 600);font-size:var(--c2g-font-size-sm, .875rem);display:inline-flex;align-items:center;gap:var(--c2g-space-1, .25rem)}.c2g-field__required{color:var(--c2g-color-error, #ff6b6b);line-height:1}.c2g-field__control-shell{border:1px solid var(--c2g-color-border-subtle, rgba(74, 66, 59, .18));border-radius:var(--c2g-radius-md, .625rem);background:var(--c2g-color-surface, #ffffff);display:flex;align-items:flex-start;gap:var(--c2g-space-2, .5rem);padding:var(--c2g-space-2, .5rem) var(--c2g-space-3, .75rem);transition:border-color var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease),box-shadow var(--c2g-motion-duration-fast, .12s) var(--c2g-motion-ease-standard, ease)}.c2g-field__control-shell:focus-within{border-color:var(--c2g-color-focus, #e55623);box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-color-focus, #e55623) 20%,transparent)}.c2g-field__control-shell--error{border-color:var(--c2g-color-error, #ff6b6b)}.c2g-field__control{width:100%;min-width:0;border:none;background:transparent;color:var(--c2g-color-text-primary, #1a1714);font-size:var(--c2g-font-size-md, 1rem);line-height:1.4;outline:none;resize:vertical;min-height:5.5rem;padding:0;margin:0;font-family:inherit}.c2g-field__control::placeholder{color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__control:disabled{cursor:not-allowed;opacity:.7}.c2g-field__affix{color:var(--c2g-color-text-muted, #6b5e52);font-size:var(--c2g-font-size-sm, .875rem);line-height:1.5;white-space:nowrap;margin-top:var(--c2g-space-1, .25rem)}.c2g-field__spinner{width:1rem;height:1rem;border:2px solid var(--c2g-color-primary, #ff6b35);border-right-color:transparent;border-radius:999px;animation:c2g-field-spin .8s linear infinite;flex:0 0 auto;margin-top:var(--c2g-space-1, .25rem)}.c2g-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:var(--c2g-space-2, .5rem);min-height:1.25rem}.c2g-field__message{margin:0;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52)}.c2g-field__message--error{color:var(--c2g-color-error, #ff6b6b)}.c2g-field__counter{margin-left:auto;font-size:var(--c2g-font-size-xs, .75rem);color:var(--c2g-color-text-muted, #6b5e52);font-variant-numeric:tabular-nums}@keyframes c2g-field-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n"] }]
|
|
1855
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], prefix: [{ type: i0.Input, args: [{ isSignal: true, alias: "prefix", required: false }] }], suffix: [{ type: i0.Input, args: [{ isSignal: true, alias: "suffix", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
|
|
1856
|
+
|
|
1857
|
+
class ModalComponent {
|
|
1858
|
+
document = inject(DOCUMENT);
|
|
1859
|
+
open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
1860
|
+
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1861
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
1862
|
+
closable = input(true, ...(ngDevMode ? [{ debugName: "closable" }] : []));
|
|
1863
|
+
lockBodyScroll = input(true, ...(ngDevMode ? [{ debugName: "lockBodyScroll" }] : []));
|
|
1864
|
+
ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
1865
|
+
closed = output();
|
|
1866
|
+
effectiveAriaLabel = computed(() => this.ariaLabel() || this.title() || 'Dialog', ...(ngDevMode ? [{ debugName: "effectiveAriaLabel" }] : []));
|
|
1867
|
+
sizeClass = computed(() => `c2g-modal__panel--${this.size()}`, ...(ngDevMode ? [{ debugName: "sizeClass" }] : []));
|
|
1868
|
+
constructor() {
|
|
1869
|
+
effect(() => {
|
|
1870
|
+
this.document.body.style.overflow = this.open() && this.lockBodyScroll() ? 'hidden' : '';
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
close() {
|
|
1874
|
+
if (!this.closable())
|
|
1875
|
+
return;
|
|
1876
|
+
this.closed.emit();
|
|
1877
|
+
}
|
|
1878
|
+
onBackdropClick(event) {
|
|
1879
|
+
if (event.target.classList.contains('c2g-modal__backdrop')) {
|
|
1880
|
+
this.close();
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
onKeydown(event) {
|
|
1884
|
+
if (event.key === 'Escape') {
|
|
1885
|
+
this.close();
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1889
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ModalComponent, isStandalone: true, selector: "c2g-modal", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, lockBodyScroll: { classPropertyName: "lockBodyScroll", publicName: "lockBodyScroll", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "@if (open()) {\n <div\n class=\"c2g-modal__backdrop\"\n role=\"presentation\"\n (click)=\"onBackdropClick($event)\"\n (keydown)=\"onKeydown($event)\">\n <div\n class=\"c2g-modal__panel\"\n [class]=\"sizeClass()\"\n role=\"dialog\"\n [attr.aria-label]=\"effectiveAriaLabel()\"\n [attr.aria-modal]=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture>\n\n @if (title()) {\n <div class=\"c2g-modal__header\">\n <h2 class=\"c2g-modal__title\">{{ title() }}</h2>\n @if (closable()) {\n <button\n class=\"c2g-modal__close\"\n type=\"button\"\n aria-label=\"Schlie\u00DFen\"\n (click)=\"close()\">\n \u2715\n </button>\n }\n </div>\n }\n\n <div class=\"c2g-modal__body\">\n <ng-content />\n </div>\n\n <ng-content select=\"[c2g-modal-footer]\" />\n </div>\n </div>\n}\n", styles: [".c2g-modal__backdrop{position:fixed;inset:0;background-color:var(--c2g-overlay-bg, rgba(0, 0, 0, .5));display:flex;align-items:flex-start;justify-content:center;z-index:var(--c2g-z-modal, 1000);padding:var(--c2g-spacing-4, 1rem);overflow-y:auto}.c2g-modal__panel{background-color:var(--c2g-surface-bg, #ffffff);color:var(--c2g-text-primary, #111827);border-radius:var(--c2g-radius-lg, .75rem);box-shadow:var(--c2g-shadow-xl, 0 20px 60px rgba(0, 0, 0, .3));width:100%;max-height:calc(100dvh - 2rem);display:flex;flex-direction:column;overflow:hidden;margin:auto 0}.c2g-modal__panel--sm{max-width:24rem}.c2g-modal__panel--md{max-width:36rem}.c2g-modal__panel--lg{max-width:52rem}.c2g-modal__panel--xl{max-width:72rem}.c2g-modal__header{display:flex;align-items:center;justify-content:space-between;padding:var(--c2g-spacing-4, 1rem) var(--c2g-spacing-6, 1.5rem);border-bottom:1px solid var(--c2g-border-color, #e5e7eb);flex-shrink:0}.c2g-modal__title{margin:0;font-size:var(--c2g-font-size-lg, 1.125rem);font-weight:var(--c2g-font-weight-semibold, 600);color:var(--c2g-text-primary, #111827);line-height:1.4}.c2g-modal__close{background:none;border:none;cursor:pointer;padding:var(--c2g-spacing-1, .25rem);border-radius:var(--c2g-radius-sm, .25rem);color:var(--c2g-text-secondary, #6b7280);font-size:1rem;line-height:1;display:flex;align-items:center;justify-content:center;transition:background-color .15s ease,color .15s ease;flex-shrink:0}.c2g-modal__close:hover{background-color:var(--c2g-hover-bg, #f3f4f6);color:var(--c2g-text-primary, #111827)}.c2g-modal__close:focus-visible{outline:2px solid var(--c2g-focus-ring, #3b82f6);outline-offset:2px}.c2g-modal__body{padding:var(--c2g-spacing-6, 1.5rem);overflow-y:auto;flex:1;min-height:0}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1890
|
+
}
|
|
1891
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ModalComponent, decorators: [{
|
|
1892
|
+
type: Component,
|
|
1893
|
+
args: [{ selector: 'c2g-modal', standalone: true, imports: [A11yModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (open()) {\n <div\n class=\"c2g-modal__backdrop\"\n role=\"presentation\"\n (click)=\"onBackdropClick($event)\"\n (keydown)=\"onKeydown($event)\">\n <div\n class=\"c2g-modal__panel\"\n [class]=\"sizeClass()\"\n role=\"dialog\"\n [attr.aria-label]=\"effectiveAriaLabel()\"\n [attr.aria-modal]=\"true\"\n cdkTrapFocus\n cdkTrapFocusAutoCapture>\n\n @if (title()) {\n <div class=\"c2g-modal__header\">\n <h2 class=\"c2g-modal__title\">{{ title() }}</h2>\n @if (closable()) {\n <button\n class=\"c2g-modal__close\"\n type=\"button\"\n aria-label=\"Schlie\u00DFen\"\n (click)=\"close()\">\n \u2715\n </button>\n }\n </div>\n }\n\n <div class=\"c2g-modal__body\">\n <ng-content />\n </div>\n\n <ng-content select=\"[c2g-modal-footer]\" />\n </div>\n </div>\n}\n", styles: [".c2g-modal__backdrop{position:fixed;inset:0;background-color:var(--c2g-overlay-bg, rgba(0, 0, 0, .5));display:flex;align-items:flex-start;justify-content:center;z-index:var(--c2g-z-modal, 1000);padding:var(--c2g-spacing-4, 1rem);overflow-y:auto}.c2g-modal__panel{background-color:var(--c2g-surface-bg, #ffffff);color:var(--c2g-text-primary, #111827);border-radius:var(--c2g-radius-lg, .75rem);box-shadow:var(--c2g-shadow-xl, 0 20px 60px rgba(0, 0, 0, .3));width:100%;max-height:calc(100dvh - 2rem);display:flex;flex-direction:column;overflow:hidden;margin:auto 0}.c2g-modal__panel--sm{max-width:24rem}.c2g-modal__panel--md{max-width:36rem}.c2g-modal__panel--lg{max-width:52rem}.c2g-modal__panel--xl{max-width:72rem}.c2g-modal__header{display:flex;align-items:center;justify-content:space-between;padding:var(--c2g-spacing-4, 1rem) var(--c2g-spacing-6, 1.5rem);border-bottom:1px solid var(--c2g-border-color, #e5e7eb);flex-shrink:0}.c2g-modal__title{margin:0;font-size:var(--c2g-font-size-lg, 1.125rem);font-weight:var(--c2g-font-weight-semibold, 600);color:var(--c2g-text-primary, #111827);line-height:1.4}.c2g-modal__close{background:none;border:none;cursor:pointer;padding:var(--c2g-spacing-1, .25rem);border-radius:var(--c2g-radius-sm, .25rem);color:var(--c2g-text-secondary, #6b7280);font-size:1rem;line-height:1;display:flex;align-items:center;justify-content:center;transition:background-color .15s ease,color .15s ease;flex-shrink:0}.c2g-modal__close:hover{background-color:var(--c2g-hover-bg, #f3f4f6);color:var(--c2g-text-primary, #111827)}.c2g-modal__close:focus-visible{outline:2px solid var(--c2g-focus-ring, #3b82f6);outline-offset:2px}.c2g-modal__body{padding:var(--c2g-spacing-6, 1.5rem);overflow-y:auto;flex:1;min-height:0}\n"] }]
|
|
1894
|
+
}], ctorParameters: () => [], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], lockBodyScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "lockBodyScroll", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
1895
|
+
|
|
1896
|
+
class ToastService {
|
|
1897
|
+
toasts = signal([], ...(ngDevMode ? [{ debugName: "toasts" }] : []));
|
|
1898
|
+
show(message, tone, duration = 4000, action) {
|
|
1899
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1900
|
+
this.toasts.update(list => [...list, { id, message, tone, duration, action }]);
|
|
1901
|
+
if (duration > 0) {
|
|
1902
|
+
setTimeout(() => this.dismiss(id), duration);
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
success(message, duration) { this.show(message, 'success', duration); }
|
|
1906
|
+
error(message, duration) { this.show(message, 'error', duration ?? 6000); }
|
|
1907
|
+
warning(message, duration) { this.show(message, 'warning', duration); }
|
|
1908
|
+
info(message, duration) { this.show(message, 'info', duration); }
|
|
1909
|
+
withAction(message, tone, action) {
|
|
1910
|
+
this.show(message, tone, 0, action);
|
|
1911
|
+
}
|
|
1912
|
+
dismiss(id) {
|
|
1913
|
+
this.toasts.update(list => list.filter(t => t.id !== id));
|
|
1914
|
+
}
|
|
1915
|
+
dismissAll() {
|
|
1916
|
+
this.toasts.set([]);
|
|
1917
|
+
}
|
|
1918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1919
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastService, providedIn: 'root' });
|
|
1920
|
+
}
|
|
1921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastService, decorators: [{
|
|
1922
|
+
type: Injectable,
|
|
1923
|
+
args: [{ providedIn: 'root' }]
|
|
1924
|
+
}] });
|
|
1925
|
+
|
|
1926
|
+
class ToastContainerComponent {
|
|
1927
|
+
toastService = inject(ToastService);
|
|
1928
|
+
toasts = this.toastService.toasts;
|
|
1929
|
+
dismiss(id) {
|
|
1930
|
+
this.toastService.dismiss(id);
|
|
1931
|
+
}
|
|
1932
|
+
toneIcon(tone) {
|
|
1933
|
+
switch (tone) {
|
|
1934
|
+
case 'success': return '✓';
|
|
1935
|
+
case 'error': return '✕';
|
|
1936
|
+
case 'warning': return '⚠';
|
|
1937
|
+
default: return 'ℹ';
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1941
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ToastContainerComponent, isStandalone: true, selector: "c2g-toast-container", ngImport: i0, template: "<div class=\"c2g-toast-container\" aria-live=\"polite\" aria-atomic=\"false\">\n @for (toast of toasts(); track toast.id) {\n <div\n class=\"c2g-toast\"\n [class]=\"'c2g-toast--' + toast.tone\"\n role=\"status\"\n >\n <span class=\"c2g-toast__icon\" aria-hidden=\"true\">{{ toneIcon(toast.tone) }}</span>\n <span class=\"c2g-toast__message\">{{ toast.message }}</span>\n\n @if (toast.action) {\n <button\n class=\"c2g-toast__action\"\n type=\"button\"\n (click)=\"toast.action!.callback(); dismiss(toast.id)\"\n >\n {{ toast.action.label }}\n </button>\n }\n\n <button\n class=\"c2g-toast__close\"\n type=\"button\"\n (click)=\"dismiss(toast.id)\"\n aria-label=\"Schlie\u00DFen\"\n >\u2715</button>\n </div>\n }\n</div>\n", styles: [":host{display:contents;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:10px;pointer-events:none;max-width:420px;width:calc(100vw - 48px)}.c2g-toast{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--c2g-radius-md, 8px);background:var(--c2g-theme-surface, var(--c2g-color-surface));border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));box-shadow:var(--c2g-shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));pointer-events:all;animation:c2g-toast-in .25s cubic-bezier(.34,1.56,.64,1)}.c2g-toast--success{border-left:4px solid var(--c2g-theme-success, var(--c2g-color-success))}.c2g-toast--error{border-left:4px solid var(--c2g-theme-error, var(--c2g-color-error))}.c2g-toast--warning{border-left:4px solid var(--c2g-theme-warning, var(--c2g-color-warning))}.c2g-toast--info{border-left:4px solid var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-toast__icon{font-size:1rem;flex-shrink:0}.c2g-toast--success .c2g-toast__icon{color:var(--c2g-theme-success, var(--c2g-color-success))}.c2g-toast--error .c2g-toast__icon{color:var(--c2g-theme-error, var(--c2g-color-error))}.c2g-toast--warning .c2g-toast__icon{color:var(--c2g-theme-warning, var(--c2g-color-warning))}.c2g-toast--info .c2g-toast__icon{color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-toast__message{flex:1;line-height:1.4}.c2g-toast__action{border:none;background:none;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:600;color:var(--c2g-theme-primary, var(--c2g-color-primary));padding:0;white-space:nowrap;flex-shrink:0}.c2g-toast__action:hover{text-decoration:underline}.c2g-toast__close{border:none;background:none;cursor:pointer;font-size:.75rem;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:2px 4px;flex-shrink:0;border-radius:4px;line-height:1}.c2g-toast__close:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base));color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}@keyframes c2g-toast-in{0%{opacity:0;transform:translate(40px) scale(.95)}to{opacity:1;transform:translate(0) scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1942
|
+
}
|
|
1943
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ToastContainerComponent, decorators: [{
|
|
1944
|
+
type: Component,
|
|
1945
|
+
args: [{ selector: 'c2g-toast-container', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c2g-toast-container\" aria-live=\"polite\" aria-atomic=\"false\">\n @for (toast of toasts(); track toast.id) {\n <div\n class=\"c2g-toast\"\n [class]=\"'c2g-toast--' + toast.tone\"\n role=\"status\"\n >\n <span class=\"c2g-toast__icon\" aria-hidden=\"true\">{{ toneIcon(toast.tone) }}</span>\n <span class=\"c2g-toast__message\">{{ toast.message }}</span>\n\n @if (toast.action) {\n <button\n class=\"c2g-toast__action\"\n type=\"button\"\n (click)=\"toast.action!.callback(); dismiss(toast.id)\"\n >\n {{ toast.action.label }}\n </button>\n }\n\n <button\n class=\"c2g-toast__close\"\n type=\"button\"\n (click)=\"dismiss(toast.id)\"\n aria-label=\"Schlie\u00DFen\"\n >\u2715</button>\n </div>\n }\n</div>\n", styles: [":host{display:contents;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-toast-container{position:fixed;bottom:24px;right:24px;z-index:9999;display:flex;flex-direction:column;gap:10px;pointer-events:none;max-width:420px;width:calc(100vw - 48px)}.c2g-toast{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:var(--c2g-radius-md, 8px);background:var(--c2g-theme-surface, var(--c2g-color-surface));border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));box-shadow:var(--c2g-shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));pointer-events:all;animation:c2g-toast-in .25s cubic-bezier(.34,1.56,.64,1)}.c2g-toast--success{border-left:4px solid var(--c2g-theme-success, var(--c2g-color-success))}.c2g-toast--error{border-left:4px solid var(--c2g-theme-error, var(--c2g-color-error))}.c2g-toast--warning{border-left:4px solid var(--c2g-theme-warning, var(--c2g-color-warning))}.c2g-toast--info{border-left:4px solid var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-toast__icon{font-size:1rem;flex-shrink:0}.c2g-toast--success .c2g-toast__icon{color:var(--c2g-theme-success, var(--c2g-color-success))}.c2g-toast--error .c2g-toast__icon{color:var(--c2g-theme-error, var(--c2g-color-error))}.c2g-toast--warning .c2g-toast__icon{color:var(--c2g-theme-warning, var(--c2g-color-warning))}.c2g-toast--info .c2g-toast__icon{color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-toast__message{flex:1;line-height:1.4}.c2g-toast__action{border:none;background:none;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:600;color:var(--c2g-theme-primary, var(--c2g-color-primary));padding:0;white-space:nowrap;flex-shrink:0}.c2g-toast__action:hover{text-decoration:underline}.c2g-toast__close{border:none;background:none;cursor:pointer;font-size:.75rem;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:2px 4px;flex-shrink:0;border-radius:4px;line-height:1}.c2g-toast__close:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base));color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}@keyframes c2g-toast-in{0%{opacity:0;transform:translate(40px) scale(.95)}to{opacity:1;transform:translate(0) scale(1)}}\n"] }]
|
|
1946
|
+
}] });
|
|
1947
|
+
|
|
1948
|
+
class ConfirmDialogComponent {
|
|
1949
|
+
open = input(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
1950
|
+
data = input.required(...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
1951
|
+
confirmed = output();
|
|
1952
|
+
cancelled = output();
|
|
1953
|
+
confirmLabel = computed(() => this.data().confirmLabel ?? 'Bestätigen', ...(ngDevMode ? [{ debugName: "confirmLabel" }] : []));
|
|
1954
|
+
cancelLabel = computed(() => this.data().cancelLabel ?? 'Abbrechen', ...(ngDevMode ? [{ debugName: "cancelLabel" }] : []));
|
|
1955
|
+
tone = computed(() => this.data().tone ?? 'info', ...(ngDevMode ? [{ debugName: "tone" }] : []));
|
|
1956
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ConfirmDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1957
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: ConfirmDialogComponent, isStandalone: true, selector: "c2g-confirm-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { confirmed: "confirmed", cancelled: "cancelled" }, ngImport: i0, template: "<c2g-modal\n [open]=\"open()\"\n [title]=\"data().title\"\n size=\"sm\"\n (closed)=\"cancelled.emit()\"\n>\n <div class=\"c2g-confirm-dialog\">\n @if (data().icon) {\n <div class=\"c2g-confirm-dialog__icon\" [class]=\"'c2g-confirm-dialog__icon--' + tone()\">\n {{ data().icon }}\n </div>\n }\n\n <p class=\"c2g-confirm-dialog__message\">{{ data().message }}</p>\n\n <div class=\"c2g-confirm-dialog__actions\">\n <button\n class=\"c2g-confirm-dialog__btn c2g-confirm-dialog__btn--cancel\"\n type=\"button\"\n (click)=\"cancelled.emit()\"\n >\n {{ cancelLabel() }}\n </button>\n <button\n class=\"c2g-confirm-dialog__btn\"\n [class]=\"'c2g-confirm-dialog__btn--' + tone()\"\n type=\"button\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmLabel() }}\n </button>\n </div>\n </div>\n</c2g-modal>\n", styles: [":host{display:contents;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-confirm-dialog{font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);padding:8px 0 4px}.c2g-confirm-dialog__icon{font-size:2.5rem;text-align:center;margin-bottom:16px;line-height:1}.c2g-confirm-dialog__message{font-size:var(--c2g-font-size-base, 1rem);color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary));line-height:1.6;margin:0 0 24px;text-align:center}.c2g-confirm-dialog__actions{display:flex;gap:12px;justify-content:flex-end}.c2g-confirm-dialog__btn{padding:10px 20px;border-radius:var(--c2g-radius-sm, 6px);border:1px solid transparent;cursor:pointer;font-family:inherit;font-size:var(--c2g-font-size-sm, .875rem);font-weight:600;transition:background .15s ease,border-color .15s ease}.c2g-confirm-dialog__btn--cancel{background:var(--c2g-theme-surface, var(--c2g-color-surface));border-color:var(--c2g-theme-outline-variant, var(--c2g-color-outline));color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary))}.c2g-confirm-dialog__btn--cancel:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base))}.c2g-confirm-dialog__btn--danger{background:var(--c2g-theme-error, var(--c2g-color-error));color:var(--c2g-theme-surface, var(--c2g-color-surface))}.c2g-confirm-dialog__btn--danger:hover{background:var(--c2g-theme-primary-hover, var(--c2g-color-primary-dark));filter:brightness(.88)}.c2g-confirm-dialog__btn--warning{background:var(--c2g-theme-warning, var(--c2g-color-warning));color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-confirm-dialog__btn--warning:hover{filter:brightness(.92)}.c2g-confirm-dialog__btn--info{background:var(--c2g-theme-primary, var(--c2g-color-primary));color:var(--c2g-theme-surface, var(--c2g-color-surface))}.c2g-confirm-dialog__btn--info:hover{background:var(--c2g-theme-primary-hover, var(--c2g-color-primary-dark))}.c2g-confirm-dialog__btn:focus-visible{outline:2px solid var(--c2g-theme-primary, var(--c2g-color-primary));outline-offset:2px}\n"], dependencies: [{ kind: "component", type: ModalComponent, selector: "c2g-modal", inputs: ["open", "title", "size", "closable", "lockBodyScroll", "ariaLabel"], outputs: ["closed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1958
|
+
}
|
|
1959
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
|
|
1960
|
+
type: Component,
|
|
1961
|
+
args: [{ selector: 'c2g-confirm-dialog', standalone: true, imports: [ModalComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<c2g-modal\n [open]=\"open()\"\n [title]=\"data().title\"\n size=\"sm\"\n (closed)=\"cancelled.emit()\"\n>\n <div class=\"c2g-confirm-dialog\">\n @if (data().icon) {\n <div class=\"c2g-confirm-dialog__icon\" [class]=\"'c2g-confirm-dialog__icon--' + tone()\">\n {{ data().icon }}\n </div>\n }\n\n <p class=\"c2g-confirm-dialog__message\">{{ data().message }}</p>\n\n <div class=\"c2g-confirm-dialog__actions\">\n <button\n class=\"c2g-confirm-dialog__btn c2g-confirm-dialog__btn--cancel\"\n type=\"button\"\n (click)=\"cancelled.emit()\"\n >\n {{ cancelLabel() }}\n </button>\n <button\n class=\"c2g-confirm-dialog__btn\"\n [class]=\"'c2g-confirm-dialog__btn--' + tone()\"\n type=\"button\"\n (click)=\"confirmed.emit()\"\n >\n {{ confirmLabel() }}\n </button>\n </div>\n </div>\n</c2g-modal>\n", styles: [":host{display:contents;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-confirm-dialog{font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);padding:8px 0 4px}.c2g-confirm-dialog__icon{font-size:2.5rem;text-align:center;margin-bottom:16px;line-height:1}.c2g-confirm-dialog__message{font-size:var(--c2g-font-size-base, 1rem);color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary));line-height:1.6;margin:0 0 24px;text-align:center}.c2g-confirm-dialog__actions{display:flex;gap:12px;justify-content:flex-end}.c2g-confirm-dialog__btn{padding:10px 20px;border-radius:var(--c2g-radius-sm, 6px);border:1px solid transparent;cursor:pointer;font-family:inherit;font-size:var(--c2g-font-size-sm, .875rem);font-weight:600;transition:background .15s ease,border-color .15s ease}.c2g-confirm-dialog__btn--cancel{background:var(--c2g-theme-surface, var(--c2g-color-surface));border-color:var(--c2g-theme-outline-variant, var(--c2g-color-outline));color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary))}.c2g-confirm-dialog__btn--cancel:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base))}.c2g-confirm-dialog__btn--danger{background:var(--c2g-theme-error, var(--c2g-color-error));color:var(--c2g-theme-surface, var(--c2g-color-surface))}.c2g-confirm-dialog__btn--danger:hover{background:var(--c2g-theme-primary-hover, var(--c2g-color-primary-dark));filter:brightness(.88)}.c2g-confirm-dialog__btn--warning{background:var(--c2g-theme-warning, var(--c2g-color-warning));color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-confirm-dialog__btn--warning:hover{filter:brightness(.92)}.c2g-confirm-dialog__btn--info{background:var(--c2g-theme-primary, var(--c2g-color-primary));color:var(--c2g-theme-surface, var(--c2g-color-surface))}.c2g-confirm-dialog__btn--info:hover{background:var(--c2g-theme-primary-hover, var(--c2g-color-primary-dark))}.c2g-confirm-dialog__btn:focus-visible{outline:2px solid var(--c2g-theme-primary, var(--c2g-color-primary));outline-offset:2px}\n"] }]
|
|
1962
|
+
}], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], confirmed: [{ type: i0.Output, args: ["confirmed"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
1963
|
+
|
|
1964
|
+
const WEEKDAYS = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'];
|
|
1965
|
+
const MONTHS = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'];
|
|
1966
|
+
class DateRangePickerComponent {
|
|
1967
|
+
value = model({ from: null, to: null }, ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
1968
|
+
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : []));
|
|
1969
|
+
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : []));
|
|
1970
|
+
placeholder = input('Zeitraum wählen', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
1971
|
+
rangeChanged = output();
|
|
1972
|
+
open = signal(false, ...(ngDevMode ? [{ debugName: "open" }] : []));
|
|
1973
|
+
viewDate = signal(new Date(), ...(ngDevMode ? [{ debugName: "viewDate" }] : []));
|
|
1974
|
+
hoverDate = signal(null, ...(ngDevMode ? [{ debugName: "hoverDate" }] : []));
|
|
1975
|
+
weekdays = WEEKDAYS;
|
|
1976
|
+
months = MONTHS;
|
|
1977
|
+
monthLabel = computed(() => {
|
|
1978
|
+
const d = this.viewDate();
|
|
1979
|
+
return `${MONTHS[d.getMonth()]} ${d.getFullYear()}`;
|
|
1980
|
+
}, ...(ngDevMode ? [{ debugName: "monthLabel" }] : []));
|
|
1981
|
+
days = computed(() => {
|
|
1982
|
+
const vd = this.viewDate();
|
|
1983
|
+
const year = vd.getFullYear();
|
|
1984
|
+
const month = vd.getMonth();
|
|
1985
|
+
const firstDay = new Date(year, month, 1);
|
|
1986
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
1987
|
+
const today = new Date();
|
|
1988
|
+
today.setHours(0, 0, 0, 0);
|
|
1989
|
+
// Start from Monday
|
|
1990
|
+
const startOffset = (firstDay.getDay() + 6) % 7;
|
|
1991
|
+
const cells = [];
|
|
1992
|
+
for (let i = -startOffset; i < lastDay.getDate(); i++) {
|
|
1993
|
+
const date = new Date(year, month, i + 1);
|
|
1994
|
+
date.setHours(0, 0, 0, 0);
|
|
1995
|
+
const { from, to } = this.value();
|
|
1996
|
+
const hover = this.hoverDate();
|
|
1997
|
+
const rangeEnd = to ?? hover;
|
|
1998
|
+
const isStart = !!from && date.getTime() === from.getTime();
|
|
1999
|
+
const isEnd = !!rangeEnd && date.getTime() === rangeEnd.getTime();
|
|
2000
|
+
const inRange = !!from && !!rangeEnd &&
|
|
2001
|
+
date > (from < rangeEnd ? from : rangeEnd) &&
|
|
2002
|
+
date < (from < rangeEnd ? rangeEnd : from);
|
|
2003
|
+
const min = this.minDate();
|
|
2004
|
+
const max = this.maxDate();
|
|
2005
|
+
const disabled = (!!min && date < min) || (!!max && date > max);
|
|
2006
|
+
cells.push({
|
|
2007
|
+
date,
|
|
2008
|
+
currentMonth: date.getMonth() === month,
|
|
2009
|
+
today: date.getTime() === today.getTime(),
|
|
2010
|
+
inRange,
|
|
2011
|
+
isStart,
|
|
2012
|
+
isEnd,
|
|
2013
|
+
disabled
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
// Pad to full weeks
|
|
2017
|
+
while (cells.length % 7 !== 0) {
|
|
2018
|
+
const last = cells[cells.length - 1].date;
|
|
2019
|
+
const next = new Date(last);
|
|
2020
|
+
next.setDate(next.getDate() + 1);
|
|
2021
|
+
cells.push({ date: next, currentMonth: false, today: false, inRange: false, isStart: false, isEnd: false, disabled: true });
|
|
2022
|
+
}
|
|
2023
|
+
return cells;
|
|
2024
|
+
}, ...(ngDevMode ? [{ debugName: "days" }] : []));
|
|
2025
|
+
displayValue = computed(() => {
|
|
2026
|
+
const { from, to } = this.value();
|
|
2027
|
+
if (!from && !to)
|
|
2028
|
+
return '';
|
|
2029
|
+
const fmt = (d) => d.toLocaleDateString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
|
2030
|
+
if (from && to)
|
|
2031
|
+
return `${fmt(from)} – ${fmt(to)}`;
|
|
2032
|
+
if (from)
|
|
2033
|
+
return `${fmt(from)} – ...`;
|
|
2034
|
+
return '';
|
|
2035
|
+
}, ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
|
|
2036
|
+
toggleOpen() {
|
|
2037
|
+
this.open.update(v => !v);
|
|
2038
|
+
}
|
|
2039
|
+
closeCalendar() {
|
|
2040
|
+
this.open.set(false);
|
|
2041
|
+
this.hoverDate.set(null);
|
|
2042
|
+
}
|
|
2043
|
+
prevMonth() {
|
|
2044
|
+
this.viewDate.update(d => new Date(d.getFullYear(), d.getMonth() - 1, 1));
|
|
2045
|
+
}
|
|
2046
|
+
nextMonth() {
|
|
2047
|
+
this.viewDate.update(d => new Date(d.getFullYear(), d.getMonth() + 1, 1));
|
|
2048
|
+
}
|
|
2049
|
+
onDayClick(day) {
|
|
2050
|
+
if (day.disabled)
|
|
2051
|
+
return;
|
|
2052
|
+
const { from, to } = this.value();
|
|
2053
|
+
if (!from || (from && to)) {
|
|
2054
|
+
this.value.set({ from: day.date, to: null });
|
|
2055
|
+
}
|
|
2056
|
+
else {
|
|
2057
|
+
const range = day.date < from
|
|
2058
|
+
? { from: day.date, to: from }
|
|
2059
|
+
: { from, to: day.date };
|
|
2060
|
+
this.value.set(range);
|
|
2061
|
+
this.rangeChanged.emit(range);
|
|
2062
|
+
this.closeCalendar();
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
onDayHover(day) {
|
|
2066
|
+
if (!this.value().from || this.value().to)
|
|
2067
|
+
return;
|
|
2068
|
+
this.hoverDate.set(day.date);
|
|
2069
|
+
}
|
|
2070
|
+
clearRange() {
|
|
2071
|
+
this.value.set({ from: null, to: null });
|
|
2072
|
+
this.rangeChanged.emit({ from: null, to: null });
|
|
2073
|
+
}
|
|
2074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: DateRangePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2075
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: DateRangePickerComponent, isStandalone: true, selector: "c2g-date-range-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", rangeChanged: "rangeChanged" }, ngImport: i0, template: "<div class=\"c2g-drp\" [class.c2g-drp--open]=\"open()\">\n <div class=\"c2g-drp__trigger\" (click)=\"toggleOpen()\">\n <span class=\"c2g-drp__icon\" aria-hidden=\"true\">\uD83D\uDCC5</span>\n <span class=\"c2g-drp__value\" [class.c2g-drp__value--placeholder]=\"!displayValue()\">\n {{ displayValue() || placeholder() }}\n </span>\n @if (value().from) {\n <button\n class=\"c2g-drp__clear\"\n type=\"button\"\n aria-label=\"Datum l\u00F6schen\"\n (click)=\"$event.stopPropagation(); clearRange()\"\n >\u2715</button>\n }\n <span class=\"c2g-drp__chevron\" aria-hidden=\"true\">\u25BE</span>\n </div>\n\n @if (open()) {\n <div class=\"c2g-drp__backdrop\" (click)=\"closeCalendar()\"></div>\n <div class=\"c2g-drp__calendar\" role=\"dialog\" aria-label=\"Kalender\">\n <div class=\"c2g-drp__nav\">\n <button class=\"c2g-drp__nav-btn\" type=\"button\" (click)=\"prevMonth()\" aria-label=\"Vorheriger Monat\">\u2039</button>\n <span class=\"c2g-drp__month-label\">{{ monthLabel() }}</span>\n <button class=\"c2g-drp__nav-btn\" type=\"button\" (click)=\"nextMonth()\" aria-label=\"N\u00E4chster Monat\">\u203A</button>\n </div>\n\n <div class=\"c2g-drp__weekdays\">\n @for (day of weekdays; track day) {\n <span class=\"c2g-drp__weekday\">{{ day }}</span>\n }\n </div>\n\n <div class=\"c2g-drp__grid\">\n @for (day of days(); track day.date.getTime()) {\n <button\n class=\"c2g-drp__day\"\n type=\"button\"\n [class.c2g-drp__day--other-month]=\"!day.currentMonth\"\n [class.c2g-drp__day--today]=\"day.today\"\n [class.c2g-drp__day--start]=\"day.isStart\"\n [class.c2g-drp__day--end]=\"day.isEnd\"\n [class.c2g-drp__day--in-range]=\"day.inRange\"\n [class.c2g-drp__day--disabled]=\"day.disabled\"\n [disabled]=\"day.disabled || null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayHover(day)\"\n [attr.aria-label]=\"day.date.toLocaleDateString('de-DE')\"\n >\n {{ day.date.getDate() }}\n </button>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:inline-block;position:relative;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-drp{font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);position:relative}.c2g-drp__trigger{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));border-radius:var(--c2g-radius-sm, 6px);background:var(--c2g-theme-surface, var(--c2g-color-surface));cursor:pointer;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));min-width:240px;transition:border-color .15s ease}.c2g-drp__trigger:hover{border-color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp--open .c2g-drp__trigger{border-color:var(--c2g-theme-primary, var(--c2g-color-primary));box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-theme-primary, var(--c2g-color-primary)) 12%,transparent)}.c2g-drp__icon{flex-shrink:0;font-size:1rem}.c2g-drp__value{flex:1}.c2g-drp__value--placeholder{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted))}.c2g-drp__clear{border:none;background:none;cursor:pointer;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:0 2px;font-size:.75rem;line-height:1;flex-shrink:0}.c2g-drp__clear:hover{color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-drp__chevron{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));font-size:.75rem;flex-shrink:0;transition:transform .2s ease}.c2g-drp--open .c2g-drp__chevron{transform:rotate(180deg)}.c2g-drp__backdrop{position:fixed;inset:0;z-index:100}.c2g-drp__calendar{position:absolute;top:calc(100% + 6px);left:0;z-index:101;background:var(--c2g-theme-surface, var(--c2g-color-surface));border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));border-radius:var(--c2g-radius-lg, 12px);box-shadow:var(--c2g-shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));padding:16px;min-width:280px;animation:c2g-drp-open .2s cubic-bezier(.34,1.56,.64,1)}.c2g-drp__nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.c2g-drp__nav-btn{border:none;background:none;cursor:pointer;font-size:1.25rem;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary));padding:4px 8px;border-radius:var(--c2g-radius-sm, 4px);line-height:1}.c2g-drp__nav-btn:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base));color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__month-label{font-weight:700;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px}.c2g-drp__weekday{text-align:center;font-size:.7rem;font-weight:600;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:4px 0;text-transform:uppercase;letter-spacing:.04em}.c2g-drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.c2g-drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:none;cursor:pointer;font-family:inherit;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));border-radius:var(--c2g-radius-sm, 4px);transition:background .12s ease,color .12s ease;min-width:34px;min-height:34px}.c2g-drp__day:hover:not(.c2g-drp__day--disabled){background:var(--c2g-theme-primary-container, var(--c2g-color-primary-container));color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__day--other-month{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted))}.c2g-drp__day--today{font-weight:700;color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__day--start,.c2g-drp__day--end{background:var(--c2g-theme-primary, var(--c2g-color-primary))!important;color:var(--c2g-theme-surface, var(--c2g-color-surface))!important;border-radius:var(--c2g-radius-sm, 4px)}.c2g-drp__day--in-range{background:var(--c2g-theme-primary-container, var(--c2g-color-primary-container));color:var(--c2g-theme-primary, var(--c2g-color-primary));border-radius:0}.c2g-drp__day--disabled{opacity:.3;cursor:not-allowed}.c2g-drp__day:focus-visible{outline:2px solid var(--c2g-theme-primary, var(--c2g-color-primary));outline-offset:2px}@keyframes c2g-drp-open{0%{opacity:0;transform:translateY(-8px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2076
|
+
}
|
|
2077
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: DateRangePickerComponent, decorators: [{
|
|
2078
|
+
type: Component,
|
|
2079
|
+
args: [{ selector: 'c2g-date-range-picker', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c2g-drp\" [class.c2g-drp--open]=\"open()\">\n <div class=\"c2g-drp__trigger\" (click)=\"toggleOpen()\">\n <span class=\"c2g-drp__icon\" aria-hidden=\"true\">\uD83D\uDCC5</span>\n <span class=\"c2g-drp__value\" [class.c2g-drp__value--placeholder]=\"!displayValue()\">\n {{ displayValue() || placeholder() }}\n </span>\n @if (value().from) {\n <button\n class=\"c2g-drp__clear\"\n type=\"button\"\n aria-label=\"Datum l\u00F6schen\"\n (click)=\"$event.stopPropagation(); clearRange()\"\n >\u2715</button>\n }\n <span class=\"c2g-drp__chevron\" aria-hidden=\"true\">\u25BE</span>\n </div>\n\n @if (open()) {\n <div class=\"c2g-drp__backdrop\" (click)=\"closeCalendar()\"></div>\n <div class=\"c2g-drp__calendar\" role=\"dialog\" aria-label=\"Kalender\">\n <div class=\"c2g-drp__nav\">\n <button class=\"c2g-drp__nav-btn\" type=\"button\" (click)=\"prevMonth()\" aria-label=\"Vorheriger Monat\">\u2039</button>\n <span class=\"c2g-drp__month-label\">{{ monthLabel() }}</span>\n <button class=\"c2g-drp__nav-btn\" type=\"button\" (click)=\"nextMonth()\" aria-label=\"N\u00E4chster Monat\">\u203A</button>\n </div>\n\n <div class=\"c2g-drp__weekdays\">\n @for (day of weekdays; track day) {\n <span class=\"c2g-drp__weekday\">{{ day }}</span>\n }\n </div>\n\n <div class=\"c2g-drp__grid\">\n @for (day of days(); track day.date.getTime()) {\n <button\n class=\"c2g-drp__day\"\n type=\"button\"\n [class.c2g-drp__day--other-month]=\"!day.currentMonth\"\n [class.c2g-drp__day--today]=\"day.today\"\n [class.c2g-drp__day--start]=\"day.isStart\"\n [class.c2g-drp__day--end]=\"day.isEnd\"\n [class.c2g-drp__day--in-range]=\"day.inRange\"\n [class.c2g-drp__day--disabled]=\"day.disabled\"\n [disabled]=\"day.disabled || null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayHover(day)\"\n [attr.aria-label]=\"day.date.toLocaleDateString('de-DE')\"\n >\n {{ day.date.getDate() }}\n </button>\n }\n </div>\n </div>\n }\n</div>\n", styles: [":host{display:inline-block;position:relative;transition:background-color var(--c2g-transition-medium, .25s ease),color var(--c2g-transition-medium, .25s ease),border-color var(--c2g-transition-medium, .25s ease)}.c2g-drp{font-family:var(--c2g-font-family-base, \"Quicksand\", sans-serif);position:relative}.c2g-drp__trigger{display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));border-radius:var(--c2g-radius-sm, 6px);background:var(--c2g-theme-surface, var(--c2g-color-surface));cursor:pointer;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));min-width:240px;transition:border-color .15s ease}.c2g-drp__trigger:hover{border-color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp--open .c2g-drp__trigger{border-color:var(--c2g-theme-primary, var(--c2g-color-primary));box-shadow:0 0 0 3px color-mix(in srgb,var(--c2g-theme-primary, var(--c2g-color-primary)) 12%,transparent)}.c2g-drp__icon{flex-shrink:0;font-size:1rem}.c2g-drp__value{flex:1}.c2g-drp__value--placeholder{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted))}.c2g-drp__clear{border:none;background:none;cursor:pointer;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:0 2px;font-size:.75rem;line-height:1;flex-shrink:0}.c2g-drp__clear:hover{color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-drp__chevron{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));font-size:.75rem;flex-shrink:0;transition:transform .2s ease}.c2g-drp--open .c2g-drp__chevron{transform:rotate(180deg)}.c2g-drp__backdrop{position:fixed;inset:0;z-index:100}.c2g-drp__calendar{position:absolute;top:calc(100% + 6px);left:0;z-index:101;background:var(--c2g-theme-surface, var(--c2g-color-surface));border:1px solid var(--c2g-theme-outline-variant, var(--c2g-color-outline));border-radius:var(--c2g-radius-lg, 12px);box-shadow:var(--c2g-shadow-lg, 0 8px 24px rgba(0, 0, 0, .12));padding:16px;min-width:280px;animation:c2g-drp-open .2s cubic-bezier(.34,1.56,.64,1)}.c2g-drp__nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.c2g-drp__nav-btn{border:none;background:none;cursor:pointer;font-size:1.25rem;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-secondary));padding:4px 8px;border-radius:var(--c2g-radius-sm, 4px);line-height:1}.c2g-drp__nav-btn:hover{background:var(--c2g-theme-surface-container-low, var(--c2g-color-bg-base));color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__month-label{font-weight:700;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary))}.c2g-drp__weekdays{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px}.c2g-drp__weekday{text-align:center;font-size:.7rem;font-weight:600;color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted));padding:4px 0;text-transform:uppercase;letter-spacing:.04em}.c2g-drp__grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.c2g-drp__day{display:flex;align-items:center;justify-content:center;aspect-ratio:1;border:none;background:none;cursor:pointer;font-family:inherit;font-size:var(--c2g-font-size-sm, .875rem);color:var(--c2g-theme-on-surface, var(--c2g-color-text-primary));border-radius:var(--c2g-radius-sm, 4px);transition:background .12s ease,color .12s ease;min-width:34px;min-height:34px}.c2g-drp__day:hover:not(.c2g-drp__day--disabled){background:var(--c2g-theme-primary-container, var(--c2g-color-primary-container));color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__day--other-month{color:var(--c2g-theme-on-surface-variant, var(--c2g-color-text-muted))}.c2g-drp__day--today{font-weight:700;color:var(--c2g-theme-primary, var(--c2g-color-primary))}.c2g-drp__day--start,.c2g-drp__day--end{background:var(--c2g-theme-primary, var(--c2g-color-primary))!important;color:var(--c2g-theme-surface, var(--c2g-color-surface))!important;border-radius:var(--c2g-radius-sm, 4px)}.c2g-drp__day--in-range{background:var(--c2g-theme-primary-container, var(--c2g-color-primary-container));color:var(--c2g-theme-primary, var(--c2g-color-primary));border-radius:0}.c2g-drp__day--disabled{opacity:.3;cursor:not-allowed}.c2g-drp__day:focus-visible{outline:2px solid var(--c2g-theme-primary, var(--c2g-color-primary));outline-offset:2px}@keyframes c2g-drp-open{0%{opacity:0;transform:translateY(-8px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}\n"] }]
|
|
2080
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], rangeChanged: [{ type: i0.Output, args: ["rangeChanged"] }] } });
|
|
2081
|
+
|
|
2082
|
+
/*
|
|
2083
|
+
* Public API Surface of @humbeldore/c2g-ui (core)
|
|
2084
|
+
*
|
|
2085
|
+
* UI primitives — the building blocks every consumer needs.
|
|
2086
|
+
* Domain-specific entry points:
|
|
2087
|
+
* @humbeldore/c2g-ui/theme — ThemeService, design tokens, i18n
|
|
2088
|
+
* @humbeldore/c2g-ui/layout — ContentPanel, Hero, StatCard, ActionCard, ...
|
|
2089
|
+
* @humbeldore/c2g-ui/maps — MapComponent, MapMarkerComponent
|
|
2090
|
+
* @humbeldore/c2g-ui/charts — BarChart, LineChart, ...
|
|
2091
|
+
* @humbeldore/c2g-ui/presets — PackingList, MemberList, WeatherWidget, ...
|
|
2092
|
+
*/
|
|
2093
|
+
|
|
2094
|
+
/**
|
|
2095
|
+
* Generated bundle index. Do not edit.
|
|
2096
|
+
*/
|
|
2097
|
+
|
|
2098
|
+
export { AlertComponent, AvatarComponent, BadgeComponent, ButtonComponent, C2G_LOTTIE_PRESET_OPTIONS, C2G_LOTTIE_PRESET_PATHS, C2gUi, CheckboxComponent, ChipComponent, ConfirmDialogComponent, DateRangePickerComponent, InputComponent, LoaderComponent, LottieLoaderComponent, ModalComponent, ProgressComponent, RadioGroupComponent, SelectComponent, SkeletonComponent, SwitchComponent, TagComponent, TextareaComponent, ToastContainerComponent, ToastService, loadC2gLottiePresetData, provideC2gIcons };
|
|
2099
|
+
//# sourceMappingURL=camp2gether-c2g-ui.mjs.map
|