@fylib/adapter-angular 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/base/base-component.d.ts +18 -0
  2. package/dist/base/base-component.js +36 -0
  3. package/dist/base/interaction.utils.d.ts +7 -0
  4. package/dist/base/interaction.utils.js +34 -0
  5. package/dist/base/interaction.utils.test.d.ts +1 -0
  6. package/dist/base/interaction.utils.test.js +25 -0
  7. package/dist/components/accordion.component.d.ts +32 -0
  8. package/dist/components/accordion.component.js +337 -0
  9. package/dist/components/badge.component.d.ts +10 -0
  10. package/dist/components/badge.component.js +112 -0
  11. package/dist/components/button.component.d.ts +33 -0
  12. package/dist/components/button.component.js +272 -0
  13. package/dist/components/card.component.d.ts +29 -0
  14. package/dist/components/card.component.js +236 -0
  15. package/dist/components/chart.component.d.ts +39 -0
  16. package/dist/components/chart.component.js +307 -0
  17. package/dist/components/icon.component.d.ts +18 -0
  18. package/dist/components/icon.component.js +144 -0
  19. package/dist/components/input.component.d.ts +50 -0
  20. package/dist/components/input.component.js +383 -0
  21. package/dist/components/modal.component.d.ts +46 -0
  22. package/dist/components/modal.component.js +404 -0
  23. package/dist/components/nav-link.component.d.ts +11 -0
  24. package/dist/components/nav-link.component.js +121 -0
  25. package/dist/components/notification-menu.component.d.ts +68 -0
  26. package/dist/components/notification-menu.component.js +695 -0
  27. package/dist/components/select.component.d.ts +52 -0
  28. package/dist/components/select.component.js +395 -0
  29. package/dist/components/table.component.d.ts +55 -0
  30. package/dist/components/table.component.js +643 -0
  31. package/dist/components/text.component.d.ts +8 -0
  32. package/dist/components/text.component.js +58 -0
  33. package/dist/components/toast.component.d.ts +27 -0
  34. package/dist/components/toast.component.js +260 -0
  35. package/dist/directives/animation.directive.d.ts +5 -0
  36. package/dist/directives/animation.directive.js +34 -0
  37. package/dist/directives/theme-vars.directive.d.ts +7 -0
  38. package/dist/directives/theme-vars.directive.js +70 -0
  39. package/dist/directives/wallpaper.directive.d.ts +28 -0
  40. package/dist/directives/wallpaper.directive.js +195 -0
  41. package/dist/effects/confetti.plugin.d.ts +1 -0
  42. package/dist/effects/confetti.plugin.js +151 -0
  43. package/dist/effects/extra-effects.plugin.d.ts +3 -0
  44. package/dist/effects/extra-effects.plugin.js +288 -0
  45. package/dist/effects/hearts.plugin.d.ts +1 -0
  46. package/dist/effects/hearts.plugin.js +172 -0
  47. package/dist/effects/register-all.d.ts +1 -0
  48. package/dist/effects/register-all.js +16 -0
  49. package/dist/effects/ui-effects.plugin.d.ts +1 -0
  50. package/dist/effects/ui-effects.plugin.js +134 -0
  51. package/dist/icons/providers/fontawesome.provider.d.ts +3 -0
  52. package/dist/icons/providers/fontawesome.provider.js +25 -0
  53. package/dist/icons/providers/mdi.provider.d.ts +3 -0
  54. package/dist/icons/providers/mdi.provider.js +13 -0
  55. package/dist/icons/providers/phosphor.provider.d.ts +3 -0
  56. package/dist/icons/providers/phosphor.provider.js +17 -0
  57. package/dist/icons/registry.d.ts +22 -0
  58. package/dist/icons/registry.js +12 -0
  59. package/dist/index.d.ts +29 -0
  60. package/dist/index.js +29 -0
  61. package/dist/layouts/layout.component.d.ts +24 -0
  62. package/dist/layouts/layout.component.js +255 -0
  63. package/dist/layouts/slot.component.d.ts +61 -0
  64. package/dist/layouts/slot.component.js +937 -0
  65. package/dist/providers.d.ts +12 -0
  66. package/dist/providers.js +18 -0
  67. package/dist/services/fylib.service.d.ts +31 -0
  68. package/dist/services/fylib.service.js +214 -0
  69. package/dist/services/notification.service.d.ts +27 -0
  70. package/dist/services/notification.service.js +118 -0
  71. package/dist/services/sse.service.d.ts +16 -0
  72. package/dist/services/sse.service.js +109 -0
  73. package/dist/services/webclient.service.d.ts +38 -0
  74. package/dist/services/webclient.service.js +144 -0
  75. package/package.json +43 -0
