@rededor/site-front-end-lib 20.0.4 → 20.0.6

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.
@@ -37,6 +37,8 @@ class SectionNavigationComponent {
37
37
  this.scrollToMenuAnchorSubject = new BehaviorSubject('');
38
38
  this.containerEl = viewChild.required('containerEl');
39
39
  this.anchorsEl = viewChildren('anchorEl', ...(ngDevMode ? [{ debugName: "anchorsEl" }] : []));
40
+ this.padding = input(0, ...(ngDevMode ? [{ debugName: "padding" }] : []));
41
+ this.headerClass = input('.page-header', ...(ngDevMode ? [{ debugName: "headerClass" }] : []));
40
42
  this.ariaLabel = input('Navegação da página', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
41
43
  this.anchorAdjustment = input(0, ...(ngDevMode ? [{ debugName: "anchorAdjustment" }] : []));
42
44
  this.sectionChange = output();
@@ -72,12 +74,12 @@ class SectionNavigationComponent {
72
74
  }
73
75
  windowScroll() {
74
76
  const navHeight = document.querySelector('.rdsite-section-navigation')?.getBoundingClientRect().top || 0;
75
- const pageHeaderHeight = document.querySelector('.page-header')?.getBoundingClientRect().top || 0;
77
+ const pageHeaderHeight = document.querySelector(this.headerClass())?.getBoundingClientRect().top || 0;
76
78
  let selectedIndex = -1;
77
79
  this.sections()?.forEach((section, index) => {
78
80
  const menuTop = document.querySelector(`#${section.id}`)?.getBoundingClientRect().top || 0;
79
81
  if (menuTop) {
80
- const calc = window.scrollY - menuTop + navHeight + pageHeaderHeight;
82
+ const calc = window.scrollY - menuTop + navHeight + pageHeaderHeight + this.padding();
81
83
  if (calc >= 0) {
82
84
  selectedIndex = index;
83
85
  if (this.sections()?.[selectedIndex]) {
@@ -110,7 +112,7 @@ class SectionNavigationComponent {
110
112
  this.scrollToMenuAnchorSubscription?.unsubscribe();
111
113
  }
112
114
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SectionNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
113
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", 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\">\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]=\"getPath(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", 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"] }] }); }
115
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SectionNavigationComponent, isStandalone: true, selector: "nav[rdsite-section-navigation]", inputs: { padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", 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 }, 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\">\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]=\"getPath(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", 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"] }] }); }
114
116
  }
115
117
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SectionNavigationComponent, decorators: [{
116
118
  type: Component,
@@ -121,7 +123,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
121
123
  }], onWindowScroll: [{
122
124
  type: HostListener,
123
125
  args: ['window:scroll']
124
- }], navigationSections: [{
126
+ }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], headerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerClass", required: false }] }], navigationSections: [{
125
127
  type: Input,
126
128
  args: [{ required: true }]
127
129
  }], navigationConfig: [{
@@ -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\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-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 private router = inject(Router);\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 getPath(sectionId: string): string {\r\n return `${this.router.url}#${sectionId}`;\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]=\"getPath(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":";;;;;;;;;MA6Ba,0BAA0B,CAAA;IAiBrC,cAAc,GAAA;QACZ,IAAI,CAAC,QAA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AQ,EAAE,IAAI,EAAE;;sBAYxB;;sBAUA,WAAW;uBAAC,OAAO;8DASuD,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEtF7F;;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 {\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\nimport { Router } from '@angular/router';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-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 private router = inject(Router);\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 readonly padding = input(0);\r\n readonly headerClass = input('.page-header');\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>(this.headerClass())?.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 + this.padding();\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 getPath(sectionId: string): string {\r\n return `${this.router.url}#${sectionId}`;\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]=\"getPath(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":";;;;;;;;;MA6Ba,0BAA0B,CAAA;IAiBrC,cAAc,GAAA;QACZ,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,GAAG,GAAG;IACzC;IAGA,cAAc,GAAA;QACZ,IAAI,CAAC,YAAY,EAAE;IACrB;IAIA,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;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QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExF7F;;AAEG;;;;"}
@@ -5,12 +5,13 @@ import { CuraCardComponent } from '@rededor/site-front-end-lib/cura/cards/cura-c
5
5
  import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
6
6
  import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
7
7
  import { Router } from '@angular/router';
8
- import { isPlatformBrowser } from '@angular/common';
8
+ import { Location, isPlatformBrowser } from '@angular/common';
9
9
 
10
10
  class SidebarNavigationComponent {
11
11
  constructor() {
12
12
  this.curaApiService = inject(CuraApiService);
13
13
  this.router = inject(Router);
14
+ this.location = inject(Location);
14
15
  this.platformId = inject(PLATFORM_ID);
15
16
  this.document = inject(DOCUMENT);
16
17
  this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
@@ -68,18 +69,23 @@ class SidebarNavigationComponent {
68
69
  }
69
70
  });
70
71
  }
72
+ getBasePath() {
73
+ const base = this.location.prepareExternalUrl('');
74
+ const normalized = base.replace(/\/$/, '');
75
+ return normalized === '' || normalized === '/' ? '' : normalized;
76
+ }
71
77
  getPath(sectionId) {
72
- return `${this.router.url}#${sectionId}`;
78
+ return `${this.getBasePath}${this.router.url}#${sectionId}`;
73
79
  }
74
80
  onSectionClick(event) {
75
81
  this.sectionChange.emit(event);
76
82
  }
77
83
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SidebarNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
78
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SidebarNavigationComponent, isStandalone: true, selector: "nav[rdsite-sidebar-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraCardComponent, selector: "cura-card", inputs: ["hasPadding", "hasShadow", "type", "colorMode", "href", "target"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }] }); }
84
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: SidebarNavigationComponent, isStandalone: true, selector: "nav[rdsite-sidebar-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\r\n @if (title()) {\r\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n }\r\n <ul role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n #anchorEl\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sidebar-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n rdsitelink\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>\r\n {{ section.title }}\r\n </b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n </cura-card>\r\n</nav>\r\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraCardComponent, selector: "cura-card", inputs: ["hasPadding", "hasShadow", "type", "colorMode", "href", "target"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }] }); }
79
85
  }
80
86
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SidebarNavigationComponent, decorators: [{
81
87
  type: Component,
82
- args: [{ selector: 'nav[rdsite-sidebar-navigation]', imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent], template: "<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"] }]
88
+ 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\">\r\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\r\n @if (title()) {\r\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n }\r\n <ul role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n #anchorEl\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sidebar-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n rdsitelink\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>\r\n {{ section.title }}\r\n </b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n </cura-card>\r\n</nav>\r\n", styles: ["nav *{font-family:var(--font-family)}nav ul{display:flex;flex-direction:column}nav ul li{width:100%}nav ul li cura-paragraph,nav ul li a{text-align:left}nav ul li a{color:unset;text-decoration:none}\n"] }]
83
89
  }], propDecorators: { anchorAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorAdjustment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], navigationSections: [{
84
90
  type: Input,
85
91
  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 {\n Component,\n ElementRef,\n Input,\n signal,\n HostListener,\n HostBinding,\n inject,\n input,\n output,\n viewChildren,\n DOCUMENT,\n PLATFORM_ID,\n AfterViewInit,\n} from '@angular/core';\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\nimport { CuraCardComponent } from '@rededor/site-front-end-lib/cura/cards/cura-card';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { Router } from '@angular/router';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-sidebar-navigation]',\n imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent],\n templateUrl: './sidebar-navigation.component.html',\n styleUrl: './sidebar-navigation.component.scss',\n})\nexport class SidebarNavigationComponent implements AfterViewInit {\n private readonly curaApiService = inject(CuraApiService);\n private router = inject(Router);\n private platformId = inject(PLATFORM_ID);\n private document = inject<Document>(DOCUMENT);\n\n readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n public selectedIndex = signal<number>(0);\n public defaultAnchorAdjustment = signal(0);\n\n private menuHeaderHeight = 0;\n\n readonly anchorAdjustment = input(0);\n readonly title = input('Nesta página');\n readonly ariaLabel = input('Navegação da página');\n readonly padding = input(-50);\n\n @Input({ required: true })\n set navigationSections(value: SectionNavigationData[]) {\n if (!value?.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n this.sections.set(value);\n\n if (!this.activeSection()) {\n this.activeSection.set(value[0].id);\n }\n }\n\n @Input()\n set navigationConfig(value: SectionNavigationConfig) {\n this.config.set(value);\n }\n\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\n\n @HostBinding('style') styleBinding = {\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n ngAfterViewInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n setTimeout(() => {\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\n this.defaultAnchorAdjustment.set(this.menuHeaderHeight + (this.padding() - 1));\n }, 200);\n }\n }\n\n private windowScroll(): void {\n this.selectedIndex.set(-1);\n\n this.sections()?.forEach((section, index) => {\n const element = document.querySelector<HTMLElement>(`#${section.id}`);\n if (!element) return;\n\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.padding();\n if (currentScroll >= elementTop) {\n this.selectedIndex.set(index);\n if (this.sections()?.[this.selectedIndex()]) {\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\n }\n }\n });\n }\n\n getPath(sectionId: string): string {\n return `${this.router.url}#${sectionId}`;\n }\n\n onSectionClick(event: SectionNavigationData) {\n this.sectionChange.emit(event);\n }\n}\n","<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\n @if (title()) {\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n }\n <ul role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n #anchorEl\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sidebar-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n rdsitelink\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>\n {{ section.title }}\n </b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n </cura-card>\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAChD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAW,QAAQ,CAAC;AAEpC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAA0B,EAAE,oDAAC;AAC9C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsC,SAAS,kDAAC;AAC/D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,EAAE,yDAAC;AACpC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,yDAAC;AACjC,QAAA,IAAA,CAAA,uBAAuB,GAAG,MAAM,CAAC,CAAC,mEAAC;QAElC,IAAA,CAAA,gBAAgB,GAAG,CAAC;AAEnB,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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A,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDRY,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,uBAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,iBAAiB,kIAAE,sBAAsB,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,WAAA,EAAA,OAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI7D,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gCAAgC,WACjC,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,EAAA,QAAA,EAAA,86CAAA,EAAA,MAAA,EAAA,CAAA,0MAAA,CAAA,EAAA;;sBAuBxE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAYxB;4DAKgE,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AEzEtB;;AAEG;;;;"}
1
+ {"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 {\r\n Component,\r\n ElementRef,\r\n Input,\r\n signal,\r\n HostListener,\r\n HostBinding,\r\n inject,\r\n input,\r\n output,\r\n viewChildren,\r\n DOCUMENT,\r\n PLATFORM_ID,\r\n AfterViewInit,\r\n} from '@angular/core';\r\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\r\nimport { CuraCardComponent } from '@rededor/site-front-end-lib/cura/cards/cura-card';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { Router } from '@angular/router';\r\nimport { isPlatformBrowser, Location } from '@angular/common';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-sidebar-navigation]',\r\n imports: [RdsiteLinkDirective, CuraCardComponent, CuraParagraphComponent],\r\n templateUrl: './sidebar-navigation.component.html',\r\n styleUrl: './sidebar-navigation.component.scss',\r\n})\r\nexport class SidebarNavigationComponent implements AfterViewInit {\r\n private readonly curaApiService = inject(CuraApiService);\r\n private router = inject(Router);\r\n private location = inject(Location);\r\n private platformId = inject(PLATFORM_ID);\r\n private document = inject<Document>(DOCUMENT);\r\n\r\n readonly sections = signal<SectionNavigationData[]>([]);\r\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\r\n readonly activeSection = signal<string>('');\r\n public selectedIndex = signal<number>(0);\r\n public defaultAnchorAdjustment = signal(0);\r\n\r\n private menuHeaderHeight = 0;\r\n\r\n readonly anchorAdjustment = input(0);\r\n readonly title = input('Nesta página');\r\n readonly ariaLabel = input('Navegação da página');\r\n readonly padding = input(-50);\r\n\r\n @Input({ required: true })\r\n set navigationSections(value: SectionNavigationData[]) {\r\n if (!value?.length) {\r\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\r\n }\r\n this.sections.set(value);\r\n\r\n if (!this.activeSection()) {\r\n this.activeSection.set(value[0].id);\r\n }\r\n }\r\n\r\n @Input()\r\n set navigationConfig(value: SectionNavigationConfig) {\r\n this.config.set(value);\r\n }\r\n\r\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\r\n readonly sectionChange = output<SectionNavigationData>();\r\n\r\n @HostListener('window:scroll')\r\n onWindowScroll(): void {\r\n this.windowScroll();\r\n }\r\n\r\n @HostBinding('style') styleBinding = {\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n\r\n ngAfterViewInit(): void {\r\n if (isPlatformBrowser(this.platformId)) {\r\n setTimeout(() => {\r\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\r\n this.defaultAnchorAdjustment.set(this.menuHeaderHeight + (this.padding() - 1));\r\n }, 200);\r\n }\r\n }\r\n\r\n private windowScroll(): void {\r\n this.selectedIndex.set(-1);\r\n\r\n this.sections()?.forEach((section, index) => {\r\n const element = document.querySelector<HTMLElement>(`#${section.id}`);\r\n if (!element) return;\r\n\r\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\r\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.padding();\r\n if (currentScroll >= elementTop) {\r\n this.selectedIndex.set(index);\r\n if (this.sections()?.[this.selectedIndex()]) {\r\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getBasePath(): string {\r\n const base = this.location.prepareExternalUrl('');\r\n const normalized = base.replace(/\\/$/, '');\r\n\r\n return normalized === '' || normalized === '/' ? '' : normalized;\r\n }\r\n\r\n getPath(sectionId: string): string {\r\n return `${this.getBasePath}${this.router.url}#${sectionId}`;\r\n }\r\n\r\n onSectionClick(event: SectionNavigationData) {\r\n this.sectionChange.emit(event);\r\n }\r\n}\r\n","<nav class=\"rdsite-sidebar-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n <cura-card class=\"only-mobile\" [hasPadding]=\"true\" marginBlock=\"8px\" [hasShadow]=\"false\" type=\"solid\" colorMode=\"light\" target=\"_self\">\r\n @if (title()) {\r\n <cura-paragraph size=\"small\" color=\"neutral-black\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n }\r\n <ul role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n #anchorEl\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sidebar-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n rdsitelink\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>\r\n {{ section.title }}\r\n </b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n </cura-card>\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,0BAA0B,CAAA;AAPvC,IAAA,WAAA,GAAA;AAQmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAChD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAW,QAAQ,CAAC;AAEpC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAA0B,EAAE,oDAAC;AAC9C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsC,SAAS,kDAAC;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,EAAA,cAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI7D,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gCAAgC,WACjC,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,sBAAsB,CAAC,EAAA,QAAA,EAAA,g/CAAA,EAAA,MAAA,EAAA,CAAA,0MAAA,CAAA,EAAA;;sBAwBxE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAYxB;4DAKgE,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AE1EtB;;AAEG;;;;"}
@@ -5,12 +5,13 @@ import { CuraApiService } from '@rededor/site-front-end-lib/cura/api';
5
5
  import { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';
6
6
  import { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';
7
7
  import { Router } from '@angular/router';
8
- import { isPlatformBrowser } from '@angular/common';
8
+ import { Location, isPlatformBrowser } from '@angular/common';
9
9
 
10
10
  class StickyNavigationComponent {
11
11
  constructor() {
12
12
  this.curaApiService = inject(CuraApiService);
13
13
  this.router = inject(Router);
14
+ this.location = inject(Location);
14
15
  this.platformId = inject(PLATFORM_ID);
15
16
  this.document = inject(DOCUMENT);
16
17
  this.sections = signal([], ...(ngDevMode ? [{ debugName: "sections" }] : []));
@@ -70,8 +71,13 @@ class StickyNavigationComponent {
70
71
  }
71
72
  });
72
73
  }
74
+ getBasePath() {
75
+ const base = this.location.prepareExternalUrl('');
76
+ const normalized = base.replace(/\/$/, '');
77
+ return normalized === '' || normalized === '/' ? '' : normalized;
78
+ }
73
79
  getPath(sectionId) {
74
- return `${this.router.url}#${sectionId}`;
80
+ return `${this.getBasePath}${this.router.url}#${sectionId}`;
75
81
  }
76
82
  onSectionClick(event) {
77
83
  this.sectionChange.emit(event);
@@ -79,7 +85,7 @@ class StickyNavigationComponent {
79
85
  }
80
86
  toggleOpen() {
81
87
  this.isOpen.update((value) => !value);
82
- if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment) {
88
+ if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment()) {
83
89
  setTimeout(() => {
84
90
  // Utilizo o timeout para pegar a altura do elemento depois dele aberto
85
91
  const menuStickyOpenedHeight = this.document.querySelector('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;
@@ -88,11 +94,11 @@ class StickyNavigationComponent {
88
94
  }
89
95
  }
90
96
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StickyNavigationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
91
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: StickyNavigationComponent, isStandalone: true, selector: "nav[rdsite-sticky-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }] }); }
97
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: StickyNavigationComponent, isStandalone: true, selector: "nav[rdsite-sticky-navigation]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, padding: { classPropertyName: "padding", publicName: "padding", isSignal: true, isRequired: false, transformFunction: null }, navigationSections: { classPropertyName: "navigationSections", publicName: "navigationSections", isSignal: false, isRequired: true, transformFunction: null }, navigationConfig: { classPropertyName: "navigationConfig", publicName: "navigationConfig", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { sectionChange: "sectionChange" }, host: { listeners: { "window:scroll": "onWindowScroll()" }, properties: { "style": "this.styleBinding" } }, viewQueries: [{ propertyName: "anchorsEl", predicate: ["anchorEl"], descendants: true, isSignal: true }], ngImport: i0, template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n @if (title()) {\r\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\r\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\r\n </div>\r\n @if (sections().length && !isOpen()) {\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\r\n <b>{{ sections()[selectedIndex()].title }}</b>\r\n </cura-paragraph>\r\n }\r\n }\r\n\r\n @if (isOpen()) {\r\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sticky-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n rdsitelink\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>{{ section.title }}</b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</nav>\r\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"], dependencies: [{ kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraParagraphComponent, selector: "cura-paragraph", inputs: ["size", "spotColor", "color", "marginBlock", "lineHeight", "textOverflow"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }] }); }
92
98
  }
93
99
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: StickyNavigationComponent, decorators: [{
94
100
  type: Component,
95
- args: [{ selector: 'nav[rdsite-sticky-navigation]', imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent], template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"] }]
101
+ args: [{ selector: 'nav[rdsite-sticky-navigation]', imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent], template: "<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n @if (title()) {\r\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\r\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\r\n </div>\r\n @if (sections().length && !isOpen()) {\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\r\n <b>{{ sections()[selectedIndex()].title }}</b>\r\n </cura-paragraph>\r\n }\r\n }\r\n\r\n @if (isOpen()) {\r\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sticky-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n rdsitelink\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>{{ section.title }}</b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</nav>\r\n", styles: ["nav{border-radius:2px;background:var(--neutral-purewhite);box-shadow:0 1px 4px #26262629;padding:8px 20px}nav *{font-family:var(--font-family)}nav .title-bar{display:flex;justify-content:space-between;align-items:center;cursor:pointer}nav ul.menu{display:flex;flex-direction:column;overflow:hidden;max-height:0;opacity:0;transform:scaleY(0);transform-origin:top;transition:max-height .3s ease,transform .3s ease,opacity .3s ease}nav ul.menu.open{max-height:fit-content;transform:scaleY(1);opacity:1}nav ul.menu li{width:100%}nav ul.menu li cura-paragraph,nav ul.menu li a{text-align:left}nav ul.menu li a{color:unset;text-decoration:none}\n"] }]
96
102
  }], propDecorators: { anchorAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorAdjustment", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], padding: [{ type: i0.Input, args: [{ isSignal: true, alias: "padding", required: false }] }], navigationSections: [{
97
103
  type: Input,
98
104
  args: [{ required: true }]
@@ -1 +1 @@
1
- {"version":3,"file":"rededor-site-front-end-lib-components-sticky-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n signal,\n HostListener,\n HostBinding,\n inject,\n input,\n output,\n viewChildren,\n PLATFORM_ID,\n DOCUMENT,\n AfterViewInit,\n} from '@angular/core';\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\nimport { Router } from '@angular/router';\nimport { isPlatformBrowser } from '@angular/common';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-sticky-navigation]',\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\n templateUrl: './sticky-navigation.component.html',\n styleUrl: './sticky-navigation.component.scss',\n})\nexport class StickyNavigationComponent implements AfterViewInit {\n private curaApiService = inject(CuraApiService);\n private router = inject(Router);\n private platformId = inject(PLATFORM_ID);\n private document = inject<Document>(DOCUMENT);\n\n public readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n readonly isOpen = signal<boolean>(false);\n public selectedIndex = signal<number>(0);\n public defaultAnchorAdjustment = signal(0);\n\n private menuHeaderHeight = 0;\n private menuStickyClosedHeight = 0;\n\n readonly anchorAdjustment = input(0);\n readonly title = input('Nesta página');\n readonly ariaLabel = input('Navegação da página');\n readonly padding = input(20);\n\n @Input({ required: true })\n set navigationSections(value: SectionNavigationData[]) {\n if (!value?.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n this.sections.set(value);\n\n if (!this.activeSection()) {\n this.activeSection.set(value[0].id);\n }\n }\n\n @Input()\n set navigationConfig(value: SectionNavigationConfig) {\n this.config.set(value);\n }\n\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\n\n @HostBinding('style') styleBinding = {\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n ngAfterViewInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n setTimeout(() => {\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\n this.menuStickyClosedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n }, 200);\n }\n }\n\n private windowScroll(): void {\n this.sections()?.forEach((section, index) => {\n const element = this.document.querySelector<HTMLElement>(`#${section.id}`);\n if (!element) return;\n\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();\n\n if (currentScroll >= elementTop) {\n this.selectedIndex.set(index);\n if (this.sections()?.[this.selectedIndex()]) {\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\n }\n }\n });\n }\n\n getPath(sectionId: string): string {\n return `${this.router.url}#${sectionId}`;\n }\n\n onSectionClick(event: SectionNavigationData) {\n this.sectionChange.emit(event);\n this.isOpen.update((value) => !value);\n }\n\n toggleOpen(): void {\n this.isOpen.update((value) => !value);\n if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment) {\n setTimeout(() => {\n // Utilizo o timeout para pegar a altura do elemento depois dele aberto\n const menuStickyOpenedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);\n }, 100);\n }\n }\n}\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAW,QAAQ,CAAC;AAE7B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAA0B,EAAE,oDAAC;AACrD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAsC,SAAS,kDAAC;AAC/D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,EAAE,yDAAC;AAClC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAU,KAAK,kDAAC;AACjC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAS,CAAC,yDAAC;AACjC,QAAA,IAAA,CAAA,uBAAuB,GAAG,MAAM,CAAC,CAAC,mEAAC;QAElC,IAAA,CAAA,gBAAgB,GAAG,CAAC;QACpB,IAAA,CAAA,sBAAsB,GAAG,CAAC;AAEzB,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,EAAE,mDAAC;AAmBnB,QAAA,IAAA,CAAA,SAAS,GAAG,YAAY,CAAgC,UAAU,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AE,iBAAiB,CAAC,EAAA,QAAA,EAAA,yyDAAA,EAAA,MAAA,EAAA,CAAA,koBAAA,CAAA,EAAA;;sBAyBxE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAYxB;4DAKgE,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AE3EtB;;AAEG;;;;"}
1
+ {"version":3,"file":"rededor-site-front-end-lib-components-sticky-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n signal,\r\n HostListener,\r\n HostBinding,\r\n inject,\r\n input,\r\n output,\r\n viewChildren,\r\n PLATFORM_ID,\r\n DOCUMENT,\r\n AfterViewInit,\r\n} from '@angular/core';\r\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\r\nimport { Router } from '@angular/router';\r\nimport { isPlatformBrowser, Location } from '@angular/common';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-sticky-navigation]',\r\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\r\n templateUrl: './sticky-navigation.component.html',\r\n styleUrl: './sticky-navigation.component.scss',\r\n})\r\nexport class StickyNavigationComponent implements AfterViewInit {\r\n private curaApiService = inject(CuraApiService);\r\n private router = inject(Router);\r\n private location = inject(Location);\r\n private platformId = inject(PLATFORM_ID);\r\n private document = inject<Document>(DOCUMENT);\r\n\r\n public readonly sections = signal<SectionNavigationData[]>([]);\r\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\r\n readonly activeSection = signal<string>('');\r\n readonly isOpen = signal<boolean>(false);\r\n public selectedIndex = signal<number>(0);\r\n public defaultAnchorAdjustment = signal(0);\r\n\r\n private menuHeaderHeight = 0;\r\n private menuStickyClosedHeight = 0;\r\n\r\n readonly anchorAdjustment = input(0);\r\n readonly title = input('Nesta página');\r\n readonly ariaLabel = input('Navegação da página');\r\n readonly padding = input(20);\r\n\r\n @Input({ required: true })\r\n set navigationSections(value: SectionNavigationData[]) {\r\n if (!value?.length) {\r\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\r\n }\r\n this.sections.set(value);\r\n\r\n if (!this.activeSection()) {\r\n this.activeSection.set(value[0].id);\r\n }\r\n }\r\n\r\n @Input()\r\n set navigationConfig(value: SectionNavigationConfig) {\r\n this.config.set(value);\r\n }\r\n\r\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\r\n readonly sectionChange = output<SectionNavigationData>();\r\n\r\n @HostListener('window:scroll')\r\n onWindowScroll(): void {\r\n this.windowScroll();\r\n }\r\n\r\n @HostBinding('style') styleBinding = {\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n\r\n ngAfterViewInit(): void {\r\n if (isPlatformBrowser(this.platformId)) {\r\n setTimeout(() => {\r\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\r\n this.menuStickyClosedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\r\n }, 200);\r\n }\r\n }\r\n\r\n private windowScroll(): void {\r\n this.sections()?.forEach((section, index) => {\r\n const element = this.document.querySelector<HTMLElement>(`#${section.id}`);\r\n if (!element) return;\r\n\r\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\r\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();\r\n\r\n if (currentScroll >= elementTop) {\r\n this.selectedIndex.set(index);\r\n if (this.sections()?.[this.selectedIndex()]) {\r\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getBasePath(): string {\r\n const base = this.location.prepareExternalUrl('');\r\n const normalized = base.replace(/\\/$/, '');\r\n\r\n return normalized === '' || normalized === '/' ? '' : normalized;\r\n }\r\n\r\n getPath(sectionId: string): string {\r\n return `${this.getBasePath}${this.router.url}#${sectionId}`;\r\n }\r\n\r\n onSectionClick(event: SectionNavigationData) {\r\n this.sectionChange.emit(event);\r\n this.isOpen.update((value) => !value);\r\n }\r\n\r\n toggleOpen(): void {\r\n this.isOpen.update((value) => !value);\r\n if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment()) {\r\n setTimeout(() => {\r\n // Utilizo o timeout para pegar a altura do elemento depois dele aberto\r\n const menuStickyOpenedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\r\n this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);\r\n }, 100);\r\n }\r\n }\r\n}\r\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n @if (title()) {\r\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\r\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\r\n </div>\r\n @if (sections().length && !isOpen()) {\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\r\n <b>{{ sections()[selectedIndex()].title }}</b>\r\n </cura-paragraph>\r\n }\r\n }\r\n\r\n @if (isOpen()) {\r\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sticky-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n rdsitelink\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>{{ section.title }}</b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AA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