@rededor/site-front-end-lib 20.0.0-alpha.6 → 20.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/cta-wrapper/index.d.ts +3 -1
- package/components/footer/index.d.ts +6 -1
- package/components/section-navigation/index.d.ts +2 -0
- package/components/sidebar-navigation/index.d.ts +6 -1
- package/components/sticky-navigation/index.d.ts +6 -3
- package/core/index.d.ts +2 -0
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs +7 -3
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs +3 -2
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs +7 -2
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs +17 -7
- 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 +17 -9
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-core.mjs +32 -6
- package/fesm2022/rededor-site-front-end-lib-core.mjs.map +1 -1
- package/package.json +9 -9
|
@@ -87,6 +87,7 @@ class FooterComponent {
|
|
|
87
87
|
this.logo = input(null, ...(ngDevMode ? [{ debugName: "logo" }] : []));
|
|
88
88
|
this.partnerLogo = input(null, ...(ngDevMode ? [{ debugName: "partnerLogo" }] : []));
|
|
89
89
|
this.phone = input('', ...(ngDevMode ? [{ debugName: "phone" }] : []));
|
|
90
|
+
this.dora = input({ number: '', link: '', imgUrl: '' }, ...(ngDevMode ? [{ debugName: "dora" }] : []));
|
|
90
91
|
this.socialMenu = input([], ...(ngDevMode ? [{ debugName: "socialMenu" }] : []));
|
|
91
92
|
this.logoWidth = input(72, ...(ngDevMode ? [{ debugName: "logoWidth" }] : []));
|
|
92
93
|
this.footerMenu = input([], ...(ngDevMode ? [{ debugName: "footerMenu" }] : []));
|
|
@@ -136,11 +137,11 @@ class FooterComponent {
|
|
|
136
137
|
this.footerCookieClick.emit(event);
|
|
137
138
|
}
|
|
138
139
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
139
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: FooterComponent, isStandalone: true, selector: "footer[sl-ftr]", inputs: { project: { classPropertyName: "project", publicName: "project", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, linkPrivacyFooter: { classPropertyName: "linkPrivacyFooter", publicName: "linkPrivacyFooter", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, partnerLogo: { classPropertyName: "partnerLogo", publicName: "partnerLogo", isSignal: true, isRequired: false, transformFunction: null }, phone: { classPropertyName: "phone", publicName: "phone", isSignal: true, isRequired: false, transformFunction: null }, socialMenu: { classPropertyName: "socialMenu", publicName: "socialMenu", isSignal: true, isRequired: false, transformFunction: null }, logoWidth: { classPropertyName: "logoWidth", publicName: "logoWidth", isSignal: true, isRequired: false, transformFunction: null }, footerMenu: { classPropertyName: "footerMenu", publicName: "footerMenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { footerPrivacyClick: "footerPrivacyClick", footerCookieClick: "footerCookieClick", footerSocialMediaClick: "footerSocialMediaClick", footerMenuItemClick: "footerMenuItemClick" }, ngImport: i0, template: "<div class=\"sl-ftr-content\">\r\n <div>\r\n <div class=\"sl-ftr-contact\">\r\n @if (logo()) {\r\n <div class=\"logo\">\r\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (partnerLogo()) {\r\n <div class=\"partner-logo\">\r\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (phone()) {\r\n <div class=\"phone\">\r\n <a rdsitelink href=\"tel:{{ phone() }}\">\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\r\n </svg>\r\n {{ phone() }}\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n\r\n <nav class=\"sl-ftr-medias\">\r\n <ul>\r\n @for (social of socialMenu(); track social.title) {\r\n <li>\r\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\r\n </svg>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n\r\n <div class=\"content-menu\">\r\n @if (footerMenu().length) {\r\n <div class=\"sl-ftr-menu\">\r\n <nav>\r\n <ul class=\"sl-ftr-menu-list\">\r\n @for (menu of footerMenu(); track menu.title) {\r\n <li class=\"sl-ftr-menu-list-item\">\r\n @if (menu.title) {\r\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\r\n <a\r\n class=\"sl-ftr-menu-item-link\"\r\n [href]=\"menu.url\"\r\n rdsitelink\r\n [title]=\"menu.title\"\r\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\r\n >\r\n {{ menu.title }}\r\n </a>\r\n\r\n @if (menu.children?.length) {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\r\n </svg>\r\n }\r\n </div>\r\n\r\n @if (menu.children?.length) {\r\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\r\n @for (submenu of menu.children; track submenu.title) {\r\n <li class=\"sl-ftr-menu-item-children-item\">\r\n <div class=\"sl-ftr-menu-item alt\">\r\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\r\n {{ submenu.title }}\r\n </a>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<div class=\"sl-ftr-disc\">\r\n <div class=\"disc-content\">\r\n <div class=\"disc-content-copy\">\u00A9{{ currentYear }} {{ disclaimer() }}</div>\r\n <ul class=\"disc-content-links\">\r\n <li>\r\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\r\n </li>\r\n <li>\r\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n", styles: ["footer[sl-ftr]{min-height:530px;background-color:var(--ftr-bg-color);display:grid!important;grid-template-areas:\". . .\" \". content .\" \". . .\" \"disc disc disc\";grid-template-columns:minmax(10%,1fr) minmax(auto,1229.4px) minmax(10%,1fr);grid-template-rows:48px 1fr 48px auto}footer[sl-ftr] *{font-family:Gotham,Arial,Helvetica,sans-serif!important}footer[sl-ftr] svg{stroke:#fff;stroke-width:2.25px;fill:none}footer[sl-ftr] .sl-ftr-content{grid-area:content;display:flex;flex-direction:column;align-items:flex-start;gap:32px}footer[sl-ftr] .sl-ftr-content .content-menu{width:100%}footer[sl-ftr] .sl-ftr-disc{grid-area:disc}@media only screen and (min-width: 1024px){footer[sl-ftr]{grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr)}footer[sl-ftr] .sl-ftr-content{flex-direction:row;gap:44px}}.sl-ftr-menu{display:flex;flex-direction:column;padding-top:20px}.sl-ftr-menu nav{width:100%;height:auto;flex:auto;column-count:unset}@media only screen and (min-width: 1024px){.sl-ftr-menu{flex-direction:row}.sl-ftr-menu nav{flex:3 1 0;column-count:3}}a.sl-ftr-menu-item-link{text-align:left;padding:8px 0;text-decoration:none;font-style:normal}.sl-ftr-menu-list{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item{display:flex;align-items:center;justify-content:space-between;background-color:transparent;width:auto;cursor:pointer}.sl-ftr-menu-list .sl-ftr-menu-item a.sl-ftr-menu-item-link{color:var(--ftr-color);font-size:14px;font-weight:500;line-height:16px;min-height:35px;letter-spacing:.56px}.sl-ftr-menu-list .sl-ftr-menu-item:hover a{color:var(--ftr-menu-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item:hover svg{stroke:var(--ftr-menu-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item:active a{color:var(--ftr-menu-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item:active svg{stroke:var(--ftr-menu-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt a.sl-ftr-menu-item-link{color:var(--ftr-alt-color);font-size:12px;font-weight:300}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover a{color:var(--ftr-menu-alt-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover svg{stroke:var(--ftr-menu-alt-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active a{color:var(--ftr-menu-alt-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active svg{stroke:var(--ftr-menu-alt-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:100%}.sl-ftr-menu-list .sl-ftr-menu-item svg{display:inline}.sl-ftr-menu-list .sl-ftr-menu-item-children{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:none}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}@media only screen and (min-width: 1024px){.sl-ftr-menu-list .sl-ftr-menu-item svg{display:none}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:auto}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:block}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}}.sl-ftr-contact{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:20px 16px;margin-bottom:20px;width:100%;min-height:77px}.sl-ftr-contact img{width:var(--logo-width, 72px);height:50px;object-fit:contain}.sl-ftr-contact .logo{display:contents}.sl-ftr-contact .logo:after{content:\"\";width:1px;height:60px;background-color:var(--ftr-color)}.sl-ftr-contact .partner-logo{display:contents}.sl-ftr-contact .phone a{display:flex;justify-content:center;align-items:center;gap:12px;font-size:17px;font-weight:500;color:var(--ftr-color);text-decoration:none}@media only screen and (min-width: 361px){.sl-ftr-contact{width:280px}.sl-ftr-contact .phone a{font-size:19px}}@media only screen and (min-width: 1024px){.sl-ftr-contact{gap:20px 24px;width:328px}}nav.sl-ftr-medias ul{list-style:none;display:flex;gap:16px 0px;flex-wrap:wrap;width:100%}nav.sl-ftr-medias ul li{display:flex;justify-content:center;align-items:center;border-radius:100%;border:1px solid #ffffff;width:36px;height:36px;margin-right:12px}nav.sl-ftr-medias ul li a{display:flex;justify-content:center;align-items:center;border-radius:100%;width:36px;height:36px;text-decoration:none}@media only screen and (min-width: 361px){nav.sl-ftr-medias ul li{margin-right:15px}}@media only screen and (min-width: 1024px){nav.sl-ftr-medias ul{flex-wrap:nowrap}}.sl-ftr-disc{background-color:var(--ftr-disc-bg-color);display:grid!important;grid-template-areas:\". disc-content .\";grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr);grid-template-rows:auto}.sl-ftr-disc .disc-content{grid-area:disc-content;height:auto;padding:12px 0;display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;flex-direction:column}.sl-ftr-disc .disc-content-copy{font-size:12px;font-style:normal;font-weight:500;text-transform:uppercase;color:var(--ftr-disc-color)}.sl-ftr-disc .disc-content-links{list-style:none;display:flex;flex-direction:row;align-items:flex-start;flex-wrap:wrap;gap:0px 36px}.sl-ftr-disc .disc-content-links li a,.sl-ftr-disc .disc-content-links li button{font-size:12px;font-style:normal;font-weight:500;color:var(--ftr-disc-alt-color);text-decoration:none;cursor:pointer;background:transparent}@media only screen and (min-width: 1024px){.sl-ftr-disc .disc-content{height:40px;padding:0;align-items:center;flex-direction:row;gap:36px}.sl-ftr-disc .disc-content-links{gap:36px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
140
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: FooterComponent, isStandalone: true, selector: "footer[sl-ftr]", inputs: { project: { classPropertyName: "project", publicName: "project", isSignal: true, isRequired: false, transformFunction: null }, theme: { classPropertyName: "theme", publicName: "theme", isSignal: true, isRequired: false, transformFunction: null }, disclaimer: { classPropertyName: "disclaimer", publicName: "disclaimer", isSignal: true, isRequired: false, transformFunction: null }, linkPrivacyFooter: { classPropertyName: "linkPrivacyFooter", publicName: "linkPrivacyFooter", isSignal: true, isRequired: false, transformFunction: null }, logo: { classPropertyName: "logo", publicName: "logo", isSignal: true, isRequired: false, transformFunction: null }, partnerLogo: { classPropertyName: "partnerLogo", publicName: "partnerLogo", isSignal: true, isRequired: false, transformFunction: null }, phone: { classPropertyName: "phone", publicName: "phone", isSignal: true, isRequired: false, transformFunction: null }, dora: { classPropertyName: "dora", publicName: "dora", isSignal: true, isRequired: false, transformFunction: null }, socialMenu: { classPropertyName: "socialMenu", publicName: "socialMenu", isSignal: true, isRequired: false, transformFunction: null }, logoWidth: { classPropertyName: "logoWidth", publicName: "logoWidth", isSignal: true, isRequired: false, transformFunction: null }, footerMenu: { classPropertyName: "footerMenu", publicName: "footerMenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { footerPrivacyClick: "footerPrivacyClick", footerCookieClick: "footerCookieClick", footerSocialMediaClick: "footerSocialMediaClick", footerMenuItemClick: "footerMenuItemClick" }, ngImport: i0, template: "<div class=\"sl-ftr-content\">\n <div>\n <div class=\"sl-ftr-contact\">\n <div class=\"logos\">\n @if (logo()) {\n <div class=\"logo\">\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n @if (partnerLogo()) {\n <div class=\"partner-logo\">\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n </div>\n <div class=\"phones\">\n @if (dora().number && dora().link) {\n <div class=\"dora\">\n <div\n class=\"img\"\n [style.background-image]=\"dora().imgUrl ? 'url(' + dora().imgUrl + ')' : 'url(' + assetsPath() + '/imgs/bg_dora_whatsapp.webp)'\"\n ></div>\n <span class=\"label\">\n <p>Fale com a Dora</p>\n <a rdsitelink [href]=\"dora().link\">\n {{ dora().number }}\n </a>\n </span>\n </div>\n }\n @if (phone()) {\n <div class=\"phone\" [class.before]=\"dora().number && dora().link\">\n <div class=\"svg\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\n </svg>\n </div>\n <span class=\"label\">\n <p>Central</p>\n <a rdsitelink href=\"tel:{{ phone() }}\">\n {{ phone() }}\n </a>\n </span>\n </div>\n }\n </div>\n </div>\n\n <nav class=\"sl-ftr-medias\">\n <ul>\n @for (social of socialMenu(); track social.title) {\n <li>\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\n </svg>\n </a>\n </li>\n }\n </ul>\n </nav>\n </div>\n\n <div class=\"content-menu\">\n @if (footerMenu().length) {\n <div class=\"sl-ftr-menu\">\n <nav>\n <ul class=\"sl-ftr-menu-list\">\n @for (menu of footerMenu(); track menu.title) {\n <li class=\"sl-ftr-menu-list-item\">\n @if (menu.title) {\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\n <a\n class=\"sl-ftr-menu-item-link\"\n [href]=\"menu.url\"\n rdsitelink\n [title]=\"menu.title\"\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\n >\n {{ menu.title }}\n </a>\n\n @if (menu.children?.length) {\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\n </svg>\n }\n </div>\n\n @if (menu.children?.length) {\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\n @for (submenu of menu.children; track submenu.title) {\n <li class=\"sl-ftr-menu-item-children-item\">\n <div class=\"sl-ftr-menu-item alt\">\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\n {{ submenu.title }}\n </a>\n </div>\n </li>\n }\n </ul>\n }\n }\n </li>\n }\n </ul>\n </nav>\n </div>\n }\n </div>\n</div>\n\n<div class=\"sl-ftr-disc\">\n <div class=\"disc-content\">\n <div class=\"disc-content-copy\">\u00A9{{ currentYear }} {{ disclaimer() }}</div>\n <ul class=\"disc-content-links\">\n <li>\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\n </li>\n <li>\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\n </li>\n </ul>\n </div>\n</div>\n", styles: ["footer[sl-ftr]{min-height:530px;background-color:var(--ftr-bg-color);display:grid!important;grid-template-areas:\". . .\" \". content .\" \". . .\" \"disc disc disc\";grid-template-columns:minmax(10%,1fr) minmax(auto,1229.4px) minmax(10%,1fr);grid-template-rows:48px 1fr 48px auto}footer[sl-ftr] *{font-family:Gotham,Arial,Helvetica,sans-serif!important}footer[sl-ftr] svg{stroke:#fff;stroke-width:2.25px;fill:none}footer[sl-ftr] .sl-ftr-content{grid-area:content;display:flex;flex-direction:column;align-items:flex-start;gap:32px}footer[sl-ftr] .sl-ftr-content .content-menu{width:100%}footer[sl-ftr] .sl-ftr-disc{grid-area:disc}@media only screen and (min-width: 1024px){footer[sl-ftr]{grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr)}footer[sl-ftr] .sl-ftr-content{flex-direction:row;gap:44px}}.sl-ftr-menu{display:flex;flex-direction:column;padding-top:20px}.sl-ftr-menu nav{width:100%;height:auto;flex:auto;column-count:unset}@media only screen and (min-width: 1024px){.sl-ftr-menu{flex-direction:row}.sl-ftr-menu nav{flex:3 1 0;column-count:3}}a.sl-ftr-menu-item-link{text-align:left;padding:8px 0;text-decoration:none;font-style:normal}.sl-ftr-menu-list{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item{display:flex;align-items:center;justify-content:space-between;background-color:transparent;width:auto;cursor:pointer}.sl-ftr-menu-list .sl-ftr-menu-item a.sl-ftr-menu-item-link{color:var(--ftr-color);font-size:14px;font-weight:500;line-height:16px;min-height:35px;letter-spacing:.56px}.sl-ftr-menu-list .sl-ftr-menu-item:hover a{color:var(--ftr-menu-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item:hover svg{stroke:var(--ftr-menu-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item:active a{color:var(--ftr-menu-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item:active svg{stroke:var(--ftr-menu-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt a.sl-ftr-menu-item-link{color:var(--ftr-alt-color);font-size:12px;font-weight:300}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover a{color:var(--ftr-menu-alt-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover svg{stroke:var(--ftr-menu-alt-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active a{color:var(--ftr-menu-alt-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active svg{stroke:var(--ftr-menu-alt-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:100%}.sl-ftr-menu-list .sl-ftr-menu-item svg{display:inline}.sl-ftr-menu-list .sl-ftr-menu-item-children{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:none}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}@media only screen and (min-width: 1024px){.sl-ftr-menu-list .sl-ftr-menu-item svg{display:none}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:auto}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:block}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}}.sl-ftr-contact{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:20px 16px;margin-bottom:20px;width:100%;min-height:77px}.sl-ftr-contact img{width:var(--logo-width, 92px);height:50px;object-fit:contain}.sl-ftr-contact .logos .logo{display:contents}.sl-ftr-contact .logos .logo:after{content:\"\";width:1px;height:60px;background-color:var(--ftr-color)}.sl-ftr-contact .logos .partner-logo{display:contents}.sl-ftr-contact .phones{display:flex;width:100%;gap:12px}.sl-ftr-contact .phones .phone,.sl-ftr-contact .phones .dora{display:flex;gap:8px}.sl-ftr-contact .phones .phone .label p,.sl-ftr-contact .phones .dora .label p{color:#f6f6f6;font-size:12px;font-weight:500;line-height:16px;letter-spacing:.72px;padding-bottom:0}.sl-ftr-contact .phones .phone .label a,.sl-ftr-contact .phones .dora .label a{color:#f6f6f6;font-size:14px;font-weight:700;line-height:19px;letter-spacing:.56px;text-decoration:none}.sl-ftr-contact .phones .dora .img{display:block;width:32px;height:32px;background:#d3d3d3 50%/cover no-repeat;border-radius:50%;border:2px solid #448ecd}.sl-ftr-contact .phones .phone .svg{display:flex;justify-content:center;align-items:center;background:#003da5;border-radius:50%;width:32px;height:32px}.sl-ftr-contact .phones .phone.before:before{content:\"\";width:2px;background-color:#f6f6f6;margin-right:6px}@media only screen and (max-width: 1024px){.sl-ftr-contact .phones{flex-direction:column;gap:20px}.sl-ftr-contact .phones .phone.before:before{display:none}}@media only screen and (min-width: 1024px){.sl-ftr-contact{gap:20px 24px;width:328px}}nav.sl-ftr-medias ul{list-style:none;display:flex;gap:16px 0px;flex-wrap:wrap;width:100%}nav.sl-ftr-medias ul li{display:flex;justify-content:center;align-items:center;border-radius:100%;border:1px solid #ffffff;width:36px;height:36px;margin-right:12px}nav.sl-ftr-medias ul li a{display:flex;justify-content:center;align-items:center;border-radius:100%;width:36px;height:36px;text-decoration:none}@media only screen and (min-width: 361px){nav.sl-ftr-medias ul li{margin-right:15px}}@media only screen and (min-width: 1024px){nav.sl-ftr-medias ul{flex-wrap:nowrap}}.sl-ftr-disc{background-color:var(--ftr-disc-bg-color);display:grid!important;grid-template-areas:\". disc-content .\";grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr);grid-template-rows:auto}.sl-ftr-disc .disc-content{grid-area:disc-content;height:auto;padding:12px 0;display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;flex-direction:column}.sl-ftr-disc .disc-content-copy{font-size:12px;font-style:normal;font-weight:500;text-transform:uppercase;color:var(--ftr-disc-color)}.sl-ftr-disc .disc-content-links{list-style:none;display:flex;flex-direction:row;align-items:flex-start;flex-wrap:wrap;gap:0px 36px}.sl-ftr-disc .disc-content-links li a,.sl-ftr-disc .disc-content-links li button{font-size:12px;font-style:normal;font-weight:500;color:var(--ftr-disc-alt-color);text-decoration:none;cursor:pointer;background:transparent}@media only screen and (min-width: 1024px){.sl-ftr-disc .disc-content{height:40px;padding:0;align-items:center;flex-direction:row;gap:36px}.sl-ftr-disc .disc-content-links{gap:36px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
140
141
|
}
|
|
141
142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: FooterComponent, decorators: [{
|
|
142
143
|
type: Component,
|
|
143
|
-
args: [{ selector: 'footer[sl-ftr]', imports: [CommonModule, RdsiteLinkDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"sl-ftr-content\">\r\n <div>\r\n <div class=\"sl-ftr-contact\">\r\n @if (logo()) {\r\n <div class=\"logo\">\r\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (partnerLogo()) {\r\n <div class=\"partner-logo\">\r\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (phone()) {\r\n <div class=\"phone\">\r\n <a rdsitelink href=\"tel:{{ phone() }}\">\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\r\n </svg>\r\n {{ phone() }}\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n\r\n <nav class=\"sl-ftr-medias\">\r\n <ul>\r\n @for (social of socialMenu(); track social.title) {\r\n <li>\r\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\r\n </svg>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n\r\n <div class=\"content-menu\">\r\n @if (footerMenu().length) {\r\n <div class=\"sl-ftr-menu\">\r\n <nav>\r\n <ul class=\"sl-ftr-menu-list\">\r\n @for (menu of footerMenu(); track menu.title) {\r\n <li class=\"sl-ftr-menu-list-item\">\r\n @if (menu.title) {\r\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\r\n <a\r\n class=\"sl-ftr-menu-item-link\"\r\n [href]=\"menu.url\"\r\n rdsitelink\r\n [title]=\"menu.title\"\r\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\r\n >\r\n {{ menu.title }}\r\n </a>\r\n\r\n @if (menu.children?.length) {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\r\n </svg>\r\n }\r\n </div>\r\n\r\n @if (menu.children?.length) {\r\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\r\n @for (submenu of menu.children; track submenu.title) {\r\n <li class=\"sl-ftr-menu-item-children-item\">\r\n <div class=\"sl-ftr-menu-item alt\">\r\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\r\n {{ submenu.title }}\r\n </a>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<div class=\"sl-ftr-disc\">\r\n <div class=\"disc-content\">\r\n <div class=\"disc-content-copy\">\u00A9{{ currentYear }} {{ disclaimer() }}</div>\r\n <ul class=\"disc-content-links\">\r\n <li>\r\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\r\n </li>\r\n <li>\r\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n", styles: ["footer[sl-ftr]{min-height:530px;background-color:var(--ftr-bg-color);display:grid!important;grid-template-areas:\". . .\" \". content .\" \". . .\" \"disc disc disc\";grid-template-columns:minmax(10%,1fr) minmax(auto,1229.4px) minmax(10%,1fr);grid-template-rows:48px 1fr 48px auto}footer[sl-ftr] *{font-family:Gotham,Arial,Helvetica,sans-serif!important}footer[sl-ftr] svg{stroke:#fff;stroke-width:2.25px;fill:none}footer[sl-ftr] .sl-ftr-content{grid-area:content;display:flex;flex-direction:column;align-items:flex-start;gap:32px}footer[sl-ftr] .sl-ftr-content .content-menu{width:100%}footer[sl-ftr] .sl-ftr-disc{grid-area:disc}@media only screen and (min-width: 1024px){footer[sl-ftr]{grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr)}footer[sl-ftr] .sl-ftr-content{flex-direction:row;gap:44px}}.sl-ftr-menu{display:flex;flex-direction:column;padding-top:20px}.sl-ftr-menu nav{width:100%;height:auto;flex:auto;column-count:unset}@media only screen and (min-width: 1024px){.sl-ftr-menu{flex-direction:row}.sl-ftr-menu nav{flex:3 1 0;column-count:3}}a.sl-ftr-menu-item-link{text-align:left;padding:8px 0;text-decoration:none;font-style:normal}.sl-ftr-menu-list{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item{display:flex;align-items:center;justify-content:space-between;background-color:transparent;width:auto;cursor:pointer}.sl-ftr-menu-list .sl-ftr-menu-item a.sl-ftr-menu-item-link{color:var(--ftr-color);font-size:14px;font-weight:500;line-height:16px;min-height:35px;letter-spacing:.56px}.sl-ftr-menu-list .sl-ftr-menu-item:hover a{color:var(--ftr-menu-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item:hover svg{stroke:var(--ftr-menu-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item:active a{color:var(--ftr-menu-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item:active svg{stroke:var(--ftr-menu-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt a.sl-ftr-menu-item-link{color:var(--ftr-alt-color);font-size:12px;font-weight:300}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover a{color:var(--ftr-menu-alt-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover svg{stroke:var(--ftr-menu-alt-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active a{color:var(--ftr-menu-alt-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active svg{stroke:var(--ftr-menu-alt-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:100%}.sl-ftr-menu-list .sl-ftr-menu-item svg{display:inline}.sl-ftr-menu-list .sl-ftr-menu-item-children{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:none}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}@media only screen and (min-width: 1024px){.sl-ftr-menu-list .sl-ftr-menu-item svg{display:none}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:auto}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:block}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}}.sl-ftr-contact{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:20px 16px;margin-bottom:20px;width:100%;min-height:77px}.sl-ftr-contact img{width:var(--logo-width, 72px);height:50px;object-fit:contain}.sl-ftr-contact .logo{display:contents}.sl-ftr-contact .logo:after{content:\"\";width:1px;height:60px;background-color:var(--ftr-color)}.sl-ftr-contact .partner-logo{display:contents}.sl-ftr-contact .phone a{display:flex;justify-content:center;align-items:center;gap:12px;font-size:17px;font-weight:500;color:var(--ftr-color);text-decoration:none}@media only screen and (min-width: 361px){.sl-ftr-contact{width:280px}.sl-ftr-contact .phone a{font-size:19px}}@media only screen and (min-width: 1024px){.sl-ftr-contact{gap:20px 24px;width:328px}}nav.sl-ftr-medias ul{list-style:none;display:flex;gap:16px 0px;flex-wrap:wrap;width:100%}nav.sl-ftr-medias ul li{display:flex;justify-content:center;align-items:center;border-radius:100%;border:1px solid #ffffff;width:36px;height:36px;margin-right:12px}nav.sl-ftr-medias ul li a{display:flex;justify-content:center;align-items:center;border-radius:100%;width:36px;height:36px;text-decoration:none}@media only screen and (min-width: 361px){nav.sl-ftr-medias ul li{margin-right:15px}}@media only screen and (min-width: 1024px){nav.sl-ftr-medias ul{flex-wrap:nowrap}}.sl-ftr-disc{background-color:var(--ftr-disc-bg-color);display:grid!important;grid-template-areas:\". disc-content .\";grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr);grid-template-rows:auto}.sl-ftr-disc .disc-content{grid-area:disc-content;height:auto;padding:12px 0;display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;flex-direction:column}.sl-ftr-disc .disc-content-copy{font-size:12px;font-style:normal;font-weight:500;text-transform:uppercase;color:var(--ftr-disc-color)}.sl-ftr-disc .disc-content-links{list-style:none;display:flex;flex-direction:row;align-items:flex-start;flex-wrap:wrap;gap:0px 36px}.sl-ftr-disc .disc-content-links li a,.sl-ftr-disc .disc-content-links li button{font-size:12px;font-style:normal;font-weight:500;color:var(--ftr-disc-alt-color);text-decoration:none;cursor:pointer;background:transparent}@media only screen and (min-width: 1024px){.sl-ftr-disc .disc-content{height:40px;padding:0;align-items:center;flex-direction:row;gap:36px}.sl-ftr-disc .disc-content-links{gap:36px}}\n"] }]
|
|
144
|
+
args: [{ selector: 'footer[sl-ftr]', imports: [CommonModule, RdsiteLinkDirective], encapsulation: ViewEncapsulation.None, template: "<div class=\"sl-ftr-content\">\n <div>\n <div class=\"sl-ftr-contact\">\n <div class=\"logos\">\n @if (logo()) {\n <div class=\"logo\">\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n @if (partnerLogo()) {\n <div class=\"partner-logo\">\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n </div>\n <div class=\"phones\">\n @if (dora().number && dora().link) {\n <div class=\"dora\">\n <div\n class=\"img\"\n [style.background-image]=\"dora().imgUrl ? 'url(' + dora().imgUrl + ')' : 'url(' + assetsPath() + '/imgs/bg_dora_whatsapp.webp)'\"\n ></div>\n <span class=\"label\">\n <p>Fale com a Dora</p>\n <a rdsitelink [href]=\"dora().link\">\n {{ dora().number }}\n </a>\n </span>\n </div>\n }\n @if (phone()) {\n <div class=\"phone\" [class.before]=\"dora().number && dora().link\">\n <div class=\"svg\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\n </svg>\n </div>\n <span class=\"label\">\n <p>Central</p>\n <a rdsitelink href=\"tel:{{ phone() }}\">\n {{ phone() }}\n </a>\n </span>\n </div>\n }\n </div>\n </div>\n\n <nav class=\"sl-ftr-medias\">\n <ul>\n @for (social of socialMenu(); track social.title) {\n <li>\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\n </svg>\n </a>\n </li>\n }\n </ul>\n </nav>\n </div>\n\n <div class=\"content-menu\">\n @if (footerMenu().length) {\n <div class=\"sl-ftr-menu\">\n <nav>\n <ul class=\"sl-ftr-menu-list\">\n @for (menu of footerMenu(); track menu.title) {\n <li class=\"sl-ftr-menu-list-item\">\n @if (menu.title) {\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\n <a\n class=\"sl-ftr-menu-item-link\"\n [href]=\"menu.url\"\n rdsitelink\n [title]=\"menu.title\"\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\n >\n {{ menu.title }}\n </a>\n\n @if (menu.children?.length) {\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\n </svg>\n }\n </div>\n\n @if (menu.children?.length) {\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\n @for (submenu of menu.children; track submenu.title) {\n <li class=\"sl-ftr-menu-item-children-item\">\n <div class=\"sl-ftr-menu-item alt\">\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\n {{ submenu.title }}\n </a>\n </div>\n </li>\n }\n </ul>\n }\n }\n </li>\n }\n </ul>\n </nav>\n </div>\n }\n </div>\n</div>\n\n<div class=\"sl-ftr-disc\">\n <div class=\"disc-content\">\n <div class=\"disc-content-copy\">\u00A9{{ currentYear }} {{ disclaimer() }}</div>\n <ul class=\"disc-content-links\">\n <li>\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\n </li>\n <li>\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\n </li>\n </ul>\n </div>\n</div>\n", styles: ["footer[sl-ftr]{min-height:530px;background-color:var(--ftr-bg-color);display:grid!important;grid-template-areas:\". . .\" \". content .\" \". . .\" \"disc disc disc\";grid-template-columns:minmax(10%,1fr) minmax(auto,1229.4px) minmax(10%,1fr);grid-template-rows:48px 1fr 48px auto}footer[sl-ftr] *{font-family:Gotham,Arial,Helvetica,sans-serif!important}footer[sl-ftr] svg{stroke:#fff;stroke-width:2.25px;fill:none}footer[sl-ftr] .sl-ftr-content{grid-area:content;display:flex;flex-direction:column;align-items:flex-start;gap:32px}footer[sl-ftr] .sl-ftr-content .content-menu{width:100%}footer[sl-ftr] .sl-ftr-disc{grid-area:disc}@media only screen and (min-width: 1024px){footer[sl-ftr]{grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr)}footer[sl-ftr] .sl-ftr-content{flex-direction:row;gap:44px}}.sl-ftr-menu{display:flex;flex-direction:column;padding-top:20px}.sl-ftr-menu nav{width:100%;height:auto;flex:auto;column-count:unset}@media only screen and (min-width: 1024px){.sl-ftr-menu{flex-direction:row}.sl-ftr-menu nav{flex:3 1 0;column-count:3}}a.sl-ftr-menu-item-link{text-align:left;padding:8px 0;text-decoration:none;font-style:normal}.sl-ftr-menu-list{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item{display:flex;align-items:center;justify-content:space-between;background-color:transparent;width:auto;cursor:pointer}.sl-ftr-menu-list .sl-ftr-menu-item a.sl-ftr-menu-item-link{color:var(--ftr-color);font-size:14px;font-weight:500;line-height:16px;min-height:35px;letter-spacing:.56px}.sl-ftr-menu-list .sl-ftr-menu-item:hover a{color:var(--ftr-menu-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item:hover svg{stroke:var(--ftr-menu-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item:active a{color:var(--ftr-menu-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item:active svg{stroke:var(--ftr-menu-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt a.sl-ftr-menu-item-link{color:var(--ftr-alt-color);font-size:12px;font-weight:300}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover a{color:var(--ftr-menu-alt-hover-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:hover svg{stroke:var(--ftr-menu-alt-hover-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active a{color:var(--ftr-menu-alt-active-color)}.sl-ftr-menu-list .sl-ftr-menu-item.alt:active svg{stroke:var(--ftr-menu-alt-active-color)!important}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:100%}.sl-ftr-menu-list .sl-ftr-menu-item svg{display:inline}.sl-ftr-menu-list .sl-ftr-menu-item-children{list-style:none}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:none}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}@media only screen and (min-width: 1024px){.sl-ftr-menu-list .sl-ftr-menu-item svg{display:none}.sl-ftr-menu-list .sl-ftr-menu-item.have-children{width:auto}.sl-ftr-menu-list .sl-ftr-menu-item-children.closed{display:block}.sl-ftr-menu-list .sl-ftr-menu-item-children-item{margin:0 0 0 12px}}.sl-ftr-contact{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:20px 16px;margin-bottom:20px;width:100%;min-height:77px}.sl-ftr-contact img{width:var(--logo-width, 92px);height:50px;object-fit:contain}.sl-ftr-contact .logos .logo{display:contents}.sl-ftr-contact .logos .logo:after{content:\"\";width:1px;height:60px;background-color:var(--ftr-color)}.sl-ftr-contact .logos .partner-logo{display:contents}.sl-ftr-contact .phones{display:flex;width:100%;gap:12px}.sl-ftr-contact .phones .phone,.sl-ftr-contact .phones .dora{display:flex;gap:8px}.sl-ftr-contact .phones .phone .label p,.sl-ftr-contact .phones .dora .label p{color:#f6f6f6;font-size:12px;font-weight:500;line-height:16px;letter-spacing:.72px;padding-bottom:0}.sl-ftr-contact .phones .phone .label a,.sl-ftr-contact .phones .dora .label a{color:#f6f6f6;font-size:14px;font-weight:700;line-height:19px;letter-spacing:.56px;text-decoration:none}.sl-ftr-contact .phones .dora .img{display:block;width:32px;height:32px;background:#d3d3d3 50%/cover no-repeat;border-radius:50%;border:2px solid #448ecd}.sl-ftr-contact .phones .phone .svg{display:flex;justify-content:center;align-items:center;background:#003da5;border-radius:50%;width:32px;height:32px}.sl-ftr-contact .phones .phone.before:before{content:\"\";width:2px;background-color:#f6f6f6;margin-right:6px}@media only screen and (max-width: 1024px){.sl-ftr-contact .phones{flex-direction:column;gap:20px}.sl-ftr-contact .phones .phone.before:before{display:none}}@media only screen and (min-width: 1024px){.sl-ftr-contact{gap:20px 24px;width:328px}}nav.sl-ftr-medias ul{list-style:none;display:flex;gap:16px 0px;flex-wrap:wrap;width:100%}nav.sl-ftr-medias ul li{display:flex;justify-content:center;align-items:center;border-radius:100%;border:1px solid #ffffff;width:36px;height:36px;margin-right:12px}nav.sl-ftr-medias ul li a{display:flex;justify-content:center;align-items:center;border-radius:100%;width:36px;height:36px;text-decoration:none}@media only screen and (min-width: 361px){nav.sl-ftr-medias ul li{margin-right:15px}}@media only screen and (min-width: 1024px){nav.sl-ftr-medias ul{flex-wrap:nowrap}}.sl-ftr-disc{background-color:var(--ftr-disc-bg-color);display:grid!important;grid-template-areas:\". disc-content .\";grid-template-columns:minmax(5%,1fr) minmax(auto,1229.4px) minmax(5%,1fr);grid-template-rows:auto}.sl-ftr-disc .disc-content{grid-area:disc-content;height:auto;padding:12px 0;display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;flex-direction:column}.sl-ftr-disc .disc-content-copy{font-size:12px;font-style:normal;font-weight:500;text-transform:uppercase;color:var(--ftr-disc-color)}.sl-ftr-disc .disc-content-links{list-style:none;display:flex;flex-direction:row;align-items:flex-start;flex-wrap:wrap;gap:0px 36px}.sl-ftr-disc .disc-content-links li a,.sl-ftr-disc .disc-content-links li button{font-size:12px;font-style:normal;font-weight:500;color:var(--ftr-disc-alt-color);text-decoration:none;cursor:pointer;background:transparent}@media only screen and (min-width: 1024px){.sl-ftr-disc .disc-content{height:40px;padding:0;align-items:center;flex-direction:row;gap:36px}.sl-ftr-disc .disc-content-links{gap:36px}}\n"] }]
|
|
144
145
|
}], ctorParameters: () => [] });
|
|
145
146
|
|
|
146
147
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-footer.mjs","sources":["../../../projects/site-front-end-lib/components/footer/helpers/footerTheme.func.ts","../../../projects/site-front-end-lib/components/footer/footer.component.ts","../../../projects/site-front-end-lib/components/footer/footer.component.html","../../../projects/site-front-end-lib/components/footer/rededor-site-front-end-lib-components-footer.ts"],"sourcesContent":["import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { FooterTheme } from '../models/FooterTheme.model';\r\n\r\nexport const getFooterTheme = (project: string = 'site', themeStyle: string = 'default', curaApiService: CuraApiService) => {\r\n const theme: FooterTheme = {\r\n ftr: {},\r\n 'ftr-disc': {},\r\n 'ftr-menu': {},\r\n 'ftr-social': {},\r\n };\r\n\r\n const [primaryLighter, primaryLight, primaryBase, primaryDarker] = [\r\n curaApiService.theme.colors.getColor('primary-lighter'),\r\n curaApiService.theme.colors.getColor('primary-light'),\r\n curaApiService.theme.colors.getColor('primary-base'),\r\n curaApiService.theme.colors.getColor('primary-darker'),\r\n ];\r\n const [accentLight, accentBase] = [curaApiService.theme.colors.getColor('accent-light'), curaApiService.theme.colors.getColor('accent-base')];\r\n const [neutralPurewhite, neutralWhite, neutralBlack] = [\r\n curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n curaApiService.theme.colors.getColor('neutral-white'),\r\n curaApiService.theme.colors.getColor('neutral-black'),\r\n ];\r\n\r\n switch (project) {\r\n case 'site':\r\n if (themeStyle === 'default') {\r\n theme.ftr = {\r\n 'bg-color': primaryDarker,\r\n color: neutralWhite,\r\n 'alt-color': primaryLighter,\r\n };\r\n theme['ftr-disc'] = {\r\n 'bg-color': neutralPurewhite,\r\n color: neutralBlack,\r\n 'alt-color': primaryBase,\r\n };\r\n theme['ftr-menu'] = {\r\n 'hover-color': accentLight,\r\n 'active-color': accentBase,\r\n 'alt-hover-color': primaryLight,\r\n 'alt-active-color': primaryBase,\r\n };\r\n theme['ftr-social'] = {\r\n color: neutralWhite,\r\n };\r\n } else {\r\n theme.ftr = {\r\n 'bg-color': primaryDarker,\r\n color: neutralWhite,\r\n 'alt-color': primaryLighter,\r\n };\r\n theme['ftr-disc'] = {\r\n 'bg-color': neutralPurewhite,\r\n color: neutralBlack,\r\n 'alt-color': primaryBase,\r\n };\r\n theme['ftr-menu'] = {\r\n 'hover-color': accentLight,\r\n 'active-color': accentBase,\r\n 'alt-hover-color': primaryLight,\r\n 'alt-active-color': primaryBase,\r\n };\r\n theme['ftr-social'] = {\r\n color: neutralWhite,\r\n };\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return theme;\r\n};\r\n","import { Component, ElementRef, AfterViewInit, ViewEncapsulation, input, output, inject, effect, computed } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { PrivacyToolsService, LIB_CONFIG, LibConfig, RdsiteLinkDirective, MenuItem, MenuSocialMedia } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { FooterTheme } from './models/FooterTheme.model';\r\nimport { getFooterTheme } from './helpers/footerTheme.func';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'footer[sl-ftr]',\r\n imports: [CommonModule, RdsiteLinkDirective],\r\n encapsulation: ViewEncapsulation.None,\r\n templateUrl: './footer.component.html',\r\n styleUrl: './footer.component.scss',\r\n})\r\nexport class FooterComponent implements AfterViewInit {\r\n public privacyTools = inject(PrivacyToolsService);\r\n private curaApiService = inject(CuraApiService);\r\n private elementRef = inject(ElementRef);\r\n\r\n project = input<string>('site');\r\n theme = input<string>('default');\r\n disclaimer = input<string>('');\r\n linkPrivacyFooter = input<string>('');\r\n logo = input<any>(null);\r\n partnerLogo = input<any>(null);\r\n phone = input<string>('');\r\n socialMenu = input<MenuSocialMedia[]>([]);\r\n logoWidth = input<number>(72);\r\n footerMenu = input<MenuItem[]>([]);\r\n\r\n footerPrivacyClick = output<Event>();\r\n footerCookieClick = output<Event>();\r\n footerSocialMediaClick = output<Event>();\r\n footerMenuItemClick = output<Event>();\r\n\r\n currentYear: number = new Date().getFullYear();\r\n\r\n // Computed signals\r\n public assetsPath = computed(() => this.curaApiService.localAssetsPath());\r\n\r\n constructor() {\r\n effect(() => {\r\n this.updateFooterTheme();\r\n });\r\n\r\n effect(() => {\r\n this.updateLogoWidth();\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n this.updateFooterTheme();\r\n }\r\n\r\n private updateLogoWidth() {\r\n this.elementRef.nativeElement.style.setProperty('--logo-width', `${this.logoWidth()}px`);\r\n }\r\n\r\n private updateFooterTheme() {\r\n const footerTheme: FooterTheme = getFooterTheme(this.project(), this.theme(), this.curaApiService);\r\n Object.entries(footerTheme).forEach(([key, value]) => {\r\n Object.entries(value).forEach(([prop, val]) => {\r\n const cssVar = `--${key}-${prop}`;\r\n this.elementRef.nativeElement.style.setProperty(cssVar, val as string);\r\n });\r\n });\r\n }\r\n\r\n footerSocialMediaClicked(event: Event) {\r\n this.footerSocialMediaClick.emit(event);\r\n }\r\n\r\n toggleSubMenu(event: Event, menu: Partial<MenuItem>) {\r\n event.stopPropagation();\r\n menu.active = !menu.active;\r\n }\r\n\r\n footerMenuItemClicked(event: Event) {\r\n this.footerMenuItemClick.emit(event);\r\n }\r\n\r\n footerPrivacyClicked(event: Event) {\r\n this.footerPrivacyClick.emit(event);\r\n }\r\n\r\n footerCookieClicked(event: Event) {\r\n this.footerCookieClick.emit(event);\r\n }\r\n}\r\n","<div class=\"sl-ftr-content\">\r\n <div>\r\n <div class=\"sl-ftr-contact\">\r\n @if (logo()) {\r\n <div class=\"logo\">\r\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (partnerLogo()) {\r\n <div class=\"partner-logo\">\r\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\r\n </div>\r\n }\r\n @if (phone()) {\r\n <div class=\"phone\">\r\n <a rdsitelink href=\"tel:{{ phone() }}\">\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\r\n </svg>\r\n {{ phone() }}\r\n </a>\r\n </div>\r\n }\r\n </div>\r\n\r\n <nav class=\"sl-ftr-medias\">\r\n <ul>\r\n @for (social of socialMenu(); track social.title) {\r\n <li>\r\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\r\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\r\n </svg>\r\n </a>\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n\r\n <div class=\"content-menu\">\r\n @if (footerMenu().length) {\r\n <div class=\"sl-ftr-menu\">\r\n <nav>\r\n <ul class=\"sl-ftr-menu-list\">\r\n @for (menu of footerMenu(); track menu.title) {\r\n <li class=\"sl-ftr-menu-list-item\">\r\n @if (menu.title) {\r\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\r\n <a\r\n class=\"sl-ftr-menu-item-link\"\r\n [href]=\"menu.url\"\r\n rdsitelink\r\n [title]=\"menu.title\"\r\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\r\n >\r\n {{ menu.title }}\r\n </a>\r\n\r\n @if (menu.children?.length) {\r\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\r\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\r\n </svg>\r\n }\r\n </div>\r\n\r\n @if (menu.children?.length) {\r\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\r\n @for (submenu of menu.children; track submenu.title) {\r\n <li class=\"sl-ftr-menu-item-children-item\">\r\n <div class=\"sl-ftr-menu-item alt\">\r\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\r\n {{ submenu.title }}\r\n </a>\r\n </div>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n }\r\n </li>\r\n }\r\n </ul>\r\n </nav>\r\n </div>\r\n }\r\n </div>\r\n</div>\r\n\r\n<div class=\"sl-ftr-disc\">\r\n <div class=\"disc-content\">\r\n <div class=\"disc-content-copy\">©{{ currentYear }} {{ disclaimer() }}</div>\r\n <ul class=\"disc-content-links\">\r\n <li>\r\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\r\n </li>\r\n <li>\r\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,cAAc,GAAG,CAAC,OAAA,GAAkB,MAAM,EAAE,UAAA,GAAqB,SAAS,EAAE,cAA8B,KAAI;AACzH,IAAA,MAAM,KAAK,GAAgB;AACzB,QAAA,GAAG,EAAE,EAAE;AACP,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,YAAY,EAAE,EAAE;KACjB;IAED,MAAM,CAAC,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,GAAG;QACjE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACvD,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;QACrD,cAAc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,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,sBAAA,EAAA,wBAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECf5B,kzIAsGA,EAAA,MAAA,EAAA,CAAA,kvKAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,ED5FY,YAAY,6HAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,uBAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAKhC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAR3B,SAAS;+BAEE,gBAAgB,EAAA,OAAA,EACjB,CAAC,YAAY,EAAE,mBAAmB,CAAC,EAAA,aAAA,EAC7B,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,kzIAAA,EAAA,MAAA,EAAA,CAAA,kvKAAA,CAAA,EAAA;;;AEXvC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-footer.mjs","sources":["../../../projects/site-front-end-lib/components/footer/helpers/footerTheme.func.ts","../../../projects/site-front-end-lib/components/footer/footer.component.ts","../../../projects/site-front-end-lib/components/footer/footer.component.html","../../../projects/site-front-end-lib/components/footer/rededor-site-front-end-lib-components-footer.ts"],"sourcesContent":["import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { FooterTheme } from '../models/FooterTheme.model';\r\n\r\nexport const getFooterTheme = (project: string = 'site', themeStyle: string = 'default', curaApiService: CuraApiService) => {\r\n const theme: FooterTheme = {\r\n ftr: {},\r\n 'ftr-disc': {},\r\n 'ftr-menu': {},\r\n 'ftr-social': {},\r\n };\r\n\r\n const [primaryLighter, primaryLight, primaryBase, primaryDarker] = [\r\n curaApiService.theme.colors.getColor('primary-lighter'),\r\n curaApiService.theme.colors.getColor('primary-light'),\r\n curaApiService.theme.colors.getColor('primary-base'),\r\n curaApiService.theme.colors.getColor('primary-darker'),\r\n ];\r\n const [accentLight, accentBase] = [curaApiService.theme.colors.getColor('accent-light'), curaApiService.theme.colors.getColor('accent-base')];\r\n const [neutralPurewhite, neutralWhite, neutralBlack] = [\r\n curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n curaApiService.theme.colors.getColor('neutral-white'),\r\n curaApiService.theme.colors.getColor('neutral-black'),\r\n ];\r\n\r\n switch (project) {\r\n case 'site':\r\n if (themeStyle === 'default') {\r\n theme.ftr = {\r\n 'bg-color': primaryDarker,\r\n color: neutralWhite,\r\n 'alt-color': primaryLighter,\r\n };\r\n theme['ftr-disc'] = {\r\n 'bg-color': neutralPurewhite,\r\n color: neutralBlack,\r\n 'alt-color': primaryBase,\r\n };\r\n theme['ftr-menu'] = {\r\n 'hover-color': accentLight,\r\n 'active-color': accentBase,\r\n 'alt-hover-color': primaryLight,\r\n 'alt-active-color': primaryBase,\r\n };\r\n theme['ftr-social'] = {\r\n color: neutralWhite,\r\n };\r\n } else {\r\n theme.ftr = {\r\n 'bg-color': primaryDarker,\r\n color: neutralWhite,\r\n 'alt-color': primaryLighter,\r\n };\r\n theme['ftr-disc'] = {\r\n 'bg-color': neutralPurewhite,\r\n color: neutralBlack,\r\n 'alt-color': primaryBase,\r\n };\r\n theme['ftr-menu'] = {\r\n 'hover-color': accentLight,\r\n 'active-color': accentBase,\r\n 'alt-hover-color': primaryLight,\r\n 'alt-active-color': primaryBase,\r\n };\r\n theme['ftr-social'] = {\r\n color: neutralWhite,\r\n };\r\n }\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n\r\n return theme;\r\n};\r\n","import { Component, ElementRef, AfterViewInit, ViewEncapsulation, input, output, inject, effect, computed } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { PrivacyToolsService, LIB_CONFIG, LibConfig, RdsiteLinkDirective, MenuItem, MenuSocialMedia } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { FooterTheme } from './models/FooterTheme.model';\nimport { getFooterTheme } from './helpers/footerTheme.func';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'footer[sl-ftr]',\n imports: [CommonModule, RdsiteLinkDirective],\n encapsulation: ViewEncapsulation.None,\n templateUrl: './footer.component.html',\n styleUrl: './footer.component.scss',\n})\nexport class FooterComponent implements AfterViewInit {\n public privacyTools = inject(PrivacyToolsService);\n private curaApiService = inject(CuraApiService);\n private elementRef = inject(ElementRef);\n\n project = input<string>('site');\n theme = input<string>('default');\n disclaimer = input<string>('');\n linkPrivacyFooter = input<string>('');\n logo = input<any>(null);\n partnerLogo = input<any>(null);\n phone = input<string>('');\n dora = input<{ number: string; link: string; imgUrl: string }>({ number: '', link: '', imgUrl: '' });\n socialMenu = input<MenuSocialMedia[]>([]);\n logoWidth = input<number>(72);\n footerMenu = input<MenuItem[]>([]);\n\n footerPrivacyClick = output<Event>();\n footerCookieClick = output<Event>();\n footerSocialMediaClick = output<Event>();\n footerMenuItemClick = output<Event>();\n\n currentYear: number = new Date().getFullYear();\n\n // Computed signals\n public assetsPath = computed(() => this.curaApiService.localAssetsPath());\n\n constructor() {\n effect(() => {\n this.updateFooterTheme();\n });\n\n effect(() => {\n this.updateLogoWidth();\n });\n }\n\n ngAfterViewInit() {\n this.updateFooterTheme();\n }\n\n private updateLogoWidth() {\n this.elementRef.nativeElement.style.setProperty('--logo-width', `${this.logoWidth()}px`);\n }\n\n private updateFooterTheme() {\n const footerTheme: FooterTheme = getFooterTheme(this.project(), this.theme(), this.curaApiService);\n Object.entries(footerTheme).forEach(([key, value]) => {\n Object.entries(value).forEach(([prop, val]) => {\n const cssVar = `--${key}-${prop}`;\n this.elementRef.nativeElement.style.setProperty(cssVar, val as string);\n });\n });\n }\n\n footerSocialMediaClicked(event: Event) {\n this.footerSocialMediaClick.emit(event);\n }\n\n toggleSubMenu(event: Event, menu: Partial<MenuItem>) {\n event.stopPropagation();\n menu.active = !menu.active;\n }\n\n footerMenuItemClicked(event: Event) {\n this.footerMenuItemClick.emit(event);\n }\n\n footerPrivacyClicked(event: Event) {\n this.footerPrivacyClick.emit(event);\n }\n\n footerCookieClicked(event: Event) {\n this.footerCookieClick.emit(event);\n }\n}\n","<div class=\"sl-ftr-content\">\n <div>\n <div class=\"sl-ftr-contact\">\n <div class=\"logos\">\n @if (logo()) {\n <div class=\"logo\">\n <img [src]=\"logo()?.url\" [alt]=\"logo()?.alt\" [title]=\"logo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n @if (partnerLogo()) {\n <div class=\"partner-logo\">\n <img [src]=\"partnerLogo()?.url\" [alt]=\"partnerLogo()?.alt\" [title]=\"partnerLogo()?.title\" loading=\"lazy\" fetchpriority=\"low\" />\n </div>\n }\n </div>\n <div class=\"phones\">\n @if (dora().number && dora().link) {\n <div class=\"dora\">\n <div\n class=\"img\"\n [style.background-image]=\"dora().imgUrl ? 'url(' + dora().imgUrl + ')' : 'url(' + assetsPath() + '/imgs/bg_dora_whatsapp.webp)'\"\n ></div>\n <span class=\"label\">\n <p>Fale com a Dora</p>\n <a rdsitelink [href]=\"dora().link\">\n {{ dora().number }}\n </a>\n </span>\n </div>\n }\n @if (phone()) {\n <div class=\"phone\" [class.before]=\"dora().number && dora().link\">\n <div class=\"svg\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#phone'\"></use>\n </svg>\n </div>\n <span class=\"label\">\n <p>Central</p>\n <a rdsitelink href=\"tel:{{ phone() }}\">\n {{ phone() }}\n </a>\n </span>\n </div>\n }\n </div>\n </div>\n\n <nav class=\"sl-ftr-medias\">\n <ul>\n @for (social of socialMenu(); track social.title) {\n <li>\n <a [href]=\"social.link\" rdsitelink [title]=\"social.title\" (click)=\"footerSocialMediaClicked($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + social.icon\"></use>\n </svg>\n </a>\n </li>\n }\n </ul>\n </nav>\n </div>\n\n <div class=\"content-menu\">\n @if (footerMenu().length) {\n <div class=\"sl-ftr-menu\">\n <nav>\n <ul class=\"sl-ftr-menu-list\">\n @for (menu of footerMenu(); track menu.title) {\n <li class=\"sl-ftr-menu-list-item\">\n @if (menu.title) {\n <div class=\"sl-ftr-menu-item\" [ngClass]=\"{ 'have-children': menu.children?.length }\" (click)=\"toggleSubMenu($event, menu)\">\n <a\n class=\"sl-ftr-menu-item-link\"\n [href]=\"menu.url\"\n rdsitelink\n [title]=\"menu.title\"\n (click)=\"toggleSubMenu($event, menu); footerMenuItemClicked($event)\"\n >\n {{ menu.title }}\n </a>\n\n @if (menu.children?.length) {\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" preserveAspectRatio=\"xMidYMid meet\">\n <use [attr.xlink:href]=\"assetsPath() + '/icons/iconset-default.svg#' + (menu.active ? 'up' : 'down')\"></use>\n </svg>\n }\n </div>\n\n @if (menu.children?.length) {\n <ul class=\"sl-ftr-menu-item-children\" [ngClass]=\"{ closed: !menu.active }\">\n @for (submenu of menu.children; track submenu.title) {\n <li class=\"sl-ftr-menu-item-children-item\">\n <div class=\"sl-ftr-menu-item alt\">\n <a class=\"sl-ftr-menu-item-link\" [href]=\"submenu.url\" rdsitelink [title]=\"submenu.title\" (click)=\"footerMenuItemClicked($event)\">\n {{ submenu.title }}\n </a>\n </div>\n </li>\n }\n </ul>\n }\n }\n </li>\n }\n </ul>\n </nav>\n </div>\n }\n </div>\n</div>\n\n<div class=\"sl-ftr-disc\">\n <div class=\"disc-content\">\n <div class=\"disc-content-copy\">©{{ currentYear }} {{ disclaimer() }}</div>\n <ul class=\"disc-content-links\">\n <li>\n <a [href]=\"linkPrivacyFooter() || '#'\" target=\"_blank\" data-testid=\"_avisoPrivacidade\" (click)=\"footerPrivacyClicked($event)\"> Aviso de Privacidade </a>\n </li>\n <li>\n <button (click)=\"privacyTools.openCookieBanner(); footerCookieClicked($event)\" data-testid=\"_avisoCookies\">Aviso de Cookies</button>\n </li>\n </ul>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,cAAc,GAAG,CAAC,OAAA,GAAkB,MAAM,EAAE,UAAA,GAAqB,SAAS,EAAE,cAA8B,KAAI;AACzH,IAAA,MAAM,KAAK,GAAgB;AACzB,QAAA,GAAG,EAAE,EAAE;AACP,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,YAAY,EAAE,EAAE;KACjB;IAED,MAAM,CAAC,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,GAAG;QACjE,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QACvD,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;QACrD,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;QACpD,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KACvD;AACD,IAAA,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CA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AA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,sBAAA,EAAA,wBAAA,EAAA,mBAAA,EAAA,qBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECf5B,q7JA6HA,EAAA,MAAA,EAAA,CAAA,4iMAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDnHY,YAAY,6HAAE,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,uBAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAKhC,eAAe,EAAA,UAAA,EAAA,CAAA;kBAR3B,SAAS;+BAEE,gBAAgB,EAAA,OAAA,EACjB,CAAC,YAAY,EAAE,mBAAmB,CAAC,EAAA,aAAA,EAC7B,iBAAiB,CAAC,IAAI,EAAA,QAAA,EAAA,q7JAAA,EAAA,MAAA,EAAA,CAAA,4iMAAA,CAAA,EAAA;;;AEXvC;;AAEG;;;;"}
|
|
@@ -5,6 +5,7 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import { RdsiteLinkDirective } from '@rededor/site-front-end-lib/core';
|
|
6
6
|
import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
|
|
7
7
|
import { BehaviorSubject, debounceTime } from 'rxjs';
|
|
8
|
+
import { Router } from '@angular/router';
|
|
8
9
|
|
|
9
10
|
class SectionNavigationComponent {
|
|
10
11
|
onWindowResize() {
|
|
@@ -27,6 +28,7 @@ class SectionNavigationComponent {
|
|
|
27
28
|
}
|
|
28
29
|
constructor() {
|
|
29
30
|
this.curaApiService = inject(CuraApiService);
|
|
31
|
+
this.router = inject(Router);
|
|
30
32
|
this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
|
|
31
33
|
this.config = signal(undefined, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
32
34
|
this.activeSection = signal('', ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
|
|
@@ -101,15 +103,18 @@ class SectionNavigationComponent {
|
|
|
101
103
|
behavior: 'smooth',
|
|
102
104
|
});
|
|
103
105
|
}
|
|
106
|
+
getPath(sectionId) {
|
|
107
|
+
return `${this.router.url}#${sectionId}`;
|
|
108
|
+
}
|
|
104
109
|
ngOnDestroy() {
|
|
105
110
|
this.scrollToMenuAnchorSubscription?.unsubscribe();
|
|
106
111
|
}
|
|
107
112
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SectionNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
108
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: SectionNavigationComponent, isStandalone: true, selector: "nav[rdsite-section-navigation]", inputs: { navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:resize": "onWindowResize()", "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["containerEl"], descendants: true, isSignal: true }, { propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }, { propertyName: "navigationMenu", first: true, predicate: ["navigationMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
113
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", type: SectionNavigationComponent, isStandalone: true, selector: "nav[rdsite-section-navigation]", inputs: { navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:resize": "onWindowResize()", "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "containerEl", first: true, predicate: ["containerEl"], descendants: true, isSignal: true }, { propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }, { propertyName: "navigationMenu", first: true, predicate: ["navigationMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <ul #containerEl class=\"rdsite-section-navigation-menu\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n @if (section.title) {\n <li role=\"none\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n [ngClass]=\"{ active: activeSection() === section.id }\"\n >\n {{ section.title }}\n </a>\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [".rdsite-section-navigation{width:100%;position:sticky;left:0;z-index:1000;background-color:var(--neutral-purewhite);border-bottom:1px solid #b7b7b7;box-shadow:0 4px 8px 0 var(--neutral-black);padding-top:10px}.rdsite-section-navigation *{font-family:var(--font-family)}.rdsite-section-navigation-menu{box-sizing:border-box;width:90%;position:relative;max-width:1366px;margin-left:auto;margin-right:auto;display:flex}.rdsite-section-navigation-menu.full-container{width:100%;max-width:100%}@media only screen and (max-width: 1366px){.rdsite-section-navigation-menu{overflow-x:auto;white-space:nowrap}}.rdsite-section-navigation-menu li>a{text-decoration:none;padding:12px 8px;font-size:12px;font-weight:500;color:var(--neutral-dark);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:158px}@media only screen and (max-width: 1366px){.rdsite-section-navigation-menu li>a{max-width:135px}}.rdsite-section-navigation-menu li>a.active{border-radius:4px 4px 0 0!important;background-color:var(--color-base);color:var(--neutral-purewhite)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }] }); }
|
|
109
114
|
}
|
|
110
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SectionNavigationComponent, decorators: [{
|
|
111
116
|
type: Component,
|
|
112
|
-
args: [{ selector: 'nav[rdsite-section-navigation]', imports: [CommonModule, RdsiteLinkDirective], template: "<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\
|
|
117
|
+
args: [{ selector: 'nav[rdsite-section-navigation]', imports: [CommonModule, RdsiteLinkDirective], template: "<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <ul #containerEl class=\"rdsite-section-navigation-menu\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n @if (section.title) {\n <li role=\"none\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n [ngClass]=\"{ active: activeSection() === section.id }\"\n >\n {{ section.title }}\n </a>\n </li>\n }\n }\n </ul>\n</nav>\n", styles: [".rdsite-section-navigation{width:100%;position:sticky;left:0;z-index:1000;background-color:var(--neutral-purewhite);border-bottom:1px solid #b7b7b7;box-shadow:0 4px 8px 0 var(--neutral-black);padding-top:10px}.rdsite-section-navigation *{font-family:var(--font-family)}.rdsite-section-navigation-menu{box-sizing:border-box;width:90%;position:relative;max-width:1366px;margin-left:auto;margin-right:auto;display:flex}.rdsite-section-navigation-menu.full-container{width:100%;max-width:100%}@media only screen and (max-width: 1366px){.rdsite-section-navigation-menu{overflow-x:auto;white-space:nowrap}}.rdsite-section-navigation-menu li>a{text-decoration:none;padding:12px 8px;font-size:12px;font-weight:500;color:var(--neutral-dark);display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:158px}@media only screen and (max-width: 1366px){.rdsite-section-navigation-menu li>a{max-width:135px}}.rdsite-section-navigation-menu li>a.active{border-radius:4px 4px 0 0!important;background-color:var(--color-base);color:var(--neutral-purewhite)}\n"] }]
|
|
113
118
|
}], ctorParameters: () => [], propDecorators: { onWindowResize: [{
|
|
114
119
|
type: HostListener,
|
|
115
120
|
args: ['window:resize']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-section-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/section-navigation/section-navigation.component.ts","../../../projects/site-front-end-lib/components/section-navigation/section-navigation.component.html","../../../projects/site-front-end-lib/components/section-navigation/rededor-site-front-end-lib-components-section-navigation.ts"],"sourcesContent":["import {\r\n Component,\r\n Input,\r\n signal,\r\n effect,\r\n OnInit,\r\n ElementRef,\r\n HostBinding,\r\n HostListener,\r\n OnDestroy,\r\n input,\r\n output,\r\n viewChild,\r\n viewChildren,\r\n inject,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RdsiteLinkDirective, SectionNavigationData, SectionNavigationConfig } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { BehaviorSubject, debounceTime, Subscription } from 'rxjs';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-section-navigation]',\r\n imports: [CommonModule, RdsiteLinkDirective],\r\n templateUrl: './section-navigation.component.html',\r\n styleUrls: ['./section-navigation.component.scss'],\r\n})\r\nexport class SectionNavigationComponent implements OnInit, OnDestroy {\r\n private curaApiService = inject(CuraApiService);\r\n\r\n readonly sections = signal<SectionNavigationData[]>([]);\r\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\r\n readonly activeSection = signal<string>('');\r\n\r\n isMobile: boolean = window.innerWidth < 768;\r\n\r\n scrollToMenuAnchorSubscription: Subscription | null = null;\r\n scrollToMenuAnchorSubject: BehaviorSubject<string> = new BehaviorSubject('');\r\n\r\n readonly containerEl = viewChild.required<ElementRef<HTMLDivElement>>('containerEl');\r\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\r\n\r\n @HostListener('window:resize')\r\n onWindowResize(): void {\r\n this.isMobile = window.innerWidth < 768;\r\n }\r\n\r\n @HostListener('window:scroll')\r\n onWindowScroll(): void {\r\n this.windowScroll();\r\n }\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 ariaLabel = input('Navegação da página');\r\n readonly anchorAdjustment = input(0);\r\n\r\n readonly sectionChange = output<SectionNavigationData>();\r\n\r\n @HostBinding('style') styleBinding = {\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--neutral-dark': this.curaApiService.theme.colors.getColor('neutral-dark'),\r\n '--neutral-black': this.curaApiService.theme.colors.getColor('neutral-black', 0.16),\r\n '--color-base': this.curaApiService.theme.colors.getColor('primary-base'),\r\n '--font-size': this.curaApiService.theme.fonts.getSize(),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n\r\n readonly navigationMenu = viewChild.required<ElementRef<HTMLUListElement>>('navigationMenu');\r\n\r\n constructor() {\r\n effect(() => {\r\n const sections = this.sections();\r\n if (sections.length && !this.activeSection()) {\r\n this.activeSection.set(sections[0].id);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n const sections = this.sections();\r\n if (!sections.length) {\r\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\r\n }\r\n\r\n if (!this.activeSection()) {\r\n this.activeSection.set(sections[0].id);\r\n }\r\n\r\n // Usado para evitar multiplos calculos desnecessários enquanto scrolla\r\n const TIME_TO_AVOID_UNECESSARY_CALCULATIONS = 50;\r\n this.scrollToMenuAnchorSubscription = this.scrollToMenuAnchorSubject.pipe(debounceTime(TIME_TO_AVOID_UNECESSARY_CALCULATIONS)).subscribe((anchorId) => {\r\n this.scrollToMenuAnchor(anchorId);\r\n });\r\n }\r\n\r\n private windowScroll(): void {\r\n const navHeight = document.querySelector<HTMLElement>('.rdsite-section-navigation')?.getBoundingClientRect().top || 0;\r\n const pageHeaderHeight = document.querySelector<HTMLElement>('.page-header')?.getBoundingClientRect().top || 0;\r\n let selectedIndex = -1;\r\n this.sections()?.forEach((section, index) => {\r\n const menuTop = document.querySelector<HTMLElement>(`#${section.id}`)?.getBoundingClientRect().top || 0;\r\n if (menuTop) {\r\n const calc = window.scrollY - menuTop + navHeight + pageHeaderHeight;\r\n if (calc >= 0) {\r\n selectedIndex = index;\r\n if (this.sections()?.[selectedIndex]) {\r\n this.activeSection.set(this.sections()?.[selectedIndex]?.id);\r\n }\r\n }\r\n }\r\n });\r\n\r\n if (this.sections()?.[selectedIndex]) {\r\n this.scrollToMenuAnchorSubject.next(this.sections()?.[selectedIndex]?.id);\r\n }\r\n }\r\n\r\n scrollToMenuAnchor(anchorId: string): void {\r\n const anchor = this.anchorsEl().find((anchor) => anchor.nativeElement.id == `anchor-${anchorId}`);\r\n if (!anchor) return;\r\n const distanceFromTheCenterOfTheAnchor = (anchor.nativeElement.offsetLeft + anchor.nativeElement.offsetLeft + anchor?.nativeElement.offsetWidth) / 2;\r\n const containerEl = this.containerEl();\r\n const centerOfContainerEl = containerEl?.nativeElement.clientWidth / 2;\r\n const left = distanceFromTheCenterOfTheAnchor - centerOfContainerEl;\r\n containerEl.nativeElement.scrollTo({\r\n left: left,\r\n behavior: 'smooth',\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.scrollToMenuAnchorSubscription?.unsubscribe();\r\n }\r\n}\r\n","<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n <ul #containerEl class=\"rdsite-section-navigation-menu\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n @if (section.title) {\r\n <li role=\"none\">\r\n <a\r\n #anchorEl\r\n id=\"anchor-{{ section.id }}\"\r\n role=\"menuitem\"\r\n [href]=\"'#' + section.id\"\r\n rdsitelink\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 [ngClass]=\"{ active: activeSection() === section.id }\"\r\n >\r\n {{ section.title }}\r\n </a>\r\n </li>\r\n }\r\n }\r\n </ul>\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MA4Ba,0BAA0B,CAAA;IAgBrC,cAAc,GAAA;QACZ,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;IACzC;IAGA,cAAc,GAAA;QACZ,IAAI,CAAC,YAAY,EAAE;IACrB;IAEA,IACI,kBAAkB,CAAC,KAA8B,EAAA;AACnD,QAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;AAClB,YAAA,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC;QAC9E;AACA,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;AAExB,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE;AACzB,YAAA,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC;IACF;IAEA,IACI,gBAAgB,CAAC,KAA8B,EAAA;AACjD,QAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC;IACxB;AAkBA,IAAA,WAAA,GAAA;AAzDQ,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAEtC,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;AAE3C,QAAA,IAAA,CAAA,QAAQ,GAAY,MAAM,CAAC,UAAU,GAAG,GAAG;QAE3C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;gBAUqB,YAAY,EAAA,CAAA;sBAAjC,WAAW;uBAAC,OAAO;;;AE3EtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-section-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/section-navigation/section-navigation.component.ts","../../../projects/site-front-end-lib/components/section-navigation/section-navigation.component.html","../../../projects/site-front-end-lib/components/section-navigation/rededor-site-front-end-lib-components-section-navigation.ts"],"sourcesContent":["import {\n Component,\n Input,\n signal,\n effect,\n OnInit,\n ElementRef,\n HostBinding,\n HostListener,\n OnDestroy,\n input,\n output,\n viewChild,\n viewChildren,\n inject,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RdsiteLinkDirective, SectionNavigationData, SectionNavigationConfig } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { BehaviorSubject, debounceTime, Subscription } from 'rxjs';\nimport { Router } from '@angular/router';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-section-navigation]',\n imports: [CommonModule, RdsiteLinkDirective],\n templateUrl: './section-navigation.component.html',\n styleUrls: ['./section-navigation.component.scss'],\n})\nexport class SectionNavigationComponent implements OnInit, OnDestroy {\n private curaApiService = inject(CuraApiService);\n private router = inject(Router);\n\n readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n\n isMobile: boolean = window.innerWidth < 768;\n\n scrollToMenuAnchorSubscription: Subscription | null = null;\n scrollToMenuAnchorSubject: BehaviorSubject<string> = new BehaviorSubject('');\n\n readonly containerEl = viewChild.required<ElementRef<HTMLDivElement>>('containerEl');\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n\n @HostListener('window:resize')\n onWindowResize(): void {\n this.isMobile = window.innerWidth < 768;\n }\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\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 ariaLabel = input('Navegação da página');\n readonly anchorAdjustment = input(0);\n\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostBinding('style') styleBinding = {\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\n '--neutral-dark': this.curaApiService.theme.colors.getColor('neutral-dark'),\n '--neutral-black': this.curaApiService.theme.colors.getColor('neutral-black', 0.16),\n '--color-base': this.curaApiService.theme.colors.getColor('primary-base'),\n '--font-size': this.curaApiService.theme.fonts.getSize(),\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n readonly navigationMenu = viewChild.required<ElementRef<HTMLUListElement>>('navigationMenu');\n\n constructor() {\n effect(() => {\n const sections = this.sections();\n if (sections.length && !this.activeSection()) {\n this.activeSection.set(sections[0].id);\n }\n });\n }\n\n ngOnInit(): void {\n const sections = this.sections();\n if (!sections.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n\n if (!this.activeSection()) {\n this.activeSection.set(sections[0].id);\n }\n\n // Usado para evitar multiplos calculos desnecessários enquanto scrolla\n const TIME_TO_AVOID_UNECESSARY_CALCULATIONS = 50;\n this.scrollToMenuAnchorSubscription = this.scrollToMenuAnchorSubject.pipe(debounceTime(TIME_TO_AVOID_UNECESSARY_CALCULATIONS)).subscribe((anchorId) => {\n this.scrollToMenuAnchor(anchorId);\n });\n }\n\n private windowScroll(): void {\n const navHeight = document.querySelector<HTMLElement>('.rdsite-section-navigation')?.getBoundingClientRect().top || 0;\n const pageHeaderHeight = document.querySelector<HTMLElement>('.page-header')?.getBoundingClientRect().top || 0;\n let selectedIndex = -1;\n this.sections()?.forEach((section, index) => {\n const menuTop = document.querySelector<HTMLElement>(`#${section.id}`)?.getBoundingClientRect().top || 0;\n if (menuTop) {\n const calc = window.scrollY - menuTop + navHeight + pageHeaderHeight;\n if (calc >= 0) {\n selectedIndex = index;\n if (this.sections()?.[selectedIndex]) {\n this.activeSection.set(this.sections()?.[selectedIndex]?.id);\n }\n }\n }\n });\n\n if (this.sections()?.[selectedIndex]) {\n this.scrollToMenuAnchorSubject.next(this.sections()?.[selectedIndex]?.id);\n }\n }\n\n scrollToMenuAnchor(anchorId: string): void {\n const anchor = this.anchorsEl().find((anchor) => anchor.nativeElement.id == `anchor-${anchorId}`);\n if (!anchor) return;\n const distanceFromTheCenterOfTheAnchor = (anchor.nativeElement.offsetLeft + anchor.nativeElement.offsetLeft + anchor?.nativeElement.offsetWidth) / 2;\n const containerEl = this.containerEl();\n const centerOfContainerEl = containerEl?.nativeElement.clientWidth / 2;\n const left = distanceFromTheCenterOfTheAnchor - centerOfContainerEl;\n containerEl.nativeElement.scrollTo({\n left: left,\n behavior: 'smooth',\n });\n }\n\n getPath(sectionId: string): string {\n return `${this.router.url}#${sectionId}`;\n }\n\n ngOnDestroy(): void {\n this.scrollToMenuAnchorSubscription?.unsubscribe();\n }\n}\n","<nav class=\"rdsite-section-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <ul #containerEl class=\"rdsite-section-navigation-menu\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n @if (section.title) {\n <li role=\"none\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n [ngClass]=\"{ active: activeSection() === section.id }\"\n >\n {{ section.title }}\n </a>\n </li>\n }\n }\n </ul>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */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,YAAY,EAAA,CAAA;sBAAjC,WAAW;uBAAC,OAAO;;;AE7EtB;;AAEG;;;;"}
|
|
@@ -4,16 +4,20 @@ 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
|
+
import { Router } from '@angular/router';
|
|
7
8
|
|
|
8
9
|
class SidebarNavigationComponent {
|
|
9
10
|
constructor() {
|
|
10
11
|
this.curaApiService = inject(CuraApiService);
|
|
12
|
+
this.router = inject(Router);
|
|
11
13
|
this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
|
|
12
14
|
this.config = signal(undefined, ...(ngDevMode ? [{ debugName: "config" }] : []));
|
|
13
15
|
this.activeSection = signal('', ...(ngDevMode ? [{ debugName: "activeSection" }] : []));
|
|
16
|
+
this.selectedIndex = signal(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
14
17
|
this.anchorAdjustment = input(0, ...(ngDevMode ? [{ debugName: "anchorAdjustment" }] : []));
|
|
15
18
|
this.title = input('Nesta página', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
16
19
|
this.ariaLabel = input('Navegação da página', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
|
|
20
|
+
this.padding = input(-50, ...(ngDevMode ? [{ debugName: "padding" }] : []));
|
|
17
21
|
this.anchorsEl = viewChildren('anchorEl', ...(ngDevMode ? [{ debugName: "anchorsEl" }] : []));
|
|
18
22
|
this.sectionChange = output();
|
|
19
23
|
this.styleBinding = {
|
|
@@ -37,27 +41,33 @@ class SidebarNavigationComponent {
|
|
|
37
41
|
}
|
|
38
42
|
windowScroll() {
|
|
39
43
|
const pageHeaderHeight = document.querySelector('.page-header')?.offsetHeight || 0;
|
|
40
|
-
|
|
44
|
+
this.selectedIndex.set(-1);
|
|
41
45
|
this.sections()?.forEach((section, index) => {
|
|
42
46
|
const element = document.querySelector(`#${section.id}`);
|
|
43
47
|
if (!element)
|
|
44
48
|
return;
|
|
45
49
|
const elementTop = element.getBoundingClientRect().top + window.scrollY;
|
|
46
|
-
const currentScroll = window.scrollY + pageHeaderHeight;
|
|
50
|
+
const currentScroll = window.scrollY + pageHeaderHeight + this.padding();
|
|
47
51
|
if (currentScroll >= elementTop) {
|
|
48
|
-
selectedIndex
|
|
49
|
-
if (this.sections()?.[selectedIndex]) {
|
|
50
|
-
this.activeSection.set(this.sections()?.[selectedIndex]?.id);
|
|
52
|
+
this.selectedIndex.set(index);
|
|
53
|
+
if (this.sections()?.[this.selectedIndex()]) {
|
|
54
|
+
this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
58
|
}
|
|
59
|
+
getPath(sectionId) {
|
|
60
|
+
return `${this.router.url}#${sectionId}`;
|
|
61
|
+
}
|
|
62
|
+
onSectionClick(event) {
|
|
63
|
+
this.sectionChange.emit(event);
|
|
64
|
+
}
|
|
55
65
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SidebarNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
56
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", 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 }, 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\">\
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.2", 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\" has-padding=\"true\" margin-block=\"8px\" has-shadow=\"false\" type=\"solid\" color-mode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" margin-block=\"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\" margin-block=\"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()\"\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}\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"] }] }); }
|
|
57
67
|
}
|
|
58
68
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.2", ngImport: i0, type: SidebarNavigationComponent, decorators: [{
|
|
59
69
|
type: Component,
|
|
60
|
-
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\">\
|
|
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\">\n <cura-card class=\"only-mobile\" has-padding=\"true\" margin-block=\"8px\" has-shadow=\"false\" type=\"solid\" color-mode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" margin-block=\"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\" margin-block=\"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()\"\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}\n"] }]
|
|
61
71
|
}], propDecorators: { navigationSections: [{
|
|
62
72
|
type: Input,
|
|
63
73
|
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 { Component, ElementRef, Input, signal, HostListener, HostBinding, inject, input, output, viewChildren } from '@angular/core';\
|
|
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 { Component, ElementRef, Input, signal, HostListener, HostBinding, inject, input, output, viewChildren } 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';\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 {\n private readonly curaApiService = inject(CuraApiService);\n private router = inject(Router);\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\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 private windowScroll(): void {\n const pageHeaderHeight = document.querySelector<HTMLElement>('.page-header')?.offsetHeight || 0;\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 + pageHeaderHeight + 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\" has-padding=\"true\" margin-block=\"8px\" has-shadow=\"false\" type=\"solid\" color-mode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" margin-block=\"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\" margin-block=\"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()\"\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":";;;;;;;;MAca,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;AAEtB,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;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,KAAK,CAAC,qBAAqB,qDAAC;AACxC,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,CAAC,EAAE,mDAAC;AAmBpB,QAAA,IAAA,CAAA,SAAS,GAAG,YAAY,CAAgC,UAAU,qDAAC;QACnE,IAAA,CAAA,aAAa,GAAG,MAAM,EAAyB;AAOlC,QAAA,IAAA,CAAA,YAAY,GAAG;AACnC,YAAA,eAAe,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;SAC/D;AA4BF,IAAA;IAvDC,IACI,kBAAkB,CAAC,KAA8B,EAAA;AACnD,QAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;AAClB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