@@ -0,0 +1,272 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Component, Input, Output, EventEmitter, ViewEncapsulation, HostBinding, inject } from '@angular/core';
11
+ import { CommonModule } from '@angular/common';
12
+ import { ButtonDefinition } from '@fylib/catalog';
13
+ import { FyIconComponent } from './icon.component';
14
+ import { BaseFyComponent } from '../base/base-component';
15
+ import { FyLibService } from '../services/fylib.service';
16
+ import { logger } from '@fylib/logger';
17
+ let FyButtonComponent = class FyButtonComponent extends BaseFyComponent {
18
+ constructor() {
19
+ super(inject(FyLibService), 'fy-button');
20
+ this.label = undefined;
21
+ this.variant = ButtonDefinition.defaultProps.variant;
22
+ this.size = ButtonDefinition.defaultProps.size;
23
+ this.disabled = ButtonDefinition.defaultProps.disabled;
24
+ this.loading = ButtonDefinition.defaultProps.loading;
25
+ this.icon = ButtonDefinition.defaultProps.icon;
26
+ this.activeAnimations = null;
27
+ this.activeEffects = null;
28
+ this.customStyles = null;
29
+ this.fyClick = new EventEmitter();
30
+ }
31
+ get animationsDisabled() {
32
+ return !this.isAnimationsActive(this.activeAnimations);
33
+ }
34
+ get hostStyles() {
35
+ return this.getHostStyles(this.customStyles);
36
+ }
37
+ get animationClassSuffix() {
38
+ const hover = this.resolveAnim('hover', this.hoverAnimation, ButtonDefinition.features?.animations?.hover);
39
+ const click = this.resolveAnim('click', this.clickAnimation, ButtonDefinition.features?.animations?.click);
40
+ return this.composeAnimClasses(hover, click);
41
+ }
42
+ handleClick(event) {
43
+ if (!this.disabled && !this.loading) {
44
+ logger.debug('Component', 'Button clicked', { label: this.label, variant: this.variant });
45
+ if (this.isAnimationsActive(this.activeAnimations)) {
46
+ const animationName = this.resolveAnim('click', this.clickAnimation, ButtonDefinition.features?.animations?.click);
47
+ if (animationName) {
48
+ this.fylib.playAnimation(animationName);
49
+ }
50
+ }
51
+ this.fyClick.emit(event);
52
+ this.triggerByEvent('fy-button.click', this.clickEffect, this.activeEffects);
53
+ }
54
+ }
55
+ handleHover() {
56
+ if (!this.isAnimationsActive(this.activeAnimations)) {
57
+ return;
58
+ }
59
+ logger.debug('Component', 'Button hovered', { label: this.label });
60
+ const animationName = this.resolveAnim('hover', this.hoverAnimation, ButtonDefinition.features?.animations?.hover);
61
+ if (animationName) {
62
+ this.fylib.playAnimation(animationName);
63
+ }
64
+ if (this.hoverEffect)
65
+ this.triggerDirect(this.hoverEffect, this.activeEffects);
66
+ }
67
+ };
68
+ __decorate([
69
+ Input(),
70
+ __metadata("design:type", Object)
71
+ ], FyButtonComponent.prototype, "label", void 0);
72
+ __decorate([
73
+ Input(),
74
+ __metadata("design:type", Object)
75
+ ], FyButtonComponent.prototype, "variant", void 0);
76
+ __decorate([
77
+ Input(),
78
+ __metadata("design:type", Object)
79
+ ], FyButtonComponent.prototype, "size", void 0);
80
+ __decorate([
81
+ Input(),
82
+ __metadata("design:type", Boolean)
83
+ ], FyButtonComponent.prototype, "disabled", void 0);
84
+ __decorate([
85
+ Input(),
86
+ __metadata("design:type", Boolean)
87
+ ], FyButtonComponent.prototype, "loading", void 0);
88
+ __decorate([
89
+ Input(),
90
+ __metadata("design:type", String)
91
+ ], FyButtonComponent.prototype, "icon", void 0);
92
+ __decorate([
93
+ Input(),
94
+ __metadata("design:type", String)
95
+ ], FyButtonComponent.prototype, "iconName", void 0);
96
+ __decorate([
97
+ Input(),
98
+ __metadata("design:type", String)
99
+ ], FyButtonComponent.prototype, "iconSet", void 0);
100
+ __decorate([
101
+ Input(),
102
+ __metadata("design:type", Object)
103
+ ], FyButtonComponent.prototype, "activeAnimations", void 0);
104
+ __decorate([
105
+ Input(),
106
+ __metadata("design:type", Object)
107
+ ], FyButtonComponent.prototype, "activeEffects", void 0);
108
+ __decorate([
109
+ Input(),
110
+ __metadata("design:type", Object)
111
+ ], FyButtonComponent.prototype, "customStyles", void 0);
112
+ __decorate([
113
+ Input(),
114
+ __metadata("design:type", String)
115
+ ], FyButtonComponent.prototype, "hoverAnimation", void 0);
116
+ __decorate([
117
+ Input(),
118
+ __metadata("design:type", String)
119
+ ], FyButtonComponent.prototype, "clickAnimation", void 0);
120
+ __decorate([
121
+ Input(),
122
+ __metadata("design:type", String)
123
+ ], FyButtonComponent.prototype, "successAnimation", void 0);
124
+ __decorate([
125
+ Input(),
126
+ __metadata("design:type", String)
127
+ ], FyButtonComponent.prototype, "errorAnimation", void 0);
128
+ __decorate([
129
+ Input(),
130
+ __metadata("design:type", String)
131
+ ], FyButtonComponent.prototype, "hoverEffect", void 0);
132
+ __decorate([
133
+ Input(),
134
+ __metadata("design:type", String)
135
+ ], FyButtonComponent.prototype, "clickEffect", void 0);
136
+ __decorate([
137
+ Input(),
138
+ __metadata("design:type", String)
139
+ ], FyButtonComponent.prototype, "successEffect", void 0);
140
+ __decorate([
141
+ Input(),
142
+ __metadata("design:type", String)
143
+ ], FyButtonComponent.prototype, "errorEffect", void 0);
144
+ __decorate([
145
+ Output(),
146
+ __metadata("design:type", Object)
147
+ ], FyButtonComponent.prototype, "fyClick", void 0);
148
+ __decorate([
149
+ HostBinding('class.fy-animations-disabled'),
150
+ __metadata("design:type", Boolean),
151
+ __metadata("design:paramtypes", [])
152
+ ], FyButtonComponent.prototype, "animationsDisabled", null);
153
+ __decorate([
154
+ HostBinding('style'),
155
+ __metadata("design:type", String),
156
+ __metadata("design:paramtypes", [])
157
+ ], FyButtonComponent.prototype, "hostStyles", null);
158
+ FyButtonComponent = __decorate([
159
+ Component({
160
+ selector: 'fy-button',
161
+ standalone: true,
162
+ imports: [CommonModule, FyIconComponent],
163
+ template: `
164
+ <button
165
+ [class]="'fy-button fy-button--' + variant + ' fy-button--' + size + animationClassSuffix"
166
+ [disabled]="disabled || loading"
167
+ (click)="handleClick($event)"
168
+ (mouseenter)="handleHover()"
169
+ [style]="hostStyles"
170
+ [attr.aria-busy]="loading"
171
+ [attr.aria-live]="loading ? 'polite' : null"
172
+ [attr.aria-label]="label || iconName || icon"
173
+ >
174
+ @if(loading) {
175
+ <span class="fy-button__loader"></span>
176
+ }
177
+ @if(iconName && !loading) {
178
+ <fy-icon [name]="iconName" [set]="iconSet" class="fy-button__icon"></fy-icon>
179
+ } @else if(icon && !loading) {
180
+ <span [class]="'fy-button__icon ' + icon"></span>
181
+ }
182
+ @if (label) {
183
+ <span class="fy-button__label">{{ label }}</span>
184
+ }
185
+ </button>
186
+ `,
187
+ styles: [`
188
+ .fy-button {
189
+ display: inline-flex;
190
+ align-items: center;
191
+ justify-content: center;
192
+ padding: var(--fy-spacing-sm) var(--fy-spacing-md);
193
+ border-radius: var(--fy-borderRadius-md);
194
+ font-family: inherit;
195
+ font-size: var(--fy-typography-fontSize-md);
196
+ font-weight: var(--fy-typography-fontWeight-bold);
197
+ cursor: pointer;
198
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
199
+ border: 1px solid var(--fy-effects-button-borderColor, transparent);
200
+ background: var(--fy-effects-button-background, var(--fy-colors-primary));
201
+ color: var(--fy-effects-button-textColor, var(--fy-colors-white));
202
+ outline: none;
203
+ user-select: none;
204
+ position: relative;
205
+ overflow: hidden;
206
+ gap: 8px;
207
+ }
208
+
209
+ .fy-animations-disabled, .fy-animations-disabled * {
210
+ transition: none !important;
211
+ animation: none !important;
212
+ }
213
+
214
+ .fy-button--secondary {
215
+ background: none !important;
216
+ background-color: var(--fy-colors-secondary) !important;
217
+ color: var(--fy-effects-button-textColor, var(--fy-colors-white)) !important;
218
+ }
219
+
220
+ .fy-button--ghost {
221
+ background: none !important;
222
+ background-color: transparent !important;
223
+ color: var(--fy-colors-primary) !important;
224
+ border-color: var(--fy-colors-primary) !important;
225
+ }
226
+
227
+ .fy-button--ghost:hover:not(:disabled) {
228
+ background-color: rgba(var(--fy-colors-primary-rgb, 59, 130, 246), 0.1);
229
+ }
230
+
231
+ .fy-button--danger {
232
+ background: none !important;
233
+ background-color: var(--fy-colors-danger) !important;
234
+ color: var(--fy-effects-button-textColor, var(--fy-colors-white)) !important;
235
+ }
236
+
237
+ .fy-button--sm {
238
+ padding: var(--fy-spacing-xs) var(--fy-spacing-sm);
239
+ font-size: var(--fy-typography-fontSize-sm);
240
+ }
241
+
242
+ .fy-button--lg {
243
+ padding: var(--fy-spacing-md) var(--fy-spacing-lg);
244
+ font-size: var(--fy-typography-fontSize-lg);
245
+ }
246
+
247
+ .fy-button:disabled {
248
+ opacity: 0.6;
249
+ cursor: not-allowed;
250
+ }
251
+
252
+ .fy-button__loader {
253
+ width: 16px;
254
+ height: 16px;
255
+ border: 2px solid currentColor;
256
+ border-bottom-color: transparent;
257
+ border-radius: 50%;
258
+ display: inline-block;
259
+ animation: fy-spin 0.8s linear infinite;
260
+ flex-shrink: 0;
261
+ }
262
+
263
+ @keyframes fy-spin {
264
+ from { transform: rotate(0deg); }
265
+ to { transform: rotate(360deg); }
266
+ }
267
+ `],
268
+ encapsulation: ViewEncapsulation.None
269
+ }),
270
+ __metadata("design:paramtypes", [])
271
+ ], FyButtonComponent);
272
+ export { FyButtonComponent };
@@ -0,0 +1,29 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { CardProps } from '@fylib/catalog';
3
+ import { EffectName } from '@fylib/config';
4
+ import { BaseFyComponent, FyComponentBaseInputs } from '../base/base-component';
5
+ export declare class FyCardComponent extends BaseFyComponent<'fy-card'> implements CardProps, FyComponentBaseInputs {
6
+ title?: string;
7
+ headerIconName?: string;
8
+ footerIconName?: string;
9
+ variant: NonNullable<CardProps['variant']>;
10
+ mode: NonNullable<CardProps['mode']>;
11
+ mutedHeader: boolean;
12
+ mutedFooter: boolean;
13
+ footerText?: string;
14
+ scrollContent: boolean;
15
+ activeAnimations: boolean | null;
16
+ activeEffects: boolean | null;
17
+ customStyles: Record<string, string> | null;
18
+ submitEffect?: EffectName;
19
+ fySubmit: EventEmitter<void>;
20
+ get animationsDisabled(): boolean;
21
+ constructor();
22
+ get hasHeaderSlot(): boolean;
23
+ get hasFooterSlot(): boolean;
24
+ get hasActionsSlot(): boolean;
25
+ get animationClassSuffix(): string;
26
+ get hostStyles(): string;
27
+ onSubmit(event: Event): void;
28
+ private resolveAnimationsActive;
29
+ }
@@ -0,0 +1,236 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Component, Input, Output, EventEmitter, ViewEncapsulation, HostBinding, inject } from '@angular/core';
11
+ import { CommonModule } from '@angular/common';
12
+ import { CardDefinition } from '@fylib/catalog';
13
+ import { FyIconComponent } from './icon.component';
14
+ import { animationClasses } from '../base/interaction.utils';
15
+ import { BaseFyComponent } from '../base/base-component';
16
+ let FyCardComponent = class FyCardComponent extends BaseFyComponent {
17
+ get animationsDisabled() {
18
+ return !this.isAnimationsActive(this.activeAnimations);
19
+ }
20
+ constructor() {
21
+ super(inject(require('../services/fylib.service').FyLibService), 'fy-card');
22
+ this.variant = CardDefinition.defaultProps.variant;
23
+ this.mode = CardDefinition.defaultProps.mode;
24
+ this.mutedHeader = CardDefinition.defaultProps.mutedHeader;
25
+ this.mutedFooter = CardDefinition.defaultProps.mutedFooter;
26
+ this.scrollContent = CardDefinition.defaultProps.scrollContent;
27
+ this.activeAnimations = CardDefinition.defaultProps.activeAnimations;
28
+ this.activeEffects = CardDefinition.defaultProps.activeEffects;
29
+ this.customStyles = CardDefinition.defaultProps.customStyles;
30
+ this.fySubmit = new EventEmitter();
31
+ const t = this.fylib.tokens();
32
+ const icons = t?.effects?.card?.icons || {};
33
+ if (icons?.header)
34
+ this.headerIconName = icons.header;
35
+ if (icons?.footer)
36
+ this.footerIconName = icons.footer;
37
+ }
38
+ get hasHeaderSlot() { return false; }
39
+ get hasFooterSlot() { return false; }
40
+ get hasActionsSlot() { return true; }
41
+ get animationClassSuffix() {
42
+ const anim = this.resolveAnim('enter', undefined, CardDefinition.features?.animations?.enter);
43
+ return animationClasses(anim);
44
+ }
45
+ get hostStyles() {
46
+ return this.getHostStyles(this.customStyles);
47
+ }
48
+ onSubmit(event) {
49
+ event.preventDefault();
50
+ if (this.mode === 'form' && this.isAnimationsActive(this.activeAnimations)) {
51
+ this.triggerByEvent('fy-card.submit', this.submitEffect, this.activeEffects);
52
+ }
53
+ if (this.mode === 'form') {
54
+ this.fySubmit.emit();
55
+ }
56
+ }
57
+ resolveAnimationsActive() {
58
+ return this.isAnimationsActive(this.activeAnimations);
59
+ }
60
+ };
61
+ __decorate([
62
+ Input(),
63
+ __metadata("design:type", String)
64
+ ], FyCardComponent.prototype, "title", void 0);
65
+ __decorate([
66
+ Input(),
67
+ __metadata("design:type", String)
68
+ ], FyCardComponent.prototype, "headerIconName", void 0);
69
+ __decorate([
70
+ Input(),
71
+ __metadata("design:type", String)
72
+ ], FyCardComponent.prototype, "footerIconName", void 0);
73
+ __decorate([
74
+ Input(),
75
+ __metadata("design:type", Object)
76
+ ], FyCardComponent.prototype, "variant", void 0);
77
+ __decorate([
78
+ Input(),
79
+ __metadata("design:type", Object)
80
+ ], FyCardComponent.prototype, "mode", void 0);
81
+ __decorate([
82
+ Input(),
83
+ __metadata("design:type", Boolean)
84
+ ], FyCardComponent.prototype, "mutedHeader", void 0);
85
+ __decorate([
86
+ Input(),
87
+ __metadata("design:type", Boolean)
88
+ ], FyCardComponent.prototype, "mutedFooter", void 0);
89
+ __decorate([
90
+ Input(),
91
+ __metadata("design:type", String)
92
+ ], FyCardComponent.prototype, "footerText", void 0);
93
+ __decorate([
94
+ Input(),
95
+ __metadata("design:type", Boolean)
96
+ ], FyCardComponent.prototype, "scrollContent", void 0);
97
+ __decorate([
98
+ Input(),
99
+ __metadata("design:type", Object)
100
+ ], FyCardComponent.prototype, "activeAnimations", void 0);
101
+ __decorate([
102
+ Input(),
103
+ __metadata("design:type", Object)
104
+ ], FyCardComponent.prototype, "activeEffects", void 0);
105
+ __decorate([
106
+ Input(),
107
+ __metadata("design:type", Object)
108
+ ], FyCardComponent.prototype, "customStyles", void 0);
109
+ __decorate([
110
+ Input(),
111
+ __metadata("design:type", String)
112
+ ], FyCardComponent.prototype, "submitEffect", void 0);
113
+ __decorate([
114
+ Output(),
115
+ __metadata("design:type", Object)
116
+ ], FyCardComponent.prototype, "fySubmit", void 0);
117
+ __decorate([
118
+ HostBinding('class.fy-animations-disabled'),
119
+ __metadata("design:type", Boolean),
120
+ __metadata("design:paramtypes", [])
121
+ ], FyCardComponent.prototype, "animationsDisabled", null);
122
+ FyCardComponent = __decorate([
123
+ Component({
124
+ selector: 'fy-card',
125
+ standalone: true,
126
+ imports: [CommonModule, FyIconComponent],
127
+ template: `
128
+ <section
129
+ class="fy-card fy-card--{{variant}} {{ animationClassSuffix }}"
130
+ [style]="hostStyles"
131
+ >
132
+ @if (title || hasHeaderSlot) {
133
+ <header class="fy-card__header" [class.fy-card__header--muted]="mutedHeader">
134
+ @if (headerIconName) {
135
+ <fy-icon class="fy-card__header-icon" [name]="headerIconName"></fy-icon>
136
+ }
137
+ <ng-content select="[fy-card-header]"></ng-content>
138
+ @if (title) {
139
+ <h3 class="fy-card__title">{{ title }}</h3>
140
+ }
141
+ </header>
142
+ }
143
+
144
+ <form class="fy-card__body" [class.fy-card__body--scroll]="scrollContent" (submit)="onSubmit($event)">
145
+ <ng-content></ng-content>
146
+ @if (hasActionsSlot) {
147
+ <div class="fy-card__actions">
148
+ <ng-content select="[fy-card-actions]"></ng-content>
149
+ </div>
150
+ }
151
+ </form>
152
+
153
+ @if (footerText || hasFooterSlot) {
154
+ <footer class="fy-card__footer" [class.fy-card__footer--muted]="mutedFooter">
155
+ @if (footerIconName) {
156
+ <fy-icon class="fy-card__footer-icon" [name]="footerIconName"></fy-icon>
157
+ }
158
+ <ng-content select="[fy-card-footer]"></ng-content>
159
+ @if (footerText) {
160
+ <span>{{ footerText }}</span>
161
+ }
162
+ </footer>
163
+ }
164
+ </section>
165
+ `,
166
+ styles: [`
167
+ .fy-card {
168
+ display: flex;
169
+ flex-direction: column;
170
+ gap: var(--fy-spacing-sm, 8px);
171
+ border-radius: var(--fy-borderRadius-lg, 12px);
172
+ background: var(--fy-effects-card-background, var(--fy-colors-surface, #fff));
173
+ border: 1px solid var(--fy-effects-card-borderColor, rgba(0,0,0,0.08));
174
+ box-shadow: var(--fy-effects-card-shadow, 0 6px 24px rgba(15, 23, 42, 0.06));
175
+ overflow: hidden;
176
+ width: 100%;
177
+ max-width: 100%;
178
+ color: var(--fy-colors-textOverlay, var(--fy-colors-text));
179
+ }
180
+ .fy-card__header-icon, .fy-card__footer-icon { margin-right: var(--fy-spacing-sm, 8px); opacity: .9; }
181
+
182
+ .fy-card__header,
183
+ .fy-card__footer {
184
+ padding: var(--fy-spacing-md, 16px);
185
+ display: flex;
186
+ align-items: center;
187
+ justify-content: space-between;
188
+ }
189
+
190
+ .fy-card__header--muted,
191
+ .fy-card__footer--muted {
192
+ background: var(--fy-colors-mutedBackground, rgba(15, 23, 42, 0.03));
193
+ color: var(--fy-colors-secondary, #64748b);
194
+ }
195
+
196
+ .fy-card__title {
197
+ margin: 0;
198
+ font-size: var(--fy-typography-fontSize-lg, 20px);
199
+ font-weight: var(--fy-typography-fontWeight-bold, 700);
200
+ }
201
+
202
+ .fy-card__body {
203
+ padding: var(--fy-spacing-md, 16px);
204
+ display: flex;
205
+ flex-direction: column;
206
+ gap: var(--fy-spacing-md, 16px);
207
+ }
208
+
209
+ .fy-card__body--scroll {
210
+ max-height: 420px;
211
+ overflow-y: auto;
212
+ }
213
+
214
+ .fy-card__actions {
215
+ display: flex;
216
+ gap: var(--fy-spacing-sm, 8px);
217
+ padding-top: var(--fy-spacing-sm, 8px);
218
+ border-top: 1px solid var(--fy-effects-card-dividerColor, rgba(0,0,0,0.08));
219
+ justify-content: flex-end;
220
+ flex-wrap: wrap;
221
+ }
222
+
223
+ @media (max-width: 768px) {
224
+ .fy-card__body--scroll {
225
+ max-height: 60vh;
226
+ }
227
+ .fy-card__actions {
228
+ justify-content: stretch;
229
+ }
230
+ }
231
+ `],
232
+ encapsulation: ViewEncapsulation.None
233
+ }),
234
+ __metadata("design:paramtypes", [])
235
+ ], FyCardComponent);
236
+ export { FyCardComponent };
@@ -0,0 +1,39 @@
1
+ import { EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { ChartProps, ChartType, ChartSeries } from '@fylib/catalog';
3
+ import { BaseFyComponent } from '../base/base-component';
4
+ import { BaseChartDirective } from 'ng2-charts';
5
+ import { ChartConfiguration, ChartData, ChartEvent } from 'chart.js';
6
+ export declare class FyChartComponent extends BaseFyComponent<'fy-chart'> implements ChartProps, OnInit, OnChanges {
7
+ type: ChartType;
8
+ series: ChartSeries[];
9
+ categories?: string[];
10
+ title?: string;
11
+ subtitle?: string;
12
+ height: string | number;
13
+ width: string | number;
14
+ colors?: string[];
15
+ showLegend: boolean;
16
+ showGrid: boolean;
17
+ showLabels: boolean;
18
+ stacked: boolean;
19
+ animated: boolean;
20
+ variant: 'default' | 'minimal' | 'compact';
21
+ activeAnimations: boolean | null;
22
+ activeEffects: boolean | null;
23
+ customStyles: Record<string, string> | null;
24
+ fyDataClick: EventEmitter<any>;
25
+ chart?: BaseChartDirective;
26
+ chartData: ChartData<any>;
27
+ chartOptions: ChartConfiguration['options'];
28
+ chartJsType: any;
29
+ constructor();
30
+ ngOnInit(): void;
31
+ ngOnChanges(changes: SimpleChanges): void;
32
+ private updateChart;
33
+ private mapType;
34
+ onChartClick({ event, active }: {
35
+ event?: ChartEvent;
36
+ active?: {}[];
37
+ }): void;
38
+ get animationClassSuffix(): string;
39
+ }