@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.
- package/dist/base/base-component.d.ts +18 -0
- package/dist/base/base-component.js +36 -0
- package/dist/base/interaction.utils.d.ts +7 -0
- package/dist/base/interaction.utils.js +34 -0
- package/dist/base/interaction.utils.test.d.ts +1 -0
- package/dist/base/interaction.utils.test.js +25 -0
- package/dist/components/accordion.component.d.ts +32 -0
- package/dist/components/accordion.component.js +337 -0
- package/dist/components/badge.component.d.ts +10 -0
- package/dist/components/badge.component.js +112 -0
- package/dist/components/button.component.d.ts +33 -0
- package/dist/components/button.component.js +272 -0
- package/dist/components/card.component.d.ts +29 -0
- package/dist/components/card.component.js +236 -0
- package/dist/components/chart.component.d.ts +39 -0
- package/dist/components/chart.component.js +307 -0
- package/dist/components/icon.component.d.ts +18 -0
- package/dist/components/icon.component.js +144 -0
- package/dist/components/input.component.d.ts +50 -0
- package/dist/components/input.component.js +383 -0
- package/dist/components/modal.component.d.ts +46 -0
- package/dist/components/modal.component.js +404 -0
- package/dist/components/nav-link.component.d.ts +11 -0
- package/dist/components/nav-link.component.js +121 -0
- package/dist/components/notification-menu.component.d.ts +68 -0
- package/dist/components/notification-menu.component.js +695 -0
- package/dist/components/select.component.d.ts +52 -0
- package/dist/components/select.component.js +395 -0
- package/dist/components/table.component.d.ts +55 -0
- package/dist/components/table.component.js +643 -0
- package/dist/components/text.component.d.ts +8 -0
- package/dist/components/text.component.js +58 -0
- package/dist/components/toast.component.d.ts +27 -0
- package/dist/components/toast.component.js +260 -0
- package/dist/directives/animation.directive.d.ts +5 -0
- package/dist/directives/animation.directive.js +34 -0
- package/dist/directives/theme-vars.directive.d.ts +7 -0
- package/dist/directives/theme-vars.directive.js +70 -0
- package/dist/directives/wallpaper.directive.d.ts +28 -0
- package/dist/directives/wallpaper.directive.js +195 -0
- package/dist/effects/confetti.plugin.d.ts +1 -0
- package/dist/effects/confetti.plugin.js +151 -0
- package/dist/effects/extra-effects.plugin.d.ts +3 -0
- package/dist/effects/extra-effects.plugin.js +288 -0
- package/dist/effects/hearts.plugin.d.ts +1 -0
- package/dist/effects/hearts.plugin.js +172 -0
- package/dist/effects/register-all.d.ts +1 -0
- package/dist/effects/register-all.js +16 -0
- package/dist/effects/ui-effects.plugin.d.ts +1 -0
- package/dist/effects/ui-effects.plugin.js +134 -0
- package/dist/icons/providers/fontawesome.provider.d.ts +3 -0
- package/dist/icons/providers/fontawesome.provider.js +25 -0
- package/dist/icons/providers/mdi.provider.d.ts +3 -0
- package/dist/icons/providers/mdi.provider.js +13 -0
- package/dist/icons/providers/phosphor.provider.d.ts +3 -0
- package/dist/icons/providers/phosphor.provider.js +17 -0
- package/dist/icons/registry.d.ts +22 -0
- package/dist/icons/registry.js +12 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +29 -0
- package/dist/layouts/layout.component.d.ts +24 -0
- package/dist/layouts/layout.component.js +255 -0
- package/dist/layouts/slot.component.d.ts +61 -0
- package/dist/layouts/slot.component.js +937 -0
- package/dist/providers.d.ts +12 -0
- package/dist/providers.js +18 -0
- package/dist/services/fylib.service.d.ts +31 -0
- package/dist/services/fylib.service.js +214 -0
- package/dist/services/notification.service.d.ts +27 -0
- package/dist/services/notification.service.js +118 -0
- package/dist/services/sse.service.d.ts +16 -0
- package/dist/services/sse.service.js +109 -0
- package/dist/services/webclient.service.d.ts +38 -0
- package/dist/services/webclient.service.js +144 -0
- package/package.json +43 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { animationEngine } from '@fylib/animation';
|
|
2
|
+
function createOrGet(id, setup) {
|
|
3
|
+
const existing = document.getElementById(id);
|
|
4
|
+
if (existing)
|
|
5
|
+
return existing;
|
|
6
|
+
const el = document.createElement('div');
|
|
7
|
+
el.id = id;
|
|
8
|
+
setup(el);
|
|
9
|
+
document.body.appendChild(el);
|
|
10
|
+
return el;
|
|
11
|
+
}
|
|
12
|
+
function playTemporary(el, duration, cleanup) {
|
|
13
|
+
el.style.opacity = '1';
|
|
14
|
+
if (duration <= 0) {
|
|
15
|
+
el.style.opacity = '0';
|
|
16
|
+
if (cleanup)
|
|
17
|
+
cleanup();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
el.style.opacity = '0';
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
if (el.parentElement) {
|
|
24
|
+
el.parentElement.removeChild(el);
|
|
25
|
+
}
|
|
26
|
+
if (cleanup)
|
|
27
|
+
cleanup();
|
|
28
|
+
}, 200);
|
|
29
|
+
}, duration);
|
|
30
|
+
}
|
|
31
|
+
function renderWindowOpen(duration = 600) {
|
|
32
|
+
const overlay = createOrGet('fy-window-open-overlay', el => {
|
|
33
|
+
el.style.position = 'fixed';
|
|
34
|
+
el.style.inset = '0';
|
|
35
|
+
el.style.background = 'rgba(255, 255, 255, 0.5)';
|
|
36
|
+
el.style.pointerEvents = 'none';
|
|
37
|
+
el.style.transition = 'opacity 0.2s ease';
|
|
38
|
+
el.style.opacity = '0';
|
|
39
|
+
el.style.zIndex = '9998';
|
|
40
|
+
});
|
|
41
|
+
playTemporary(overlay, duration);
|
|
42
|
+
}
|
|
43
|
+
function renderMacSheet(kind, duration = 600) {
|
|
44
|
+
const id = kind === 'open' ? 'fy-macos-sheet-open' : 'fy-macos-sheet-close';
|
|
45
|
+
const sheet = createOrGet(id, el => {
|
|
46
|
+
el.style.position = 'fixed';
|
|
47
|
+
el.style.left = '50%';
|
|
48
|
+
el.style.top = '0';
|
|
49
|
+
el.style.transform = 'translateX(-50%)';
|
|
50
|
+
el.style.width = '560px';
|
|
51
|
+
el.style.maxWidth = 'calc(100% - 40px)';
|
|
52
|
+
el.style.height = '140px';
|
|
53
|
+
el.style.background =
|
|
54
|
+
'linear-gradient(to bottom, rgba(245,245,247,0.98), rgba(229,229,234,0.98))';
|
|
55
|
+
el.style.borderRadius = '0 0 12px 12px';
|
|
56
|
+
el.style.boxShadow = '0 18px 40px rgba(0,0,0,0.35)';
|
|
57
|
+
el.style.pointerEvents = 'none';
|
|
58
|
+
el.style.transition = 'opacity 0.25s ease, transform 0.25s ease';
|
|
59
|
+
el.style.opacity = '0';
|
|
60
|
+
el.style.zIndex = '9999';
|
|
61
|
+
});
|
|
62
|
+
sheet.style.transform =
|
|
63
|
+
kind === 'open' ? 'translate(-50%, -20px)' : 'translate(-50%, 0)';
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
sheet.style.opacity = kind === 'open' ? '1' : '0';
|
|
66
|
+
sheet.style.transform =
|
|
67
|
+
kind === 'open' ? 'translate(-50%, 0)' : 'translate(-50%, -20px)';
|
|
68
|
+
}, 10);
|
|
69
|
+
playTemporary(sheet, duration);
|
|
70
|
+
}
|
|
71
|
+
function renderSidebarSlideGlow(side, duration = 600) {
|
|
72
|
+
const id = side === 'in' ? 'fy-sidebar-glow-in' : 'fy-sidebar-glow-out';
|
|
73
|
+
const glow = createOrGet(id, el => {
|
|
74
|
+
el.style.position = 'fixed';
|
|
75
|
+
el.style.top = '0';
|
|
76
|
+
el.style.left = '0';
|
|
77
|
+
el.style.height = '100%';
|
|
78
|
+
el.style.width = '8px';
|
|
79
|
+
el.style.background = side === 'in'
|
|
80
|
+
? 'linear-gradient(to right, rgba(37,99,235,0.6), rgba(37,99,235,0))'
|
|
81
|
+
: 'linear-gradient(to right, rgba(239,68,68,0.6), rgba(239,68,68,0))';
|
|
82
|
+
el.style.pointerEvents = 'none';
|
|
83
|
+
el.style.transition = 'opacity 0.2s ease';
|
|
84
|
+
el.style.opacity = '0';
|
|
85
|
+
el.style.zIndex = '9997';
|
|
86
|
+
});
|
|
87
|
+
playTemporary(glow, duration);
|
|
88
|
+
}
|
|
89
|
+
const uiEffectsPlugin = {
|
|
90
|
+
name: 'ui-effects-renderer',
|
|
91
|
+
renderEffect(effect) {
|
|
92
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
switch (effect.name) {
|
|
96
|
+
case 'window-open': {
|
|
97
|
+
const duration = (effect.params && effect.params['duration']);
|
|
98
|
+
renderWindowOpen(duration ?? 600);
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case 'window-macos-sheet-open': {
|
|
102
|
+
const duration = (effect.params && effect.params['duration']);
|
|
103
|
+
renderMacSheet('open', duration ?? 800);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case 'window-macos-sheet-close': {
|
|
107
|
+
const duration = (effect.params && effect.params['duration']);
|
|
108
|
+
renderMacSheet('close', duration ?? 600);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'sidebar-slide-in': {
|
|
112
|
+
const duration = (effect.params && effect.params['duration']);
|
|
113
|
+
renderSidebarSlideGlow('in', duration ?? 600);
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case 'sidebar-slide-out': {
|
|
117
|
+
const duration = (effect.params && effect.params['duration']);
|
|
118
|
+
renderSidebarSlideGlow('out', duration ?? 600);
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
default:
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
let registered = false;
|
|
127
|
+
export function registerUIEffectsPlugin() {
|
|
128
|
+
if (registered)
|
|
129
|
+
return;
|
|
130
|
+
if (typeof window === 'undefined' || typeof document === 'undefined')
|
|
131
|
+
return;
|
|
132
|
+
animationEngine.registerGlobalEffectPlugin(uiEffectsPlugin);
|
|
133
|
+
registered = true;
|
|
134
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { iconRegistry } from '../registry';
|
|
2
|
+
function mapVariantToFaPrefix(variant) {
|
|
3
|
+
switch (variant) {
|
|
4
|
+
case 'regular': return 'far';
|
|
5
|
+
case 'bold': return 'fas';
|
|
6
|
+
case 'light': return 'fal';
|
|
7
|
+
case 'thin': return 'fat';
|
|
8
|
+
case 'duotone': return 'fad';
|
|
9
|
+
case 'fill': return 'fas';
|
|
10
|
+
default: return 'fas';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export const fontAwesomeProvider = {
|
|
14
|
+
name: 'fa',
|
|
15
|
+
resolveClass(iconName, variant) {
|
|
16
|
+
const prefix = mapVariantToFaPrefix(variant);
|
|
17
|
+
return `${prefix} fa-${iconName}`;
|
|
18
|
+
},
|
|
19
|
+
resolveSvg() {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export function registerFontAwesomeProvider() {
|
|
24
|
+
iconRegistry.registerProvider(fontAwesomeProvider);
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { iconRegistry } from '../registry';
|
|
2
|
+
export const mdiProvider = {
|
|
3
|
+
name: 'mdi',
|
|
4
|
+
resolveClass(iconName) {
|
|
5
|
+
return `mdi mdi-${iconName}`;
|
|
6
|
+
},
|
|
7
|
+
resolveSvg() {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export function registerMdiProvider() {
|
|
12
|
+
iconRegistry.registerProvider(mdiProvider);
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { iconRegistry } from '../registry';
|
|
2
|
+
export const phosphorProvider = {
|
|
3
|
+
name: 'ph',
|
|
4
|
+
resolveClass(iconName, variant) {
|
|
5
|
+
const v = (variant || 'regular');
|
|
6
|
+
if (v === 'regular') {
|
|
7
|
+
return `ph ph-${iconName}`;
|
|
8
|
+
}
|
|
9
|
+
return `ph-${v} ph-${iconName}`;
|
|
10
|
+
},
|
|
11
|
+
resolveSvg() {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export function registerPhosphorProvider() {
|
|
16
|
+
iconRegistry.registerProvider(phosphorProvider);
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type IconVariant = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
|
|
2
|
+
export interface IconSetProvider {
|
|
3
|
+
name: string;
|
|
4
|
+
resolveClass?(iconName: string, variant?: IconVariant): string | null;
|
|
5
|
+
resolveSvg?(iconName: string, variant?: IconVariant): {
|
|
6
|
+
viewBox?: string;
|
|
7
|
+
svg: string;
|
|
8
|
+
} | null;
|
|
9
|
+
}
|
|
10
|
+
declare class IconRegistry {
|
|
11
|
+
private providers;
|
|
12
|
+
registerProvider(provider: IconSetProvider): void;
|
|
13
|
+
getProvider(name: string): IconSetProvider | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const iconRegistry: IconRegistry;
|
|
16
|
+
export interface IconNameMap {
|
|
17
|
+
ph: string;
|
|
18
|
+
fa: string;
|
|
19
|
+
mdi: string;
|
|
20
|
+
}
|
|
21
|
+
export type IconSetKey = keyof IconNameMap;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class IconRegistry {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.providers = new Map();
|
|
4
|
+
}
|
|
5
|
+
registerProvider(provider) {
|
|
6
|
+
this.providers.set(provider.name, provider);
|
|
7
|
+
}
|
|
8
|
+
getProvider(name) {
|
|
9
|
+
return this.providers.get(name);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export const iconRegistry = new IconRegistry();
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './services/fylib.service';
|
|
2
|
+
export * from './providers';
|
|
3
|
+
export * from './directives/theme-vars.directive';
|
|
4
|
+
export * from './directives/animation.directive';
|
|
5
|
+
export * from './directives/wallpaper.directive';
|
|
6
|
+
export * from './components/button.component';
|
|
7
|
+
export * from './components/input.component';
|
|
8
|
+
export * from './components/icon.component';
|
|
9
|
+
export * from './components/nav-link.component';
|
|
10
|
+
export * from './components/card.component';
|
|
11
|
+
export * from './components/table.component';
|
|
12
|
+
export * from './components/modal.component';
|
|
13
|
+
export * from './components/select.component';
|
|
14
|
+
export * from './components/accordion.component';
|
|
15
|
+
export * from './components/chart.component';
|
|
16
|
+
export * from './layouts/layout.component';
|
|
17
|
+
export * from './layouts/slot.component';
|
|
18
|
+
export * from './icons/registry';
|
|
19
|
+
export * from './icons/providers/phosphor.provider';
|
|
20
|
+
export * from './icons/providers/fontawesome.provider';
|
|
21
|
+
export * from './icons/providers/mdi.provider';
|
|
22
|
+
export * from './components/badge.component';
|
|
23
|
+
export * from './components/toast.component';
|
|
24
|
+
export * from './components/notification-menu.component';
|
|
25
|
+
export * from './components/text.component';
|
|
26
|
+
export * from './services/notification.service';
|
|
27
|
+
export * from './services/sse.service';
|
|
28
|
+
export * from './services/webclient.service';
|
|
29
|
+
export { registerAllEffects } from './effects/register-all';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './services/fylib.service';
|
|
2
|
+
export * from './providers';
|
|
3
|
+
export * from './directives/theme-vars.directive';
|
|
4
|
+
export * from './directives/animation.directive';
|
|
5
|
+
export * from './directives/wallpaper.directive';
|
|
6
|
+
export * from './components/button.component';
|
|
7
|
+
export * from './components/input.component';
|
|
8
|
+
export * from './components/icon.component';
|
|
9
|
+
export * from './components/nav-link.component';
|
|
10
|
+
export * from './components/card.component';
|
|
11
|
+
export * from './components/table.component';
|
|
12
|
+
export * from './components/modal.component';
|
|
13
|
+
export * from './components/select.component';
|
|
14
|
+
export * from './components/accordion.component';
|
|
15
|
+
export * from './components/chart.component';
|
|
16
|
+
export * from './layouts/layout.component';
|
|
17
|
+
export * from './layouts/slot.component';
|
|
18
|
+
export * from './icons/registry';
|
|
19
|
+
export * from './icons/providers/phosphor.provider';
|
|
20
|
+
export * from './icons/providers/fontawesome.provider';
|
|
21
|
+
export * from './icons/providers/mdi.provider';
|
|
22
|
+
export * from './components/badge.component';
|
|
23
|
+
export * from './components/toast.component';
|
|
24
|
+
export * from './components/notification-menu.component';
|
|
25
|
+
export * from './components/text.component';
|
|
26
|
+
export * from './services/notification.service';
|
|
27
|
+
export * from './services/sse.service';
|
|
28
|
+
export * from './services/webclient.service';
|
|
29
|
+
export { registerAllEffects } from './effects/register-all';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OnInit, OnChanges, SimpleChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { EffectName } from '@fylib/config';
|
|
3
|
+
export declare class FyLayoutComponent implements OnInit, OnChanges, OnDestroy {
|
|
4
|
+
private fylib;
|
|
5
|
+
private platformId;
|
|
6
|
+
private layoutEffectId;
|
|
7
|
+
name: string;
|
|
8
|
+
activeAnimations: boolean | null;
|
|
9
|
+
activeEffects: boolean | null;
|
|
10
|
+
customStyles: Record<string, string> | null;
|
|
11
|
+
enterEffect?: EffectName;
|
|
12
|
+
bgEffect?: EffectName | string | null;
|
|
13
|
+
bgEffectIntensity?: number | null;
|
|
14
|
+
bgEffectSpeed?: number | null;
|
|
15
|
+
bgEffectLoop?: boolean | null;
|
|
16
|
+
get animationsDisabled(): boolean;
|
|
17
|
+
constructor();
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
private applyBgEffect;
|
|
22
|
+
private stopBgEffect;
|
|
23
|
+
private resolveAnimationsActive;
|
|
24
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
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, ViewEncapsulation, HostBinding, inject, effect, PLATFORM_ID } from '@angular/core';
|
|
11
|
+
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
12
|
+
import { FyLibService } from '../services/fylib.service';
|
|
13
|
+
import { AppLayoutDefinition } from '@fylib/catalog';
|
|
14
|
+
import { resolveAnimationsActive, triggerEffectForEvent } from '../base/interaction.utils';
|
|
15
|
+
let FyLayoutComponent = class FyLayoutComponent {
|
|
16
|
+
get animationsDisabled() {
|
|
17
|
+
return !resolveAnimationsActive(this.fylib, 'fy-layout', this.activeAnimations);
|
|
18
|
+
}
|
|
19
|
+
constructor() {
|
|
20
|
+
this.fylib = inject(FyLibService);
|
|
21
|
+
this.platformId = inject(PLATFORM_ID);
|
|
22
|
+
this.layoutEffectId = `layout-bg-effect-${Math.random().toString(36).substr(2, 9)}`;
|
|
23
|
+
this.name = AppLayoutDefinition.name;
|
|
24
|
+
this.activeAnimations = null;
|
|
25
|
+
this.activeEffects = null;
|
|
26
|
+
this.customStyles = null;
|
|
27
|
+
this.bgEffectIntensity = null;
|
|
28
|
+
this.bgEffectSpeed = null;
|
|
29
|
+
this.bgEffectLoop = null;
|
|
30
|
+
// Reage a mudanças na configuração global de efeitos de tema (themeEffectsEnabled)
|
|
31
|
+
effect(() => {
|
|
32
|
+
this.fylib.config();
|
|
33
|
+
this.applyBgEffect();
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
ngOnInit() {
|
|
37
|
+
if (!isPlatformBrowser(this.platformId))
|
|
38
|
+
return;
|
|
39
|
+
if (!resolveAnimationsActive(this.fylib, 'fy-layout', this.activeAnimations)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const animationName = this.fylib.getComponentAnimation('fy-layout', 'enter');
|
|
43
|
+
if (animationName) {
|
|
44
|
+
this.fylib.playAnimation(animationName);
|
|
45
|
+
}
|
|
46
|
+
const enabled = this.fylib.isEffectsEnabledFor('fy-layout', this.activeEffects);
|
|
47
|
+
if (enabled) {
|
|
48
|
+
if (this.enterEffect) {
|
|
49
|
+
this.fylib.triggerEffect(this.enterEffect);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
triggerEffectForEvent(this.fylib, 'fy-layout.enter', 'fy-layout', this.activeEffects);
|
|
53
|
+
}
|
|
54
|
+
this.applyBgEffect();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
ngOnChanges(changes) {
|
|
58
|
+
if (!isPlatformBrowser(this.platformId))
|
|
59
|
+
return;
|
|
60
|
+
if (changes['bgEffect'] || changes['bgEffectIntensity'] || changes['bgEffectSpeed'] || changes['bgEffectLoop']) {
|
|
61
|
+
this.applyBgEffect();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
ngOnDestroy() {
|
|
65
|
+
if (!isPlatformBrowser(this.platformId))
|
|
66
|
+
return;
|
|
67
|
+
this.stopBgEffect();
|
|
68
|
+
}
|
|
69
|
+
applyBgEffect() {
|
|
70
|
+
if (!isPlatformBrowser(this.platformId))
|
|
71
|
+
return;
|
|
72
|
+
const config = this.fylib.config();
|
|
73
|
+
const globalEnabled = config.theme?.themeEffectsEnabled ?? false;
|
|
74
|
+
// Só mostra se habilitado globalmente no AppConfig (theme.config.ts)
|
|
75
|
+
if (!globalEnabled) {
|
|
76
|
+
this.stopBgEffect();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Regra solicitada: seguir a ativação do wallpaper.
|
|
80
|
+
// Ou seja, só ativa se a prop bgEffect estiver presente (não undefined).
|
|
81
|
+
if (this.bgEffect === undefined) {
|
|
82
|
+
this.stopBgEffect();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const enabled = this.fylib.isEffectsEnabledFor('fy-layout', this.activeEffects);
|
|
86
|
+
if (!enabled) {
|
|
87
|
+
this.stopBgEffect();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let effectToPlay;
|
|
91
|
+
let params = {
|
|
92
|
+
id: this.layoutEffectId,
|
|
93
|
+
intensity: this.bgEffectIntensity,
|
|
94
|
+
speed: this.bgEffectSpeed,
|
|
95
|
+
loop: this.bgEffectLoop
|
|
96
|
+
};
|
|
97
|
+
// 1. Se informou um nome específico (diferente de "" ou "auto"), usa ele como override com precedência total
|
|
98
|
+
if (this.bgEffect && this.bgEffect !== '' && this.bgEffect !== 'auto') {
|
|
99
|
+
effectToPlay = this.bgEffect;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// 2. Se a prop está presente mas sem valor ("" ou "auto"), pega o padrão do tema corrente
|
|
103
|
+
const themeEffect = this.fylib.getThemeBackgroundEffect();
|
|
104
|
+
if (themeEffect) {
|
|
105
|
+
effectToPlay = themeEffect.name;
|
|
106
|
+
// Aplica fallbacks do tema se não houver overrides na instância
|
|
107
|
+
params.intensity = params.intensity ?? themeEffect.intensity;
|
|
108
|
+
params.speed = params.speed ?? themeEffect.speed;
|
|
109
|
+
params.loop = params.loop ?? themeEffect.loop;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (effectToPlay) {
|
|
113
|
+
this.fylib.triggerEffect(effectToPlay, params);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.stopBgEffect();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
stopBgEffect() {
|
|
120
|
+
// Tenta parar tanto o efeito da prop quanto o possível efeito do tema
|
|
121
|
+
// O ID é o mesmo para o componente layout, então vai parar o que estiver rodando nele
|
|
122
|
+
const currentEffect = this.bgEffect || this.fylib.getThemeBackgroundEffect()?.name;
|
|
123
|
+
if (currentEffect) {
|
|
124
|
+
this.fylib.triggerEffect(currentEffect, {
|
|
125
|
+
id: this.layoutEffectId,
|
|
126
|
+
stop: true
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
resolveAnimationsActive() {
|
|
131
|
+
return resolveAnimationsActive(this.fylib, 'fy-layout', this.activeAnimations);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
__decorate([
|
|
135
|
+
Input(),
|
|
136
|
+
__metadata("design:type", String)
|
|
137
|
+
], FyLayoutComponent.prototype, "name", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
Input(),
|
|
140
|
+
__metadata("design:type", Object)
|
|
141
|
+
], FyLayoutComponent.prototype, "activeAnimations", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
Input(),
|
|
144
|
+
__metadata("design:type", Object)
|
|
145
|
+
], FyLayoutComponent.prototype, "activeEffects", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
Input(),
|
|
148
|
+
__metadata("design:type", Object)
|
|
149
|
+
], FyLayoutComponent.prototype, "customStyles", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
Input(),
|
|
152
|
+
__metadata("design:type", String)
|
|
153
|
+
], FyLayoutComponent.prototype, "enterEffect", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
Input(),
|
|
156
|
+
__metadata("design:type", Object)
|
|
157
|
+
], FyLayoutComponent.prototype, "bgEffect", void 0);
|
|
158
|
+
__decorate([
|
|
159
|
+
Input(),
|
|
160
|
+
__metadata("design:type", Object)
|
|
161
|
+
], FyLayoutComponent.prototype, "bgEffectIntensity", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
Input(),
|
|
164
|
+
__metadata("design:type", Object)
|
|
165
|
+
], FyLayoutComponent.prototype, "bgEffectSpeed", void 0);
|
|
166
|
+
__decorate([
|
|
167
|
+
Input(),
|
|
168
|
+
__metadata("design:type", Object)
|
|
169
|
+
], FyLayoutComponent.prototype, "bgEffectLoop", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
HostBinding('class.fy-animations-disabled'),
|
|
172
|
+
__metadata("design:type", Boolean),
|
|
173
|
+
__metadata("design:paramtypes", [])
|
|
174
|
+
], FyLayoutComponent.prototype, "animationsDisabled", null);
|
|
175
|
+
FyLayoutComponent = __decorate([
|
|
176
|
+
Component({
|
|
177
|
+
selector: 'fy-layout',
|
|
178
|
+
standalone: true,
|
|
179
|
+
imports: [CommonModule],
|
|
180
|
+
template: `
|
|
181
|
+
<div [class]="'fy-layout fy-layout--' + name" [ngStyle]="customStyles || null">
|
|
182
|
+
<ng-content></ng-content>
|
|
183
|
+
</div>
|
|
184
|
+
`,
|
|
185
|
+
styles: [`
|
|
186
|
+
.fy-layout {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
min-height: 100vh;
|
|
190
|
+
width: 100%;
|
|
191
|
+
overflow-x: hidden;
|
|
192
|
+
background-color: var(--fy-colors-background);
|
|
193
|
+
color: var(--fy-colors-text);
|
|
194
|
+
font-family: var(--fy-typography-fontFamily-base, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
|
|
195
|
+
transition: background-color 0.3s ease, color 0.3s ease;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* App Layout specific styles */
|
|
199
|
+
.fy-layout--app-layout {
|
|
200
|
+
display: grid;
|
|
201
|
+
grid-template-areas:
|
|
202
|
+
"header"
|
|
203
|
+
"content"
|
|
204
|
+
"footer";
|
|
205
|
+
grid-template-columns: 1fr;
|
|
206
|
+
grid-template-rows: auto 1fr auto;
|
|
207
|
+
gap: var(--fy-layout-gap, 0);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* When sidebar slot is present, switch to two columns */
|
|
211
|
+
.fy-layout--app-layout:has(.fy-slot--sidebar) {
|
|
212
|
+
grid-template-areas:
|
|
213
|
+
"header header"
|
|
214
|
+
"sidebar content"
|
|
215
|
+
"footer footer";
|
|
216
|
+
grid-template-columns: var(--fy-layout-sidebar-width, 260px) 1fr;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Fixed Sidebar mode: Lock height to viewport and disable global scroll */
|
|
220
|
+
.fy-layout--app-layout:has(.fy-slot--sidebar-fixed) {
|
|
221
|
+
height: 100vh;
|
|
222
|
+
min-height: 100vh;
|
|
223
|
+
max-height: 100vh;
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Ensure content area takes full height and scrolls internally in fixed mode */
|
|
228
|
+
.fy-layout--app-layout:has(.fy-slot--sidebar-fixed) .fy-slot--content {
|
|
229
|
+
height: 100%;
|
|
230
|
+
overflow-y: auto;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
@media (max-width: 768px) {
|
|
234
|
+
.fy-layout--app-layout {
|
|
235
|
+
grid-template-areas:
|
|
236
|
+
"header"
|
|
237
|
+
"content"
|
|
238
|
+
"footer";
|
|
239
|
+
grid-template-columns: 1fr;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.fy-layout--app-layout:has(.fy-slot--sidebar) {
|
|
243
|
+
grid-template-areas:
|
|
244
|
+
"header"
|
|
245
|
+
"content"
|
|
246
|
+
"footer";
|
|
247
|
+
grid-template-columns: 1fr;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
`],
|
|
251
|
+
encapsulation: ViewEncapsulation.None
|
|
252
|
+
}),
|
|
253
|
+
__metadata("design:paramtypes", [])
|
|
254
|
+
], FyLayoutComponent);
|
|
255
|
+
export { FyLayoutComponent };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { EffectName } from '@fylib/config';
|
|
3
|
+
export declare class FySlotComponent implements OnDestroy {
|
|
4
|
+
private fylib;
|
|
5
|
+
name: 'content' | 'sidebar' | 'header' | 'footer';
|
|
6
|
+
activeAnimations: boolean | null;
|
|
7
|
+
activeEffects: boolean | null;
|
|
8
|
+
customStyles: Record<string, string> | null;
|
|
9
|
+
fixedSidebar: boolean | null;
|
|
10
|
+
copyrightText: string | null;
|
|
11
|
+
copyrightShineDuration: string;
|
|
12
|
+
openEffect?: EffectName;
|
|
13
|
+
closeEffect?: EffectName;
|
|
14
|
+
sidebarOpen: boolean;
|
|
15
|
+
headerMenuOpen: boolean;
|
|
16
|
+
headerToggleIconName: string;
|
|
17
|
+
sidebarToggleIconName: string;
|
|
18
|
+
sidebarToggleMode: 'floating' | 'tongue';
|
|
19
|
+
sidebarTonguePos: 'top' | 'middle' | 'bottom';
|
|
20
|
+
headerMenuAnimClass: string;
|
|
21
|
+
headerMenuAnimationOpen?: import('@fylib/animation').HeaderMenuAnimationName | null;
|
|
22
|
+
headerMenuAnimationClose?: import('@fylib/animation').HeaderMenuAnimationName | null;
|
|
23
|
+
/** Deprecated: use fy-header-links-center/right slots */
|
|
24
|
+
headerLinksAlign: 'left' | 'center' | 'right';
|
|
25
|
+
headerLogoImgSrc?: string | null;
|
|
26
|
+
headerLogoSvgSrc?: string | null;
|
|
27
|
+
headerLogoAlt?: string | null;
|
|
28
|
+
headerLogoBadgeText?: string | null;
|
|
29
|
+
headerLogoBadgeBG?: string | null;
|
|
30
|
+
headerLogoBadgeTextColor?: string | null;
|
|
31
|
+
headerLogoBadgeRadius?: string | null;
|
|
32
|
+
headerLogoBadgeShine?: boolean | null;
|
|
33
|
+
headerLogoColorLight?: string | null;
|
|
34
|
+
headerLogoColorDark?: string | null;
|
|
35
|
+
sidebarLogoImgSrc?: string | null;
|
|
36
|
+
sidebarLogoSvgSrc?: string | null;
|
|
37
|
+
sidebarLogoAlt?: string | null;
|
|
38
|
+
headerLogoFilter?: string | null;
|
|
39
|
+
sidebarLogoFilter?: string | null;
|
|
40
|
+
sidebarLogoColorLight?: string | null;
|
|
41
|
+
sidebarLogoColorDark?: string | null;
|
|
42
|
+
sidebarLogoBadgeText?: string | null;
|
|
43
|
+
sidebarLogoBadgeBG?: string | null;
|
|
44
|
+
sidebarLogoBadgeTextColor?: string | null;
|
|
45
|
+
sidebarLogoBadgeRadius?: string | null;
|
|
46
|
+
sidebarLogoBadgeShine?: boolean | null;
|
|
47
|
+
get currentYear(): number;
|
|
48
|
+
get animationsDisabled(): boolean;
|
|
49
|
+
get hostStyles(): string;
|
|
50
|
+
get hostClass(): string;
|
|
51
|
+
get computedHeaderLogoFilter(): string | null;
|
|
52
|
+
get computedSidebarLogoFilter(): string | null;
|
|
53
|
+
private filterFromTargetColor;
|
|
54
|
+
private getLogoDarkOpacity;
|
|
55
|
+
toggleSidebar(): void;
|
|
56
|
+
toggleHeaderMenu(): void;
|
|
57
|
+
constructor();
|
|
58
|
+
ngOnDestroy(): void;
|
|
59
|
+
private resolveAnimationsActive;
|
|
60
|
+
private updateBodyScroll;
|
|
61
|
+
}
|