@rededor/site-front-end-lib 20.0.0 → 20.0.2
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/components/filter-letter-and-terms/index.d.ts +2 -1
- package/components/page-header/index.d.ts +5 -1
- package/components/sidebar-navigation/index.d.ts +7 -2
- package/components/sticky-navigation/index.d.ts +8 -2
- package/cura/feedback/cura-toast/index.d.ts +104 -0
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs +4 -3
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs +8 -3
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs +17 -5
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs +27 -8
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs +198 -0
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs.map +1 -0
- package/package.json +5 -1
|
@@ -9,6 +9,7 @@ declare class FilterLetterAndTermsComponent implements AfterViewInit {
|
|
|
9
9
|
readonly baseUrl: _angular_core.InputSignal<string>;
|
|
10
10
|
readonly baseUrlAll: _angular_core.InputSignal<string>;
|
|
11
11
|
readonly enableScroll: _angular_core.InputSignal<boolean>;
|
|
12
|
+
readonly buttonMode: _angular_core.InputSignal<boolean>;
|
|
12
13
|
private isFirstScroll;
|
|
13
14
|
private _selectedOption;
|
|
14
15
|
set selectedOption(value: string);
|
|
@@ -30,7 +31,7 @@ declare class FilterLetterAndTermsComponent implements AfterViewInit {
|
|
|
30
31
|
selectOption(option: string, event: Event): void;
|
|
31
32
|
scrollToSelectedOption(value: string): void;
|
|
32
33
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FilterLetterAndTermsComponent, never>;
|
|
33
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilterLetterAndTermsComponent, "rdsite-filter-letter-and-terms", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "baseUrl": { "alias": "baseUrl"; "required": false; "isSignal": true; }; "baseUrlAll": { "alias": "baseUrlAll"; "required": false; "isSignal": true; }; "enableScroll": { "alias": "enableScroll"; "required": false; "isSignal": true; }; "selectedOption": { "alias": "selectedOption"; "required": false; }; }, { "optionSelected": "optionSelected"; }, never, never, true, never>;
|
|
34
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FilterLetterAndTermsComponent, "rdsite-filter-letter-and-terms", never, { "options": { "alias": "options"; "required": false; "isSignal": true; }; "baseUrl": { "alias": "baseUrl"; "required": false; "isSignal": true; }; "baseUrlAll": { "alias": "baseUrlAll"; "required": false; "isSignal": true; }; "enableScroll": { "alias": "enableScroll"; "required": false; "isSignal": true; }; "buttonMode": { "alias": "buttonMode"; "required": false; "isSignal": true; }; "selectedOption": { "alias": "selectedOption"; "required": false; }; }, { "optionSelected": "optionSelected"; }, never, never, true, never>;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export { FilterLetterAndTermsComponent };
|
|
@@ -8,13 +8,17 @@ declare class PageHeaderComponent {
|
|
|
8
8
|
readonly hasPadding: _angular_core.InputSignal<boolean>;
|
|
9
9
|
readonly breadcrumbs: _angular_core.InputSignal<BreadcrumbsItems[]>;
|
|
10
10
|
readonly bgColor: _angular_core.InputSignal<string>;
|
|
11
|
+
readonly imgUrl: _angular_core.InputSignal<string>;
|
|
12
|
+
readonly imgMimeType: _angular_core.InputSignal<any>;
|
|
13
|
+
readonly imgAlt: _angular_core.InputSignal<string>;
|
|
14
|
+
readonly imgTitle: _angular_core.InputSignal<string>;
|
|
11
15
|
get style(): {
|
|
12
16
|
'--bg-color': string;
|
|
13
17
|
'--neutral-purewhite': string;
|
|
14
18
|
'--font-family': string;
|
|
15
19
|
};
|
|
16
20
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PageHeaderComponent, never>;
|
|
17
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PageHeaderComponent, "rdsite-page-header", never, { "pageTitle": { "alias": "pageTitle"; "required": false; "isSignal": true; }; "pageHeaderText": { "alias": "pageHeaderText"; "required": false; "isSignal": true; }; "hasPadding": { "alias": "hasPadding"; "required": false; "isSignal": true; }; "breadcrumbs": { "alias": "breadcrumbs"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
21
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PageHeaderComponent, "rdsite-page-header", never, { "pageTitle": { "alias": "pageTitle"; "required": false; "isSignal": true; }; "pageHeaderText": { "alias": "pageHeaderText"; "required": false; "isSignal": true; }; "hasPadding": { "alias": "hasPadding"; "required": false; "isSignal": true; }; "breadcrumbs": { "alias": "breadcrumbs"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "imgUrl": { "alias": "imgUrl"; "required": false; "isSignal": true; }; "imgMimeType": { "alias": "imgMimeType"; "required": false; "isSignal": true; }; "imgAlt": { "alias": "imgAlt"; "required": false; "isSignal": true; }; "imgTitle": { "alias": "imgTitle"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
export { PageHeaderComponent };
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
3
3
|
import { SectionNavigationData, SectionNavigationConfig } from '@rededor/site-front-end-lib/core';
|
|
4
4
|
|
|
5
|
-
declare class SidebarNavigationComponent {
|
|
5
|
+
declare class SidebarNavigationComponent implements AfterViewInit {
|
|
6
6
|
private readonly curaApiService;
|
|
7
7
|
private router;
|
|
8
|
+
private platformId;
|
|
9
|
+
private document;
|
|
8
10
|
readonly sections: _angular_core.WritableSignal<SectionNavigationData[]>;
|
|
9
11
|
readonly config: _angular_core.WritableSignal<SectionNavigationConfig | undefined>;
|
|
10
12
|
readonly activeSection: _angular_core.WritableSignal<string>;
|
|
11
13
|
selectedIndex: _angular_core.WritableSignal<number>;
|
|
14
|
+
defaultAnchorAdjustment: _angular_core.WritableSignal<number>;
|
|
15
|
+
private menuHeaderHeight;
|
|
12
16
|
readonly anchorAdjustment: _angular_core.InputSignal<number>;
|
|
13
17
|
readonly title: _angular_core.InputSignal<string>;
|
|
14
18
|
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
@@ -21,6 +25,7 @@ declare class SidebarNavigationComponent {
|
|
|
21
25
|
styleBinding: {
|
|
22
26
|
'--font-family': string;
|
|
23
27
|
};
|
|
28
|
+
ngAfterViewInit(): void;
|
|
24
29
|
private windowScroll;
|
|
25
30
|
getPath(sectionId: string): string;
|
|
26
31
|
onSectionClick(event: SectionNavigationData): void;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
3
3
|
import { SectionNavigationData, SectionNavigationConfig } from '@rededor/site-front-end-lib/core';
|
|
4
4
|
|
|
5
|
-
declare class StickyNavigationComponent {
|
|
5
|
+
declare class StickyNavigationComponent implements AfterViewInit {
|
|
6
6
|
private curaApiService;
|
|
7
7
|
private router;
|
|
8
|
+
private platformId;
|
|
9
|
+
private document;
|
|
8
10
|
readonly sections: _angular_core.WritableSignal<SectionNavigationData[]>;
|
|
9
11
|
readonly config: _angular_core.WritableSignal<SectionNavigationConfig | undefined>;
|
|
10
12
|
readonly activeSection: _angular_core.WritableSignal<string>;
|
|
11
13
|
readonly isOpen: _angular_core.WritableSignal<boolean>;
|
|
12
14
|
selectedIndex: _angular_core.WritableSignal<number>;
|
|
15
|
+
defaultAnchorAdjustment: _angular_core.WritableSignal<number>;
|
|
16
|
+
private menuHeaderHeight;
|
|
17
|
+
private menuStickyClosedHeight;
|
|
13
18
|
readonly anchorAdjustment: _angular_core.InputSignal<number>;
|
|
14
19
|
readonly title: _angular_core.InputSignal<string>;
|
|
15
20
|
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
@@ -23,6 +28,7 @@ declare class StickyNavigationComponent {
|
|
|
23
28
|
'--neutral-purewhite': string;
|
|
24
29
|
'--font-family': string;
|
|
25
30
|
};
|
|
31
|
+
ngAfterViewInit(): void;
|
|
26
32
|
private windowScroll;
|
|
27
33
|
getPath(sectionId: string): string;
|
|
28
34
|
onSectionClick(event: SectionNavigationData): void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Toast types available
|
|
6
|
+
*/
|
|
7
|
+
type ToastType = 'info' | 'success' | 'warning' | 'error';
|
|
8
|
+
/**
|
|
9
|
+
* Toast position types
|
|
10
|
+
*/
|
|
11
|
+
type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
12
|
+
/**
|
|
13
|
+
* Toast configuration interface
|
|
14
|
+
*/
|
|
15
|
+
interface ToastConfig {
|
|
16
|
+
type?: ToastType;
|
|
17
|
+
position?: ToastPosition;
|
|
18
|
+
icon?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
closeButton?: boolean;
|
|
21
|
+
loader?: boolean;
|
|
22
|
+
autoCloseDelay?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class CuraToastComponent implements OnInit, OnDestroy {
|
|
26
|
+
private curaApi;
|
|
27
|
+
private elementRef;
|
|
28
|
+
private intervalId?;
|
|
29
|
+
/**
|
|
30
|
+
* Toast type: info (default) | success | warning | error
|
|
31
|
+
*/
|
|
32
|
+
type: _angular_core.InputSignal<ToastType>;
|
|
33
|
+
/**
|
|
34
|
+
* Toast position on screen
|
|
35
|
+
*/
|
|
36
|
+
position: _angular_core.InputSignal<ToastPosition>;
|
|
37
|
+
/**
|
|
38
|
+
* Custom icon name
|
|
39
|
+
*/
|
|
40
|
+
icon: _angular_core.InputSignal<string>;
|
|
41
|
+
/**
|
|
42
|
+
* Toast label/title
|
|
43
|
+
*/
|
|
44
|
+
label: _angular_core.InputSignal<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Show close button. Default: true
|
|
47
|
+
*/
|
|
48
|
+
closeButton: _angular_core.InputSignal<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Show loader bar. Default: true
|
|
51
|
+
*/
|
|
52
|
+
loader: _angular_core.InputSignal<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Auto close delay in milliseconds. Default: 10000ms (10s)
|
|
55
|
+
*/
|
|
56
|
+
autoCloseDelay: _angular_core.InputSignal<number>;
|
|
57
|
+
/**
|
|
58
|
+
* Close event emitter
|
|
59
|
+
*/
|
|
60
|
+
toastClosed: _angular_core.OutputEmitterRef<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Progress state for loader animation
|
|
63
|
+
*/
|
|
64
|
+
progress: _angular_core.WritableSignal<number>;
|
|
65
|
+
/**
|
|
66
|
+
* Active state for animation
|
|
67
|
+
*/
|
|
68
|
+
isActive: _angular_core.WritableSignal<boolean>;
|
|
69
|
+
constructor();
|
|
70
|
+
toastStyles: _angular_core.Signal<{
|
|
71
|
+
[key: string]: string;
|
|
72
|
+
}>;
|
|
73
|
+
containerClasses: _angular_core.Signal<{
|
|
74
|
+
[key: string]: boolean;
|
|
75
|
+
}>;
|
|
76
|
+
iconName: _angular_core.Signal<string>;
|
|
77
|
+
ngOnInit(): void;
|
|
78
|
+
ngOnDestroy(): void;
|
|
79
|
+
/**
|
|
80
|
+
* Opens the toast container with animation
|
|
81
|
+
*/
|
|
82
|
+
openContainer(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Closes the toast container with animation
|
|
85
|
+
*/
|
|
86
|
+
closeContainer(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Public method to close toast
|
|
89
|
+
*/
|
|
90
|
+
close(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Handle close button click
|
|
93
|
+
*/
|
|
94
|
+
handleClose(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Starts the auto-close animation
|
|
97
|
+
*/
|
|
98
|
+
private startAnimation;
|
|
99
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CuraToastComponent, never>;
|
|
100
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CuraToastComponent, "cura-toast", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "closeButton": { "alias": "closeButton"; "required": false; "isSignal": true; }; "loader": { "alias": "loader"; "required": false; "isSignal": true; }; "autoCloseDelay": { "alias": "autoCloseDelay"; "required": false; "isSignal": true; }; }, { "toastClosed": "toastClosed"; }, never, ["*", "[slot=actions]"], true, never>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export { CuraToastComponent };
|
|
104
|
+
export type { ToastConfig, ToastPosition, ToastType };
|
|
@@ -12,6 +12,7 @@ class FilterLetterAndTermsComponent {
|
|
|
12
12
|
this.baseUrl = input('', ...(ngDevMode ? [{ debugName: "baseUrl" }] : []));
|
|
13
13
|
this.baseUrlAll = input('', ...(ngDevMode ? [{ debugName: "baseUrlAll" }] : []));
|
|
14
14
|
this.enableScroll = input(false, ...(ngDevMode ? [{ debugName: "enableScroll" }] : []));
|
|
15
|
+
this.buttonMode = input(false, ...(ngDevMode ? [{ debugName: "buttonMode" }] : []));
|
|
15
16
|
this.isFirstScroll = true;
|
|
16
17
|
this._selectedOption = '';
|
|
17
18
|
this.optionSelected = output();
|
|
@@ -71,12 +72,12 @@ class FilterLetterAndTermsComponent {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FilterLetterAndTermsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FilterLetterAndTermsComponent, isStandalone: true, selector: "rdsite-filter-letter-and-terms", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, baseUrl: { classPropertyName: "baseUrl", publicName: "baseUrl", isSignal: true, isRequired: false, transformFunction: null }, baseUrlAll: { classPropertyName: "baseUrlAll", publicName: "baseUrlAll", isSignal: true, isRequired: false, transformFunction: null }, enableScroll: { classPropertyName: "enableScroll", publicName: "enableScroll", isSignal: true, isRequired: false, transformFunction: null }, selectedOption: { classPropertyName: "selectedOption", publicName: "selectedOption", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected" }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "<div class=\"filter-letter-and-terms\">\
|
|
75
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: FilterLetterAndTermsComponent, isStandalone: true, selector: "rdsite-filter-letter-and-terms", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, baseUrl: { classPropertyName: "baseUrl", publicName: "baseUrl", isSignal: true, isRequired: false, transformFunction: null }, baseUrlAll: { classPropertyName: "baseUrlAll", publicName: "baseUrlAll", isSignal: true, isRequired: false, transformFunction: null }, enableScroll: { classPropertyName: "enableScroll", publicName: "enableScroll", isSignal: true, isRequired: false, transformFunction: null }, buttonMode: { classPropertyName: "buttonMode", publicName: "buttonMode", isSignal: true, isRequired: false, transformFunction: null }, selectedOption: { classPropertyName: "selectedOption", publicName: "selectedOption", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { optionSelected: "optionSelected" }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "<div class=\"filter-letter-and-terms\">\n <a\n id=\"todas\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === ''\"\n [href]=\"baseUrlAll() ? baseUrlAll() : baseUrl() ? baseUrl() : '#'\"\n (click)=\"selectOption('', $event)\"\n >\n TODAS\n </a>\n\n @if (options.length > 1) {\n @for (option of options(); track option) {\n @if (!buttonMode()) {\n <a\n [id]=\"option\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === option\"\n [href]=\"baseUrl() ? baseUrl() + option.toLowerCase() : '#'\"\n (click)=\"selectOption(option, $event)\"\n >\n {{ option }}\n </a>\n } @else {\n <button type=\"button\" [id]=\"option\" class=\"filter-option\" [class.selected]=\"selectedOption === option\" (click)=\"selectOption(option, $event)\">\n {{ option }}\n </button>\n }\n }\n }\n</div>\n", styles: [".filter-letter-and-terms{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:12px;width:100vw;margin-inline:-5vw;padding-inline:5vw;padding-block:12px;overflow-x:scroll}@media (hover: none) and (pointer: coarse){.filter-letter-and-terms .filter-option:hover:not(.selected){background-color:var(--neutral-pale)}.filter-letter-and-terms .filter-option.selected{background-color:var(--color-one-base)}.filter-letter-and-terms .filter-option:active:not(.selected){background-color:var(--neutral-pale)}}@media only screen and (min-width: 992px){.filter-letter-and-terms{flex-wrap:wrap;width:100%;padding:12px 0;margin:0;overflow-x:auto}}.filter-letter-and-terms .filter-option{flex:0 0 28px;display:flex;justify-content:center;align-items:center;padding:6px;color:var(--neutral-dark);font-family:var(--font-family);font-size:12px;font-weight:500;border-radius:4px;background-color:var(--neutral-pale);border:1px solid var(--neutral-light);cursor:pointer}.filter-letter-and-terms .filter-option:hover{color:var(--neutral-purewhite);background-color:var(--color-one-dark)}.filter-letter-and-terms .filter-option.selected{color:var(--neutral-purewhite);background-color:var(--color-one-base)}.filter-letter-and-terms .filter-option.selected:not(.selected){background-color:var(--neutral-pale);border-color:var(--neutral-light)}.filter-letter-and-terms .filter-option.selected:focus{outline:2px solid var(--color-one-light)}\n"] }); }
|
|
75
76
|
}
|
|
76
77
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FilterLetterAndTermsComponent, decorators: [{
|
|
77
78
|
type: Component,
|
|
78
|
-
args: [{ selector: 'rdsite-filter-letter-and-terms', imports: [], template: "<div class=\"filter-letter-and-terms\">\
|
|
79
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], baseUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseUrl", required: false }] }], baseUrlAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseUrlAll", required: false }] }], enableScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableScroll", required: false }] }], selectedOption: [{
|
|
79
|
+
args: [{ selector: 'rdsite-filter-letter-and-terms', imports: [], template: "<div class=\"filter-letter-and-terms\">\n <a\n id=\"todas\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === ''\"\n [href]=\"baseUrlAll() ? baseUrlAll() : baseUrl() ? baseUrl() : '#'\"\n (click)=\"selectOption('', $event)\"\n >\n TODAS\n </a>\n\n @if (options.length > 1) {\n @for (option of options(); track option) {\n @if (!buttonMode()) {\n <a\n [id]=\"option\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === option\"\n [href]=\"baseUrl() ? baseUrl() + option.toLowerCase() : '#'\"\n (click)=\"selectOption(option, $event)\"\n >\n {{ option }}\n </a>\n } @else {\n <button type=\"button\" [id]=\"option\" class=\"filter-option\" [class.selected]=\"selectedOption === option\" (click)=\"selectOption(option, $event)\">\n {{ option }}\n </button>\n }\n }\n }\n</div>\n", styles: [".filter-letter-and-terms{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:12px;width:100vw;margin-inline:-5vw;padding-inline:5vw;padding-block:12px;overflow-x:scroll}@media (hover: none) and (pointer: coarse){.filter-letter-and-terms .filter-option:hover:not(.selected){background-color:var(--neutral-pale)}.filter-letter-and-terms .filter-option.selected{background-color:var(--color-one-base)}.filter-letter-and-terms .filter-option:active:not(.selected){background-color:var(--neutral-pale)}}@media only screen and (min-width: 992px){.filter-letter-and-terms{flex-wrap:wrap;width:100%;padding:12px 0;margin:0;overflow-x:auto}}.filter-letter-and-terms .filter-option{flex:0 0 28px;display:flex;justify-content:center;align-items:center;padding:6px;color:var(--neutral-dark);font-family:var(--font-family);font-size:12px;font-weight:500;border-radius:4px;background-color:var(--neutral-pale);border:1px solid var(--neutral-light);cursor:pointer}.filter-letter-and-terms .filter-option:hover{color:var(--neutral-purewhite);background-color:var(--color-one-dark)}.filter-letter-and-terms .filter-option.selected{color:var(--neutral-purewhite);background-color:var(--color-one-base)}.filter-letter-and-terms .filter-option.selected:not(.selected){background-color:var(--neutral-pale);border-color:var(--neutral-light)}.filter-letter-and-terms .filter-option.selected:focus{outline:2px solid var(--color-one-light)}\n"] }]
|
|
80
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], baseUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseUrl", required: false }] }], baseUrlAll: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseUrlAll", required: false }] }], enableScroll: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableScroll", required: false }] }], buttonMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonMode", required: false }] }], selectedOption: [{
|
|
80
81
|
type: Input
|
|
81
82
|
}], optionSelected: [{ type: i0.Output, args: ["optionSelected"] }], style: [{
|
|
82
83
|
type: HostBinding,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-filter-letter-and-terms.mjs","sources":["../../../projects/site-front-end-lib/components/filter-letter-and-terms/filter-letter-and-terms.component.ts","../../../projects/site-front-end-lib/components/filter-letter-and-terms/filter-letter-and-terms.component.html","../../../projects/site-front-end-lib/components/filter-letter-and-terms/rededor-site-front-end-lib-components-filter-letter-and-terms.ts"],"sourcesContent":["import { AfterViewInit, Component, HostBinding, Input, PLATFORM_ID, DOCUMENT, input, output, inject } from '@angular/core';\
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-filter-letter-and-terms.mjs","sources":["../../../projects/site-front-end-lib/components/filter-letter-and-terms/filter-letter-and-terms.component.ts","../../../projects/site-front-end-lib/components/filter-letter-and-terms/filter-letter-and-terms.component.html","../../../projects/site-front-end-lib/components/filter-letter-and-terms/rededor-site-front-end-lib-components-filter-letter-and-terms.ts"],"sourcesContent":["import { AfterViewInit, Component, HostBinding, Input, PLATFORM_ID, DOCUMENT, input, output, inject } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\n\n@Component({\n selector: 'rdsite-filter-letter-and-terms',\n imports: [],\n templateUrl: './filter-letter-and-terms.component.html',\n styleUrl: './filter-letter-and-terms.component.scss',\n})\nexport class FilterLetterAndTermsComponent implements AfterViewInit {\n private readonly curaApiService = inject(CuraApiService);\n private document = inject<Document>(DOCUMENT);\n private readonly platformId = inject(PLATFORM_ID);\n\n readonly options = input<string[]>([]);\n readonly baseUrl = input<string>('');\n readonly baseUrlAll = input<string>('');\n readonly enableScroll = input(false);\n readonly buttonMode = input(false);\n private isFirstScroll = true;\n private _selectedOption: string = '';\n\n @Input()\n set selectedOption(value: string) {\n if (this._selectedOption === value) return;\n this._selectedOption = value;\n if (this.enableScroll() && !this.isFirstScroll) {\n this.scrollToSelectedOption(value);\n }\n }\n\n get selectedOption(): string {\n return this._selectedOption;\n }\n\n readonly optionSelected = output<string>();\n\n @HostBinding('style') get style() {\n return {\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\n '--neutral-pale': this.curaApiService.theme.colors.getColor('neutral-pale'),\n '--neutral-light': this.curaApiService.theme.colors.getColor('neutral-light'),\n '--neutral-dark': this.curaApiService.theme.colors.getColor('neutral-dark'),\n '--neutral-black': this.curaApiService.theme.colors.getColor('neutral-black'),\n '--color-one-light': this.curaApiService.theme.colors.getColor('primary-light'),\n '--color-one-base': this.curaApiService.theme.colors.getColor('primary-base'),\n '--color-one-dark': this.curaApiService.theme.colors.getColor('primary-dark'),\n '--color-one-darker': this.curaApiService.theme.colors.getColor('primary-darker'),\n };\n }\n\n ngAfterViewInit() {\n if (this.selectedOption) {\n setTimeout(() => {\n this.scrollToSelectedOption(this.selectedOption);\n this.isFirstScroll = false;\n }, 100);\n }\n }\n\n selectOption(option: string, event: Event): void {\n event.preventDefault();\n if (this._selectedOption !== option) {\n this._selectedOption = option;\n this.optionSelected.emit(option);\n this.scrollToSelectedOption(option);\n }\n }\n\n scrollToSelectedOption(value: string) {\n if (isPlatformBrowser(this.platformId)) {\n const elementId = value || 'todas';\n const selectedElement = elementId === 'todas' ? this.document.getElementById('todas') : this.document.getElementById(value);\n if (selectedElement) {\n selectedElement.scrollIntoView({\n behavior: 'smooth',\n inline: 'center',\n block: 'nearest',\n });\n }\n }\n }\n}\n","<div class=\"filter-letter-and-terms\">\n <a\n id=\"todas\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === ''\"\n [href]=\"baseUrlAll() ? baseUrlAll() : baseUrl() ? baseUrl() : '#'\"\n (click)=\"selectOption('', $event)\"\n >\n TODAS\n </a>\n\n @if (options.length > 1) {\n @for (option of options(); track option) {\n @if (!buttonMode()) {\n <a\n [id]=\"option\"\n rdsitelink\n class=\"filter-option\"\n [class.selected]=\"selectedOption === option\"\n [href]=\"baseUrl() ? baseUrl() + option.toLowerCase() : '#'\"\n (click)=\"selectOption(option, $event)\"\n >\n {{ option }}\n </a>\n } @else {\n <button type=\"button\" [id]=\"option\" class=\"filter-option\" [class.selected]=\"selectedOption === option\" (click)=\"selectOption(option, $event)\">\n {{ option }}\n </button>\n }\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,6BAA6B,CAAA;AAN1C,IAAA,WAAA,GAAA;AAOmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAChD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAW,QAAQ,CAAC;AAC5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAExC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAW,EAAE,mDAAC;AAC7B,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAS,EAAE,mDAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAS,EAAE,sDAAC;AAC9B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK,wDAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,sDAAC;QAC1B,IAAA,CAAA,aAAa,GAAG,IAAI;QACpB,IAAA,CAAA,eAAe,GAAW,EAAE;QAe3B,IAAA,CAAA,cAAc,GAAG,MAAM,EAAU;AAgD3C,IAAA;IA7DC,IACI,cAAc,CAAC,KAAa,EAAA;AAC9B,QAAA,IAAI,IAAI,CAAC,eAAe,KAAK,KAAK;YAAE;AACpC,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK;QAC5B,IAAI,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;AAC9C,YAAA,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC;QACpC;IACF;AAEA,IAAA,IAAI,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,eAAe;IAC7B;AAIA,IAAA,IAA0B,KAAK,GAAA;QAC7B,OAAO;AACL,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ACjC,EAAE,EAAA,QAAA,EAAA,49BAAA,EAAA,MAAA,EAAA,CAAA,u6CAAA,CAAA,EAAA;;sBAiBV;;sBAeA,WAAW;uBAAC,OAAO;;;AEtCtB;;AAEG;;;;"}
|
|
@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
|
|
6
6
|
import { BreadcrumbsComponent } from '@rededor/site-front-end-lib/components/breadcrumbs';
|
|
7
7
|
import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
|
|
8
|
+
import { ImageComponent } from '@rededor/site-front-end-lib/components/image';
|
|
8
9
|
|
|
9
10
|
class PageHeaderComponent {
|
|
10
11
|
constructor() {
|
|
@@ -14,6 +15,10 @@ class PageHeaderComponent {
|
|
|
14
15
|
this.hasPadding = input(false, ...(ngDevMode ? [{ debugName: "hasPadding" }] : []));
|
|
15
16
|
this.breadcrumbs = input([], ...(ngDevMode ? [{ debugName: "breadcrumbs" }] : []));
|
|
16
17
|
this.bgColor = input('primary-base', ...(ngDevMode ? [{ debugName: "bgColor" }] : []));
|
|
18
|
+
this.imgUrl = input('', ...(ngDevMode ? [{ debugName: "imgUrl" }] : []));
|
|
19
|
+
this.imgMimeType = input('', ...(ngDevMode ? [{ debugName: "imgMimeType" }] : []));
|
|
20
|
+
this.imgAlt = input('Imagem do header', ...(ngDevMode ? [{ debugName: "imgAlt" }] : []));
|
|
21
|
+
this.imgTitle = input('Imagem do header', ...(ngDevMode ? [{ debugName: "imgTitle" }] : []));
|
|
17
22
|
}
|
|
18
23
|
get style() {
|
|
19
24
|
return {
|
|
@@ -23,12 +28,12 @@ class PageHeaderComponent {
|
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PageHeaderComponent, isStandalone: true, selector: "rdsite-page-header", inputs: { pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, pageHeaderText: { classPropertyName: "pageHeaderText", publicName: "pageHeaderText", isSignal: true, isRequired: false, transformFunction: null }, hasPadding: { classPropertyName: "hasPadding", publicName: "hasPadding", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbs: { classPropertyName: "breadcrumbs", publicName: "breadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-
|
|
31
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: PageHeaderComponent, isStandalone: true, selector: "rdsite-page-header", inputs: { pageTitle: { classPropertyName: "pageTitle", publicName: "pageTitle", isSignal: true, isRequired: false, transformFunction: null }, pageHeaderText: { classPropertyName: "pageHeaderText", publicName: "pageHeaderText", isSignal: true, isRequired: false, transformFunction: null }, hasPadding: { classPropertyName: "hasPadding", publicName: "hasPadding", isSignal: true, isRequired: false, transformFunction: null }, breadcrumbs: { classPropertyName: "breadcrumbs", publicName: "breadcrumbs", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, imgUrl: { classPropertyName: "imgUrl", publicName: "imgUrl", isSignal: true, isRequired: false, transformFunction: null }, imgMimeType: { classPropertyName: "imgMimeType", publicName: "imgMimeType", isSignal: true, isRequired: false, transformFunction: null }, imgAlt: { classPropertyName: "imgAlt", publicName: "imgAlt", isSignal: true, isRequired: false, transformFunction: null }, imgTitle: { classPropertyName: "imgTitle", publicName: "imgTitle", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-container\">\r\n @if (breadcrumbs().length) {\r\n <rdsite-breadcrumbs [breadcrumbs]=\"breadcrumbs()\"></rdsite-breadcrumbs>\r\n }\r\n <div class=\"page-header-content\">\r\n @if (imgUrl()) {\r\n <rdsite-image\r\n [imageDefaultSrc]=\"imgUrl()\"\r\n [mimeType]=\"imgMimeType()\"\r\n [alt]=\"imgAlt()\"\r\n [title]=\"imgTitle()\"\r\n loading=\"eager\"\r\n ></rdsite-image>\r\n }\r\n\r\n <div class=\"page-header-content-info\">\r\n @if (pageTitle()) {\r\n <h1>{{ pageTitle() }}</h1>\r\n }\r\n @if (pageHeaderText()) {\r\n <cura-paragraph color=\"neutral-purewhite\" marginBlock=\"0\">{{ pageHeaderText() }}</cura-paragraph>\r\n }\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".page-header{background-color:var(--bg-color)}.page-header-container{display:flex;flex-direction:column;gap:16px;padding:30px 0;box-sizing:border-box;width:90%;position:relative;max-width:1366px;margin-left:auto;margin-right:auto}.page-header-container.full-container{width:100%;max-width:100%}.page-header-container .page-header-content{display:flex;flex-direction:column;align-items:center;gap:16px}.page-header-container .page-header-content rdsite-image{width:120px;height:120px;border-radius:50%;margin-top:16px}.page-header-container .page-header-content-info{display:flex;flex-direction:column;align-items:center;gap:12px}.page-header-container .page-header-content-info h1{color:var(--neutral-purewhite);font-family:var(--font-family);font-size:32px;font-weight:700;line-height:--fonts-Display-S-lineHeight,43px;letter-spacing:-1.68px}@media screen and (min-width: 769px){.page-header-container .page-header-content-info h1{font-size:48px;line-height:57px;letter-spacing:-1.92px}}@media screen and (min-width: 769px){.page-header .page-header-container{gap:12px;padding:50px 0}.page-header .page-header-container .page-header-content{flex-direction:row;align-items:flex-start;gap:40px}.page-header .page-header-container .page-header-content rdsite-image{margin-top:0}.page-header .page-header-container .page-header-content-info{align-items:flex-start}.page-header.more-padding{padding-inline:102px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: BreadcrumbsComponent, selector: "rdsite-breadcrumbs", inputs: ["labelIconColor", "fontWeight", "breadcrumbs"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: ImageComponent, selector: "rdsite-image", inputs: ["imageWebpSrc", "imageDefaultSrc", "imageSizes", "mimeType", "alt", "title", "loading"], outputs: ["imageDefaultSrcChange", "mimeTypeChange"] }] }); }
|
|
27
32
|
}
|
|
28
33
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: PageHeaderComponent, decorators: [{
|
|
29
34
|
type: Component,
|
|
30
|
-
args: [{ selector: 'rdsite-page-header', imports: [CommonModule, BreadcrumbsComponent, CuraParagraphComponent], template: "<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-
|
|
31
|
-
}], propDecorators: { pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], pageHeaderText: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageHeaderText", required: false }] }], hasPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasPadding", required: false }] }], breadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumbs", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], style: [{
|
|
35
|
+
args: [{ selector: 'rdsite-page-header', imports: [CommonModule, BreadcrumbsComponent, CuraParagraphComponent, ImageComponent], template: "<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-container\">\r\n @if (breadcrumbs().length) {\r\n <rdsite-breadcrumbs [breadcrumbs]=\"breadcrumbs()\"></rdsite-breadcrumbs>\r\n }\r\n <div class=\"page-header-content\">\r\n @if (imgUrl()) {\r\n <rdsite-image\r\n [imageDefaultSrc]=\"imgUrl()\"\r\n [mimeType]=\"imgMimeType()\"\r\n [alt]=\"imgAlt()\"\r\n [title]=\"imgTitle()\"\r\n loading=\"eager\"\r\n ></rdsite-image>\r\n }\r\n\r\n <div class=\"page-header-content-info\">\r\n @if (pageTitle()) {\r\n <h1>{{ pageTitle() }}</h1>\r\n }\r\n @if (pageHeaderText()) {\r\n <cura-paragraph color=\"neutral-purewhite\" marginBlock=\"0\">{{ pageHeaderText() }}</cura-paragraph>\r\n }\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".page-header{background-color:var(--bg-color)}.page-header-container{display:flex;flex-direction:column;gap:16px;padding:30px 0;box-sizing:border-box;width:90%;position:relative;max-width:1366px;margin-left:auto;margin-right:auto}.page-header-container.full-container{width:100%;max-width:100%}.page-header-container .page-header-content{display:flex;flex-direction:column;align-items:center;gap:16px}.page-header-container .page-header-content rdsite-image{width:120px;height:120px;border-radius:50%;margin-top:16px}.page-header-container .page-header-content-info{display:flex;flex-direction:column;align-items:center;gap:12px}.page-header-container .page-header-content-info h1{color:var(--neutral-purewhite);font-family:var(--font-family);font-size:32px;font-weight:700;line-height:--fonts-Display-S-lineHeight,43px;letter-spacing:-1.68px}@media screen and (min-width: 769px){.page-header-container .page-header-content-info h1{font-size:48px;line-height:57px;letter-spacing:-1.92px}}@media screen and (min-width: 769px){.page-header .page-header-container{gap:12px;padding:50px 0}.page-header .page-header-container .page-header-content{flex-direction:row;align-items:flex-start;gap:40px}.page-header .page-header-container .page-header-content rdsite-image{margin-top:0}.page-header .page-header-container .page-header-content-info{align-items:flex-start}.page-header.more-padding{padding-inline:102px}}\n"] }]
|
|
36
|
+
}], propDecorators: { pageTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageTitle", required: false }] }], pageHeaderText: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageHeaderText", required: false }] }], hasPadding: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasPadding", required: false }] }], breadcrumbs: [{ type: i0.Input, args: [{ isSignal: true, alias: "breadcrumbs", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], imgUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imgUrl", required: false }] }], imgMimeType: [{ type: i0.Input, args: [{ isSignal: true, alias: "imgMimeType", required: false }] }], imgAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "imgAlt", required: false }] }], imgTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "imgTitle", required: false }] }], style: [{
|
|
32
37
|
type: HostBinding,
|
|
33
38
|
args: ['style']
|
|
34
39
|
}] } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-page-header.mjs","sources":["../../../projects/site-front-end-lib/components/page-header/page-header.component.ts","../../../projects/site-front-end-lib/components/page-header/page-header.component.html","../../../projects/site-front-end-lib/components/page-header/rededor-site-front-end-lib-components-page-header.ts"],"sourcesContent":["import { Component, HostBinding, input, inject } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { BreadcrumbsItems } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { BreadcrumbsComponent } from '@rededor/site-front-end-lib/components/breadcrumbs';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\n\r\n@Component({\r\n selector: 'rdsite-page-header',\r\n imports: [CommonModule, BreadcrumbsComponent, CuraParagraphComponent],\r\n templateUrl: './page-header.component.html',\r\n styleUrls: ['./page-header.component.scss'],\r\n})\r\nexport class PageHeaderComponent {\r\n private readonly curaApiService = inject(CuraApiService);\r\n\r\n readonly pageTitle = input<string>('');\r\n readonly pageHeaderText = input<string>('');\r\n readonly hasPadding = input<boolean>(false);\r\n readonly breadcrumbs = input<BreadcrumbsItems[]>([]);\r\n readonly bgColor = input('primary-base');\r\n\r\n @HostBinding('style') get style() {\r\n return {\r\n '--bg-color': this.curaApiService.theme.colors.getColor(this.bgColor()),\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n }\r\n}\r\n","<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-page-header.mjs","sources":["../../../projects/site-front-end-lib/components/page-header/page-header.component.ts","../../../projects/site-front-end-lib/components/page-header/page-header.component.html","../../../projects/site-front-end-lib/components/page-header/rededor-site-front-end-lib-components-page-header.ts"],"sourcesContent":["import { Component, HostBinding, input, inject } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { BreadcrumbsItems } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { BreadcrumbsComponent } from '@rededor/site-front-end-lib/components/breadcrumbs';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\nimport { ImageComponent } from '@rededor/site-front-end-lib/components/image';\r\n\r\n@Component({\r\n selector: 'rdsite-page-header',\r\n imports: [CommonModule, BreadcrumbsComponent, CuraParagraphComponent, ImageComponent],\r\n templateUrl: './page-header.component.html',\r\n styleUrls: ['./page-header.component.scss'],\r\n})\r\nexport class PageHeaderComponent {\r\n private readonly curaApiService = inject(CuraApiService);\r\n\r\n readonly pageTitle = input<string>('');\r\n readonly pageHeaderText = input<string>('');\r\n readonly hasPadding = input<boolean>(false);\r\n readonly breadcrumbs = input<BreadcrumbsItems[]>([]);\r\n readonly bgColor = input('primary-base');\r\n readonly imgUrl = input<string>('');\r\n readonly imgMimeType = input<any>('');\r\n readonly imgAlt = input<string>('Imagem do header');\r\n readonly imgTitle = input<string>('Imagem do header');\r\n\r\n @HostBinding('style') get style() {\r\n return {\r\n '--bg-color': this.curaApiService.theme.colors.getColor(this.bgColor()),\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n }\r\n}\r\n","<div class=\"page-header\" [ngClass]=\"{ 'more-padding': hasPadding() }\">\r\n <div class=\"page-header-container\">\r\n @if (breadcrumbs().length) {\r\n <rdsite-breadcrumbs [breadcrumbs]=\"breadcrumbs()\"></rdsite-breadcrumbs>\r\n }\r\n <div class=\"page-header-content\">\r\n @if (imgUrl()) {\r\n <rdsite-image\r\n [imageDefaultSrc]=\"imgUrl()\"\r\n [mimeType]=\"imgMimeType()\"\r\n [alt]=\"imgAlt()\"\r\n [title]=\"imgTitle()\"\r\n loading=\"eager\"\r\n ></rdsite-image>\r\n }\r\n\r\n <div class=\"page-header-content-info\">\r\n @if (pageTitle()) {\r\n <h1>{{ pageTitle() }}</h1>\r\n }\r\n @if (pageHeaderText()) {\r\n <cura-paragraph color=\"neutral-purewhite\" marginBlock=\"0\">{{ pageHeaderText() }}</cura-paragraph>\r\n }\r\n <ng-content></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAca,mBAAmB,CAAA;AANhC,IAAA,WAAA,GAAA;AAOmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAE/C,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK,CAAS,EAAE,qDAAC;AAC7B,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAS,EAAE,0DAAC;AAClC,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAU,KAAK,sDAAC;AAClC,QAAA,IAAA,CA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AAA,UAAA,EAAA,IAAA,EDlBY,YAAY,6HAAE,oBAAoB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,gBAAA,EAAA,YAAA,EAAA,aAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,sBAAsB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,WAAA,EAAA,OAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,cAAc,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,cAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,KAAA,EAAA,OAAA,EAAA,SAAA,CAAA,EAAA,OAAA,EAAA,CAAA,uBAAA,EAAA,gBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAIzE,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;+BACE,oBAAoB,EAAA,OAAA,EACrB,CAAC,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,CAAC,EAAA,QAAA,EAAA,g8BAAA,EAAA,MAAA,EAAA,CAAA,q4CAAA,CAAA,EAAA;;sBAiBpF,WAAW;uBAAC,OAAO;;;AE3BtB;;AAEG;;;;"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, input, viewChildren, output, HostBinding, HostListener, Input, Component } from '@angular/core';
|
|
2
|
+
import { inject, PLATFORM_ID, DOCUMENT, signal, input, viewChildren, output, HostBinding, HostListener, Input, Component } from '@angular/core';
|
|
3
3
|
import { RdsiteLinkDirective } from '@rededor/site-front-end-lib/core';
|
|
4
4
|
import { CuraCardComponent } from '@rededor/site-front-end-lib/cura/cards/cura-card';
|
|
5
5
|
import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
|
|
6
6
|
import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
|
|
7
7
|
import { Router } from '@angular/router';
|
|
8
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
8
9
|
|
|
9
10
|
class SidebarNavigationComponent {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.curaApiService = inject(CuraApiService);
|
|
12
13
|
this.router = inject(Router);
|
|
14
|
+
this.platformId = inject(PLATFORM_ID);
|
|
15
|
+
this.document = inject(DOCUMENT);
|
|
13
16
|
this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
|
|
14
17
|
this.config = signal(undefined, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
15
18
|
this.activeSection = signal('', ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
|
|
16
19
|
this.selectedIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
20
|
+
this.defaultAnchorAdjustment = signal(0, ...(ngDevMode ? [{ debugName: "defaultAnchorAdjustment" }] : []));
|
|
21
|
+
this.menuHeaderHeight = 0;
|
|
17
22
|
this.anchorAdjustment = input(0, ...(ngDevMode ? [{ debugName: "anchorAdjustment" }] : []));
|
|
18
23
|
this.title = input('Nesta página', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
19
24
|
this.ariaLabel = input('Navegação da página', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -39,15 +44,22 @@ class SidebarNavigationComponent {
|
|
|
39
44
|
onWindowScroll() {
|
|
40
45
|
this.windowScroll();
|
|
41
46
|
}
|
|
47
|
+
ngAfterViewInit() {
|
|
48
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
49
|
+
setTimeout(() => {
|
|
50
|
+
this.menuHeaderHeight = this.document.querySelector('header[sl-hdr]')?.offsetHeight || 0;
|
|
51
|
+
this.defaultAnchorAdjustment.set(this.menuHeaderHeight + (this.padding() - 1));
|
|
52
|
+
}, 200);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
42
55
|
windowScroll() {
|
|
43
|
-
const pageHeaderHeight = document.querySelector('.page-header')?.offsetHeight || 0;
|
|
44
56
|
this.selectedIndex.set(-1);
|
|
45
57
|
this.sections()?.forEach((section, index) => {
|
|
46
58
|
const element = document.querySelector(`#${section.id}`);
|
|
47
59
|
if (!element)
|
|
48
60
|
return;
|
|
49
61
|
const elementTop = element.getBoundingClientRect().top + window.scrollY;
|
|
50
|
-
const currentScroll = window.scrollY +
|
|
62
|
+
const currentScroll = window.scrollY + this.menuHeaderHeight + this.padding();
|
|
51
63
|
if (currentScroll >= elementTop) {
|
|
52
64
|
this.selectedIndex.set(index);
|
|
53
65
|
if (this.sections()?.[this.selectedIndex()]) {
|
|
@@ -63,11 +75,11 @@ class SidebarNavigationComponent {
|
|
|
63
75
|
this.sectionChange.emit(event);
|
|
64
76
|
}
|
|
65
77
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SidebarNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
66
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SidebarNavigationComponent, isStandalone: true, selector: "nav[rdsite-sidebar-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
78
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SidebarNavigationComponent, isStandalone: true, selector: "nav[rdsite-sidebar-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraCardComponent, selector: "cura-card", inputs: ["hasPadding", "hasShadow", "type", "colorMode", "href", "target"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }] }); }
|
|
67
79
|
}
|
|
68
80
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SidebarNavigationComponent, decorators: [{
|
|
69
81
|
type: Component,
|
|
70
|
-
args: [{ selector: 'nav[rdsite-sidebar-navigation]', imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent], template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
82
|
+
args: [{ selector: 'nav[rdsite-sidebar-navigation]', imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent], template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"] }]
|
|
71
83
|
}], propDecorators: { anchorAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorAdjustment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], navigationSections: [{
|
|
72
84
|
type: Input,
|
|
73
85
|
args: [{ required: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-sidebar-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sidebar-navigation/sidebar-navigation.component.ts","../../../projects/site-front-end-lib/components/sidebar-navigation/sidebar-navigation.component.html","../../../projects/site-front-end-lib/components/sidebar-navigation/rededor-site-front-end-lib-components-sidebar-navigation.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-sidebar-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sidebar-navigation/sidebar-navigation.component.ts","../../../projects/site-front-end-lib/components/sidebar-navigation/sidebar-navigation.component.html","../../../projects/site-front-end-lib/components/sidebar-navigation/rededor-site-front-end-lib-components-sidebar-navigation.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n signal,\n HostListener,\n HostBinding,\n inject,\n input,\n output,\n viewChildren,\n DOCUMENT,\n PLATFORM_ID,\n AfterViewInit,\n} from '@angular/core';\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\nimport { CuraCardComponent } from '@rededor/site-front-end-lib/cura/cards/cura-card';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { Router } from '@angular/router';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-sidebar-navigation]',\n imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent],\n templateUrl: './sidebar-navigation.component.html',\n styleUrl: './sidebar-navigation.component.scss',\n})\nexport class SidebarNavigationComponent implements AfterViewInit {\n private readonly curaApiService = inject(CuraApiService);\n private router = inject(Router);\n private platformId = inject(PLATFORM_ID);\n private document = inject<Document>(DOCUMENT);\n\n readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n public selectedIndex = signal<number>(0);\n public defaultAnchorAdjustment = signal(0);\n\n private menuHeaderHeight = 0;\n\n readonly anchorAdjustment = input(0);\n readonly title = input('Nesta página');\n readonly ariaLabel = input('Navegação da página');\n readonly padding = input(-50);\n\n @Input({ required: true })\n set navigationSections(value: SectionNavigationData[]) {\n if (!value?.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n this.sections.set(value);\n\n if (!this.activeSection()) {\n this.activeSection.set(value[0].id);\n }\n }\n\n @Input()\n set navigationConfig(value: SectionNavigationConfig) {\n this.config.set(value);\n }\n\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\n\n @HostBinding('style') styleBinding = {\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n ngAfterViewInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n setTimeout(() => {\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\n this.defaultAnchorAdjustment.set(this.menuHeaderHeight + (this.padding() - 1));\n }, 200);\n }\n }\n\n private windowScroll(): void {\n this.selectedIndex.set(-1);\n\n this.sections()?.forEach((section, index) => {\n const element = document.querySelector<HTMLElement>(`#${section.id}`);\n if (!element) return;\n\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.padding();\n if (currentScroll >= elementTop) {\n this.selectedIndex.set(index);\n if (this.sections()?.[this.selectedIndex()]) {\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\n }\n }\n });\n }\n\n getPath(sectionId: string): string {\n return `${this.router.url}#${sectionId}`;\n }\n\n onSectionClick(event: SectionNavigationData) {\n this.sectionChange.emit(event);\n }\n}\n","<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAChD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAW,QAAQ,CAAC;AAEpC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAA0B,EAAE,oDAAC;AAC9C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsC,SAAS,kDAAC;AAC/D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,EAAE,yDAAC;AACpC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,yDAAC;AACjC,QAAA,IAAA,CAAA,uB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CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AEzEtB;;AAEG;;;;"}
|
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, signal, input, viewChildren, output, HostBinding, HostListener, Input, Component } from '@angular/core';
|
|
2
|
+
import { inject, PLATFORM_ID, DOCUMENT, signal, input, viewChildren, output, HostBinding, HostListener, Input, Component } from '@angular/core';
|
|
3
3
|
import { RdsiteLinkDirective } from '@rededor/site-front-end-lib/core';
|
|
4
4
|
import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
|
|
5
5
|
import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
|
|
6
6
|
import { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';
|
|
7
7
|
import { Router } from '@angular/router';
|
|
8
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
8
9
|
|
|
9
10
|
class StickyNavigationComponent {
|
|
10
11
|
constructor() {
|
|
11
12
|
this.curaApiService = inject(CuraApiService);
|
|
12
13
|
this.router = inject(Router);
|
|
14
|
+
this.platformId = inject(PLATFORM_ID);
|
|
15
|
+
this.document = inject(DOCUMENT);
|
|
13
16
|
this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
|
|
14
17
|
this.config = signal(undefined, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
15
18
|
this.activeSection = signal('', ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
|
|
16
19
|
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
17
20
|
this.selectedIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
21
|
+
this.defaultAnchorAdjustment = signal(0, ...(ngDevMode ? [{ debugName: "defaultAnchorAdjustment" }] : []));
|
|
22
|
+
this.menuHeaderHeight = 0;
|
|
23
|
+
this.menuStickyClosedHeight = 0;
|
|
18
24
|
this.anchorAdjustment = input(0, ...(ngDevMode ? [{ debugName: "anchorAdjustment" }] : []));
|
|
19
25
|
this.title = input('Nesta página', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
20
26
|
this.ariaLabel = input('Navegação da página', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
@@ -41,15 +47,21 @@ class StickyNavigationComponent {
|
|
|
41
47
|
onWindowScroll() {
|
|
42
48
|
this.windowScroll();
|
|
43
49
|
}
|
|
50
|
+
ngAfterViewInit() {
|
|
51
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
52
|
+
setTimeout(() => {
|
|
53
|
+
this.menuHeaderHeight = this.document.querySelector('header[sl-hdr]')?.offsetHeight || 0;
|
|
54
|
+
this.menuStickyClosedHeight = this.document.querySelector('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;
|
|
55
|
+
}, 200);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
44
58
|
windowScroll() {
|
|
45
|
-
const pageHeaderHeight = document.querySelector('header')?.offsetHeight || 0;
|
|
46
|
-
const stickybarHeight = document.querySelector('.rdsite-sticky-navigation')?.offsetHeight || 0;
|
|
47
59
|
this.sections()?.forEach((section, index) => {
|
|
48
|
-
const element = document.querySelector(`#${section.id}`);
|
|
60
|
+
const element = this.document.querySelector(`#${section.id}`);
|
|
49
61
|
if (!element)
|
|
50
62
|
return;
|
|
51
63
|
const elementTop = element.getBoundingClientRect().top + window.scrollY;
|
|
52
|
-
const currentScroll = window.scrollY +
|
|
64
|
+
const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();
|
|
53
65
|
if (currentScroll >= elementTop) {
|
|
54
66
|
this.selectedIndex.set(index);
|
|
55
67
|
if (this.sections()?.[this.selectedIndex()]) {
|
|
@@ -63,17 +75,24 @@ class StickyNavigationComponent {
|
|
|
63
75
|
}
|
|
64
76
|
onSectionClick(event) {
|
|
65
77
|
this.sectionChange.emit(event);
|
|
66
|
-
this.
|
|
78
|
+
this.isOpen.update((value) => !value);
|
|
67
79
|
}
|
|
68
80
|
toggleOpen() {
|
|
69
81
|
this.isOpen.update((value) => !value);
|
|
82
|
+
if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment) {
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
// Utilizo o timeout para pegar a altura do elemento depois dele aberto
|
|
85
|
+
const menuStickyOpenedHeight = this.document.querySelector('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;
|
|
86
|
+
this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);
|
|
87
|
+
}, 100);
|
|
88
|
+
}
|
|
70
89
|
}
|
|
71
90
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StickyNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: StickyNavigationComponent, isStandalone: true, selector: "nav[rdsite-sticky-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
91
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: StickyNavigationComponent, isStandalone: true, selector: "nav[rdsite-sticky-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }] }); }
|
|
73
92
|
}
|
|
74
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StickyNavigationComponent, decorators: [{
|
|
75
94
|
type: Component,
|
|
76
|
-
args: [{ selector: 'nav[rdsite-sticky-navigation]', imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent], template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
95
|
+
args: [{ selector: 'nav[rdsite-sticky-navigation]', imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent], template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"] }]
|
|
77
96
|
}], propDecorators: { anchorAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorAdjustment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], navigationSections: [{
|
|
78
97
|
type: Input,
|
|
79
98
|
args: [{ required: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-sticky-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import { Component, ElementRef, Input, signal, HostListener, HostBinding, inject, input, output, viewChildren } from '@angular/core';\r\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\r\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-sticky-navigation]',\r\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\r\n templateUrl: './sticky-navigation.component.html',\r\n styleUrl: './sticky-navigation.component.scss',\r\n})\r\nexport class StickyNavigationComponent {\r\n private curaApiService = inject(CuraApiService);\r\n private router = inject(Router);\r\n\r\n public readonly sections = signal<SectionNavigationData[]>([]);\r\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\r\n readonly activeSection = signal<string>('');\r\n readonly isOpen = signal<boolean>(false);\r\n public selectedIndex = signal<number>(0);\r\n\r\n readonly anchorAdjustment = input(0);\r\n readonly title = input('Nesta página');\r\n readonly ariaLabel = input('Navegação da página');\r\n readonly padding = input(20);\r\n\r\n @Input({ required: true })\r\n set navigationSections(value: SectionNavigationData[]) {\r\n if (!value?.length) {\r\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\r\n }\r\n this.sections.set(value);\r\n\r\n if (!this.activeSection()) {\r\n this.activeSection.set(value[0].id);\r\n }\r\n }\r\n\r\n @Input()\r\n set navigationConfig(value: SectionNavigationConfig) {\r\n this.config.set(value);\r\n }\r\n\r\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\r\n readonly sectionChange = output<SectionNavigationData>();\r\n\r\n @HostListener('window:scroll')\r\n onWindowScroll(): void {\r\n this.windowScroll();\r\n }\r\n\r\n @HostBinding('style') styleBinding = {\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n\r\n private windowScroll(): void {\r\n const pageHeaderHeight = document.querySelector<HTMLElement>('header')?.offsetHeight || 0;\r\n const stickybarHeight = document.querySelector<HTMLElement>('.rdsite-sticky-navigation')?.offsetHeight || 0;\r\n\r\n this.sections()?.forEach((section, index) => {\r\n const element = document.querySelector<HTMLElement>(`#${section.id}`);\r\n if (!element) return;\r\n\r\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\r\n const currentScroll = window.scrollY + pageHeaderHeight + stickybarHeight + this.padding();\r\n\r\n if (currentScroll >= elementTop) {\r\n this.selectedIndex.set(index);\r\n if (this.sections()?.[this.selectedIndex()]) {\r\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getPath(sectionId: string): string {\r\n return `${this.router.url}#${sectionId}`;\r\n }\r\n\r\n onSectionClick(event: SectionNavigationData) {\r\n this.sectionChange.emit(event);\r\n this.toggleOpen();\r\n }\r\n\r\n toggleOpen(): void {\r\n this.isOpen.update((value) => !value);\r\n }\r\n}\r\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n @if (title()) {\r\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\r\n <cura-paragraph size=\"small\" [attr.color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" margin-block=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n <cura-icon [attr.name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [attr.color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\r\n </div>\r\n @if (sections().length && !isOpen()) {\r\n <cura-paragraph size=\"xsmall\" margin-block=\"8px\" color=\"neutral-black\">\r\n <b>{{ sections()[selectedIndex()].title }}</b>\r\n </cura-paragraph>\r\n }\r\n }\r\n\r\n @if (isOpen()) {\r\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" margin-block=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sticky-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n rdsitelink\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n [anchorAdjustment]=\"anchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>{{ section.title }}</b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAca,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAEf,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAA0B,EAAE,oDAAC;AACrD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsC,SAAS,kDAAC;AAC/D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,EAAE,yDAAC;AAClC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAU,KAAK,kDAAC;AACjC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,yDAAC;AAE/B,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAC,CAAC,4DAAC;AAC3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,cAAc,iDAAC;AAC7B,QAAA,IAAA,CAAA,SAAS,GAAG,K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/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n signal,\n HostListener,\n HostBinding,\n inject,\n input,\n output,\n viewChildren,\n PLATFORM_ID,\n DOCUMENT,\n AfterViewInit,\n} from '@angular/core';\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\nimport { Router } from '@angular/router';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-sticky-navigation]',\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\n templateUrl: './sticky-navigation.component.html',\n styleUrl: './sticky-navigation.component.scss',\n})\nexport class StickyNavigationComponent implements AfterViewInit {\n private curaApiService = inject(CuraApiService);\n private router = inject(Router);\n private platformId = inject(PLATFORM_ID);\n private document = inject<Document>(DOCUMENT);\n\n public readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n readonly isOpen = signal<boolean>(false);\n public selectedIndex = signal<number>(0);\n public defaultAnchorAdjustment = signal(0);\n\n private menuHeaderHeight = 0;\n private menuStickyClosedHeight = 0;\n\n readonly anchorAdjustment = input(0);\n readonly title = input('Nesta página');\n readonly ariaLabel = input('Navegação da página');\n readonly padding = input(20);\n\n @Input({ required: true })\n set navigationSections(value: SectionNavigationData[]) {\n if (!value?.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n this.sections.set(value);\n\n if (!this.activeSection()) {\n this.activeSection.set(value[0].id);\n }\n }\n\n @Input()\n set navigationConfig(value: SectionNavigationConfig) {\n this.config.set(value);\n }\n\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\n\n @HostBinding('style') styleBinding = {\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n ngAfterViewInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n setTimeout(() => {\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\n this.menuStickyClosedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n }, 200);\n }\n }\n\n private windowScroll(): void {\n this.sections()?.forEach((section, index) => {\n const element = this.document.querySelector<HTMLElement>(`#${section.id}`);\n if (!element) return;\n\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();\n\n if (currentScroll >= elementTop) {\n this.selectedIndex.set(index);\n if (this.sections()?.[this.selectedIndex()]) {\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\n }\n }\n });\n }\n\n getPath(sectionId: string): string {\n return `${this.router.url}#${sectionId}`;\n }\n\n onSectionClick(event: SectionNavigationData) {\n this.sectionChange.emit(event);\n this.isOpen.update((value) => !value);\n }\n\n toggleOpen(): void {\n this.isOpen.update((value) => !value);\n if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment) {\n setTimeout(() => {\n // Utilizo o timeout para pegar a altura do elemento depois dele aberto\n const menuStickyOpenedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);\n }, 100);\n }\n }\n}\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QA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,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AE3EtB;;AAEG;;;;"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, output, signal, computed, effect, Component } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
|
|
6
|
+
import { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';
|
|
7
|
+
import { CuraHeadingComponent } from '@rededor/site-front-end-lib/cura/texts/cura-heading';
|
|
8
|
+
import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
|
|
9
|
+
import { CuraLoaderBarComponent } from '@rededor/site-front-end-lib/cura/loaders/cura-loader-bar';
|
|
10
|
+
|
|
11
|
+
class CuraToastComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.curaApi = inject(CuraApiService);
|
|
14
|
+
this.elementRef = inject(ElementRef);
|
|
15
|
+
/**
|
|
16
|
+
* Toast type: info (default) | success | warning | error
|
|
17
|
+
*/
|
|
18
|
+
this.type = input('info', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
19
|
+
/**
|
|
20
|
+
* Toast position on screen
|
|
21
|
+
*/
|
|
22
|
+
this.position = input('top-right', ...(ngDevMode ? [{ debugName: "position" }] : []));
|
|
23
|
+
/**
|
|
24
|
+
* Custom icon name
|
|
25
|
+
*/
|
|
26
|
+
this.icon = input('', ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
27
|
+
/**
|
|
28
|
+
* Toast label/title
|
|
29
|
+
*/
|
|
30
|
+
this.label = input('', ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
31
|
+
/**
|
|
32
|
+
* Show close button. Default: true
|
|
33
|
+
*/
|
|
34
|
+
this.closeButton = input(true, ...(ngDevMode ? [{ debugName: "closeButton" }] : []));
|
|
35
|
+
/**
|
|
36
|
+
* Show loader bar. Default: true
|
|
37
|
+
*/
|
|
38
|
+
this.loader = input(true, ...(ngDevMode ? [{ debugName: "loader" }] : []));
|
|
39
|
+
/**
|
|
40
|
+
* Auto close delay in milliseconds. Default: 10000ms (10s)
|
|
41
|
+
*/
|
|
42
|
+
this.autoCloseDelay = input(10000, ...(ngDevMode ? [{ debugName: "autoCloseDelay" }] : []));
|
|
43
|
+
/**
|
|
44
|
+
* Close event emitter
|
|
45
|
+
*/
|
|
46
|
+
this.toastClosed = output();
|
|
47
|
+
/**
|
|
48
|
+
* Progress state for loader animation
|
|
49
|
+
*/
|
|
50
|
+
this.progress = signal(0, ...(ngDevMode ? [{ debugName: "progress" }] : []));
|
|
51
|
+
/**
|
|
52
|
+
* Active state for animation
|
|
53
|
+
*/
|
|
54
|
+
this.isActive = signal(false, ...(ngDevMode ? [{ debugName: "isActive" }] : []));
|
|
55
|
+
this.toastStyles = computed(() => {
|
|
56
|
+
if (!this.curaApi)
|
|
57
|
+
return {};
|
|
58
|
+
const colors = [
|
|
59
|
+
{ name: '--neutral-purewhite', theme: 'neutral-purewhite' },
|
|
60
|
+
{ name: '--neutral-base', theme: 'neutral-base', opacity: 0.2 },
|
|
61
|
+
{ name: '--primary-base', theme: 'primary-base' },
|
|
62
|
+
{ name: '--color-base', theme: `${this.type()}-base` },
|
|
63
|
+
];
|
|
64
|
+
const styles = {};
|
|
65
|
+
colors.forEach((color) => {
|
|
66
|
+
if (color.opacity !== undefined) {
|
|
67
|
+
styles[color.name] = this.curaApi.theme.colors.getColor(color.theme, color.opacity);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
styles[color.name] = this.curaApi.theme.colors.getColor(color.theme);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return styles;
|
|
74
|
+
}, ...(ngDevMode ? [{ debugName: "toastStyles" }] : []));
|
|
75
|
+
this.containerClasses = computed(() => {
|
|
76
|
+
const [firstPosition, secondPosition] = this.position().split('-');
|
|
77
|
+
const classes = {
|
|
78
|
+
container: true,
|
|
79
|
+
};
|
|
80
|
+
if (firstPosition)
|
|
81
|
+
classes[firstPosition] = true;
|
|
82
|
+
if (secondPosition)
|
|
83
|
+
classes[secondPosition] = true;
|
|
84
|
+
if (this.loader())
|
|
85
|
+
classes['loader'] = true;
|
|
86
|
+
if (this.isActive())
|
|
87
|
+
classes['active'] = true;
|
|
88
|
+
return classes;
|
|
89
|
+
}, ...(ngDevMode ? [{ debugName: "containerClasses" }] : []));
|
|
90
|
+
this.iconName = computed(() => {
|
|
91
|
+
const iconMapping = {
|
|
92
|
+
info: 'infoCircle',
|
|
93
|
+
success: 'checkCircle',
|
|
94
|
+
warning: 'alertCircle',
|
|
95
|
+
error: 'alertTriangle',
|
|
96
|
+
};
|
|
97
|
+
return this.icon() || iconMapping[this.type()];
|
|
98
|
+
}, ...(ngDevMode ? [{ debugName: "iconName" }] : []));
|
|
99
|
+
// Watch for type and position changes to update styles
|
|
100
|
+
effect(() => {
|
|
101
|
+
this.type();
|
|
102
|
+
this.position();
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
ngOnInit() {
|
|
106
|
+
// Activate animation after a small delay to ensure DOM is ready
|
|
107
|
+
setTimeout(() => {
|
|
108
|
+
this.openContainer();
|
|
109
|
+
this.startAnimation();
|
|
110
|
+
}, 10);
|
|
111
|
+
}
|
|
112
|
+
ngOnDestroy() {
|
|
113
|
+
if (this.intervalId) {
|
|
114
|
+
clearInterval(this.intervalId);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Opens the toast container with animation
|
|
119
|
+
*/
|
|
120
|
+
openContainer() {
|
|
121
|
+
this.isActive.set(true);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Closes the toast container with animation
|
|
125
|
+
*/
|
|
126
|
+
closeContainer() {
|
|
127
|
+
this.isActive.set(false);
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
this.toastClosed.emit();
|
|
130
|
+
// Remove element from DOM
|
|
131
|
+
const element = this.elementRef.nativeElement;
|
|
132
|
+
if (element && element.parentNode) {
|
|
133
|
+
element.parentNode.removeChild(element);
|
|
134
|
+
}
|
|
135
|
+
}, 500);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Public method to close toast
|
|
139
|
+
*/
|
|
140
|
+
close() {
|
|
141
|
+
this.closeContainer();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Handle close button click
|
|
145
|
+
*/
|
|
146
|
+
handleClose() {
|
|
147
|
+
this.closeContainer();
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Starts the auto-close animation
|
|
151
|
+
*/
|
|
152
|
+
startAnimation() {
|
|
153
|
+
const delay = this.autoCloseDelay();
|
|
154
|
+
if (!delay)
|
|
155
|
+
return;
|
|
156
|
+
if (this.loader()) {
|
|
157
|
+
this.progress.set(0);
|
|
158
|
+
this.intervalId = setInterval(() => {
|
|
159
|
+
const currentProgress = this.progress();
|
|
160
|
+
if (currentProgress >= 100) {
|
|
161
|
+
if (this.intervalId) {
|
|
162
|
+
clearInterval(this.intervalId);
|
|
163
|
+
}
|
|
164
|
+
this.closeContainer();
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.progress.set(currentProgress + 1);
|
|
168
|
+
}
|
|
169
|
+
}, delay / 100);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
this.intervalId = setInterval(() => {
|
|
173
|
+
if (this.intervalId) {
|
|
174
|
+
clearInterval(this.intervalId);
|
|
175
|
+
}
|
|
176
|
+
this.closeContainer();
|
|
177
|
+
}, delay);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuraToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
181
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: CuraToastComponent, isStandalone: true, selector: "cura-toast", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, closeButton: { classPropertyName: "closeButton", publicName: "closeButton", isSignal: true, isRequired: false, transformFunction: null }, loader: { classPropertyName: "loader", publicName: "loader", isSignal: true, isRequired: false, transformFunction: null }, autoCloseDelay: { classPropertyName: "autoCloseDelay", publicName: "autoCloseDelay", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toastClosed: "toastClosed" }, host: { attributes: { "role": "alert", "aria-live": "polite", "aria-atomic": "true" }, properties: { "attr.aria-label": "label()" } }, ngImport: i0, template: "<div [ngClass]=\"containerClasses()\" [ngStyle]=\"toastStyles()\">\n <cura-icon class=\"default-icon\" [name]=\"iconName()\" [size]=\"16\" [color]=\"type() + '-dark'\"></cura-icon>\n\n <div class=\"content\">\n <cura-heading [level]=\"4\" size=\"xsmall\" [color]=\"type() + '-dark'\" weight=\"bold\" marginBlock=\"0\">\n {{ label() }}\n </cura-heading>\n\n <cura-paragraph [color]=\"type() + '-darker'\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <ng-content></ng-content>\n </cura-paragraph>\n\n <ng-content select=\"[slot=actions]\"></ng-content>\n </div>\n\n @if (closeButton()) {\n <cura-icon class=\"close-icon\" name=\"close\" [size]=\"16\" color=\"error-dark\" (click)=\"handleClose()\"></cura-icon>\n }\n\n @if (loader() && autoCloseDelay()) {\n <cura-loader-bar [color]=\"type() + '-base'\" [progress]=\"progress()\"></cura-loader-bar>\n }\n</div>\n", styles: [":host{display:block;box-sizing:border-box}:host .container{position:fixed;z-index:99999;display:flex;box-sizing:border-box;min-width:320px;height:fit-content;padding:16px;border:1px solid var(--color-base);border-radius:12px;background-color:var(--neutral-purewhite);overflow:hidden;box-shadow:0 8px 16px 0 var(--neutral-black-shadow-4, rgba(38, 38, 38, .12))}:host .container.loader{padding:16px 16px 20px}:host .container.top{top:24px}:host .container.top.center{top:-100%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .5s ease-in-out,top .5s ease-in-out}:host .container.top.center.active{top:24px;opacity:1}:host .container.bottom{bottom:24px}:host .container.bottom.center{bottom:-100%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .5s ease-in-out,bottom .5s ease-in-out}:host .container.bottom.center.active{bottom:24px;opacity:1}:host .container.left{left:-100%;opacity:0;transition:opacity .5s ease-in-out,left .5s ease-in-out}@media (max-width: 768px){:host .container.left{right:unset;left:50%;transform:translate(-50%)}}:host .container.left.active{left:24px;opacity:1}:host .container.right{right:-100%;opacity:0;transition:opacity .5s ease-in-out,right .5s ease-in-out}@media (max-width: 768px){:host .container.right{right:unset;left:50%;transform:translate(-50%)}}:host .container.right.active{right:24px;opacity:1}:host .container .content{flex:1 1 0;display:flex;flex-direction:column;gap:4px}:host .container .default-icon{margin-right:12px}:host .container .close-icon{margin-left:12px;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }, { kind: "component", type: CuraHeadingComponent, selector: "cura-heading", inputs: ["level", "size", "weight", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: CuraLoaderBarComponent, selector: "cura-loader-bar", inputs: ["color", "progress"] }] }); }
|
|
182
|
+
}
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: CuraToastComponent, decorators: [{
|
|
184
|
+
type: Component,
|
|
185
|
+
args: [{ selector: 'cura-toast', imports: [CommonModule, CuraIconComponent, CuraHeadingComponent, CuraParagraphComponent, CuraLoaderBarComponent], host: {
|
|
186
|
+
role: 'alert',
|
|
187
|
+
'aria-live': 'polite',
|
|
188
|
+
'aria-atomic': 'true',
|
|
189
|
+
'[attr.aria-label]': 'label()',
|
|
190
|
+
}, template: "<div [ngClass]=\"containerClasses()\" [ngStyle]=\"toastStyles()\">\n <cura-icon class=\"default-icon\" [name]=\"iconName()\" [size]=\"16\" [color]=\"type() + '-dark'\"></cura-icon>\n\n <div class=\"content\">\n <cura-heading [level]=\"4\" size=\"xsmall\" [color]=\"type() + '-dark'\" weight=\"bold\" marginBlock=\"0\">\n {{ label() }}\n </cura-heading>\n\n <cura-paragraph [color]=\"type() + '-darker'\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <ng-content></ng-content>\n </cura-paragraph>\n\n <ng-content select=\"[slot=actions]\"></ng-content>\n </div>\n\n @if (closeButton()) {\n <cura-icon class=\"close-icon\" name=\"close\" [size]=\"16\" color=\"error-dark\" (click)=\"handleClose()\"></cura-icon>\n }\n\n @if (loader() && autoCloseDelay()) {\n <cura-loader-bar [color]=\"type() + '-base'\" [progress]=\"progress()\"></cura-loader-bar>\n }\n</div>\n", styles: [":host{display:block;box-sizing:border-box}:host .container{position:fixed;z-index:99999;display:flex;box-sizing:border-box;min-width:320px;height:fit-content;padding:16px;border:1px solid var(--color-base);border-radius:12px;background-color:var(--neutral-purewhite);overflow:hidden;box-shadow:0 8px 16px 0 var(--neutral-black-shadow-4, rgba(38, 38, 38, .12))}:host .container.loader{padding:16px 16px 20px}:host .container.top{top:24px}:host .container.top.center{top:-100%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .5s ease-in-out,top .5s ease-in-out}:host .container.top.center.active{top:24px;opacity:1}:host .container.bottom{bottom:24px}:host .container.bottom.center{bottom:-100%;left:50%;transform:translate(-50%);opacity:0;transition:opacity .5s ease-in-out,bottom .5s ease-in-out}:host .container.bottom.center.active{bottom:24px;opacity:1}:host .container.left{left:-100%;opacity:0;transition:opacity .5s ease-in-out,left .5s ease-in-out}@media (max-width: 768px){:host .container.left{right:unset;left:50%;transform:translate(-50%)}}:host .container.left.active{left:24px;opacity:1}:host .container.right{right:-100%;opacity:0;transition:opacity .5s ease-in-out,right .5s ease-in-out}@media (max-width: 768px){:host .container.right{right:unset;left:50%;transform:translate(-50%)}}:host .container.right.active{right:24px;opacity:1}:host .container .content{flex:1 1 0;display:flex;flex-direction:column;gap:4px}:host .container .default-icon{margin-right:12px}:host .container .close-icon{margin-left:12px;cursor:pointer}\n"] }]
|
|
191
|
+
}], ctorParameters: () => [], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], closeButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeButton", required: false }] }], loader: [{ type: i0.Input, args: [{ isSignal: true, alias: "loader", required: false }] }], autoCloseDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCloseDelay", required: false }] }], toastClosed: [{ type: i0.Output, args: ["toastClosed"] }] } });
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Generated bundle index. Do not edit.
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
export { CuraToastComponent };
|
|
198
|
+
//# sourceMappingURL=rededor-site-front-end-lib-cura-feedback-cura-toast.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-cura-feedback-cura-toast.mjs","sources":["../../../projects/site-front-end-lib/cura/feedback/cura-toast/cura-toast.component.ts","../../../projects/site-front-end-lib/cura/feedback/cura-toast/cura-toast.component.html","../../../projects/site-front-end-lib/cura/feedback/cura-toast/rededor-site-front-end-lib-cura-feedback-cura-toast.ts"],"sourcesContent":["import { Component, input, output, inject, computed, signal, OnInit, OnDestroy, ElementRef, effect } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\nimport { CuraHeadingComponent } from '@rededor/site-front-end-lib/cura/texts/cura-heading';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraLoaderBarComponent } from '@rededor/site-front-end-lib/cura/loaders/cura-loader-bar';\nimport { ToastType, ToastPosition } from './cura-toast.definitions';\n\n@Component({\n selector: 'cura-toast',\n imports: [CommonModule, CuraIconComponent, CuraHeadingComponent, CuraParagraphComponent, CuraLoaderBarComponent],\n templateUrl: './cura-toast.component.html',\n styleUrls: ['./cura-toast.component.scss'],\n host: {\n role: 'alert',\n 'aria-live': 'polite',\n 'aria-atomic': 'true',\n '[attr.aria-label]': 'label()',\n },\n})\nexport class CuraToastComponent implements OnInit, OnDestroy {\n private curaApi: CuraApiService = inject(CuraApiService);\n private elementRef = inject(ElementRef);\n private intervalId?: ReturnType<typeof setInterval>;\n\n /**\n * Toast type: info (default) | success | warning | error\n */\n type = input<ToastType>('info');\n\n /**\n * Toast position on screen\n */\n position = input<ToastPosition>('top-right');\n\n /**\n * Custom icon name\n */\n icon = input<string>('');\n\n /**\n * Toast label/title\n */\n label = input<string>('');\n\n /**\n * Show close button. Default: true\n */\n closeButton = input<boolean>(true);\n\n /**\n * Show loader bar. Default: true\n */\n loader = input<boolean>(true);\n\n /**\n * Auto close delay in milliseconds. Default: 10000ms (10s)\n */\n autoCloseDelay = input<number>(10000);\n\n /**\n * Close event emitter\n */\n toastClosed = output<void>();\n\n /**\n * Progress state for loader animation\n */\n progress = signal<number>(0);\n\n /**\n * Active state for animation\n */\n isActive = signal<boolean>(false);\n\n constructor() {\n // Watch for type and position changes to update styles\n effect(() => {\n this.type();\n this.position();\n });\n }\n\n toastStyles = computed(() => {\n if (!this.curaApi) return {};\n\n const colors = [\n { name: '--neutral-purewhite', theme: 'neutral-purewhite' },\n { name: '--neutral-base', theme: 'neutral-base', opacity: 0.2 },\n { name: '--primary-base', theme: 'primary-base' },\n { name: '--color-base', theme: `${this.type()}-base` },\n ];\n\n const styles: { [key: string]: string } = {};\n\n colors.forEach((color) => {\n if (color.opacity !== undefined) {\n styles[color.name] = this.curaApi.theme.colors.getColor(color.theme, color.opacity);\n } else {\n styles[color.name] = this.curaApi.theme.colors.getColor(color.theme);\n }\n });\n\n return styles;\n });\n\n containerClasses = computed(() => {\n const [firstPosition, secondPosition] = this.position().split('-');\n const classes: { [key: string]: boolean } = {\n container: true,\n };\n\n if (firstPosition) classes[firstPosition] = true;\n if (secondPosition) classes[secondPosition] = true;\n if (this.loader()) classes['loader'] = true;\n if (this.isActive()) classes['active'] = true;\n\n return classes;\n });\n\n iconName = computed(() => {\n const iconMapping: { [key in ToastType]: string } = {\n info: 'infoCircle',\n success: 'checkCircle',\n warning: 'alertCircle',\n error: 'alertTriangle',\n };\n return this.icon() || iconMapping[this.type()];\n });\n\n ngOnInit(): void {\n // Activate animation after a small delay to ensure DOM is ready\n setTimeout(() => {\n this.openContainer();\n this.startAnimation();\n }, 10);\n }\n\n ngOnDestroy(): void {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n }\n\n /**\n * Opens the toast container with animation\n */\n openContainer(): void {\n this.isActive.set(true);\n }\n\n /**\n * Closes the toast container with animation\n */\n closeContainer(): void {\n this.isActive.set(false);\n\n setTimeout(() => {\n this.toastClosed.emit();\n // Remove element from DOM\n const element = this.elementRef.nativeElement;\n if (element && element.parentNode) {\n element.parentNode.removeChild(element);\n }\n }, 500);\n }\n\n /**\n * Public method to close toast\n */\n close(): void {\n this.closeContainer();\n }\n\n /**\n * Handle close button click\n */\n handleClose(): void {\n this.closeContainer();\n }\n\n /**\n * Starts the auto-close animation\n */\n private startAnimation(): void {\n const delay = this.autoCloseDelay();\n\n if (!delay) return;\n\n if (this.loader()) {\n this.progress.set(0);\n this.intervalId = setInterval(() => {\n const currentProgress = this.progress();\n if (currentProgress >= 100) {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n this.closeContainer();\n } else {\n this.progress.set(currentProgress + 1);\n }\n }, delay / 100);\n } else {\n this.intervalId = setInterval(() => {\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n this.closeContainer();\n }, delay);\n }\n }\n}\n","<div [ngClass]=\"containerClasses()\" [ngStyle]=\"toastStyles()\">\n <cura-icon class=\"default-icon\" [name]=\"iconName()\" [size]=\"16\" [color]=\"type() + '-dark'\"></cura-icon>\n\n <div class=\"content\">\n <cura-heading [level]=\"4\" size=\"xsmall\" [color]=\"type() + '-dark'\" weight=\"bold\" marginBlock=\"0\">\n {{ label() }}\n </cura-heading>\n\n <cura-paragraph [color]=\"type() + '-darker'\" size=\"xsmall\" marginBlock=\"0\" lineHeight=\"133.33%\">\n <ng-content></ng-content>\n </cura-paragraph>\n\n <ng-content select=\"[slot=actions]\"></ng-content>\n </div>\n\n @if (closeButton()) {\n <cura-icon class=\"close-icon\" name=\"close\" [size]=\"16\" color=\"error-dark\" (click)=\"handleClose()\"></cura-icon>\n }\n\n @if (loader() && autoCloseDelay()) {\n <cura-loader-bar [color]=\"type() + '-base'\" [progress]=\"progress()\"></cura-loader-bar>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAqBa,kBAAkB,CAAA;AAuD7B,IAAA,WAAA,GAAA;AAtDQ,QAAA,IAAA,CAAA,OAAO,GAAmB,MAAM,CAAC,cAAc,C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,iBAAiB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,sBAAsB,CAAC,EAAA,IAAA,EAG1G;AACJ,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,aAAa,EAAE,MAAM;AACrB,wBAAA,mBAAmB,EAAE,SAAS;AAC/B,qBAAA,EAAA,QAAA,EAAA,m5BAAA,EAAA,MAAA,EAAA,CAAA,whDAAA,CAAA,EAAA;;;AEnBH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rededor/site-front-end-lib",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0",
|
|
@@ -229,6 +229,10 @@
|
|
|
229
229
|
"types": "./cura/feedback/cura-modal/index.d.ts",
|
|
230
230
|
"default": "./fesm2022/rededor-site-front-end-lib-cura-feedback-cura-modal.mjs"
|
|
231
231
|
},
|
|
232
|
+
"./cura/feedback/cura-toast": {
|
|
233
|
+
"types": "./cura/feedback/cura-toast/index.d.ts",
|
|
234
|
+
"default": "./fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs"
|
|
235
|
+
},
|
|
232
236
|
"./cura/forms": {
|
|
233
237
|
"types": "./cura/forms/index.d.ts",
|
|
234
238
|
"default": "./fesm2022/rededor-site-front-end-lib-cura-forms.mjs"
|