@rededor/site-front-end-lib 20.0.3 → 20.0.5
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/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs +49 -0
- package/fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs.map +1 -0
- package/package.json +5 -1
- package/services/transfer-state/index.d.ts +13 -0
|
@@ -79,7 +79,7 @@ class StickyNavigationComponent {
|
|
|
79
79
|
}
|
|
80
80
|
toggleOpen() {
|
|
81
81
|
this.isOpen.update((value) => !value);
|
|
82
|
-
if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment) {
|
|
82
|
+
if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment()) {
|
|
83
83
|
setTimeout(() => {
|
|
84
84
|
// Utilizo o timeout para pegar a altura do elemento depois dele aberto
|
|
85
85
|
const menuStickyOpenedHeight = this.document.querySelector('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;
|
|
@@ -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,GA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,koBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDdY,mBAAmB,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,kBAAA,EAAA,uBAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,sBAAsB,gJAAE,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAI7D,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAPrC,SAAS;AAEE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,WAChC,CAAC,mBAAmB,EAAE,sBAAsB,EAAE,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 {\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;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
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, TransferState, makeStateKey, Injectable } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class TransferStateService {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.transferState = inject(TransferState);
|
|
7
|
+
this.keys = new Map();
|
|
8
|
+
}
|
|
9
|
+
setKey(name, response) {
|
|
10
|
+
let key = this.keys.get(name);
|
|
11
|
+
if (!key) {
|
|
12
|
+
key = makeStateKey(name);
|
|
13
|
+
this.keys.set(name, key);
|
|
14
|
+
}
|
|
15
|
+
this.transferState.set(key, response);
|
|
16
|
+
}
|
|
17
|
+
getKey(name, defaultValue = null) {
|
|
18
|
+
let key = this.keys.get(name);
|
|
19
|
+
if (!key) {
|
|
20
|
+
key = makeStateKey(name);
|
|
21
|
+
this.keys.set(name, key);
|
|
22
|
+
}
|
|
23
|
+
const response = this.transferState.get(key, defaultValue);
|
|
24
|
+
return response;
|
|
25
|
+
}
|
|
26
|
+
remove(name) {
|
|
27
|
+
let key = this.keys.get(name);
|
|
28
|
+
if (!key) {
|
|
29
|
+
key = makeStateKey(name);
|
|
30
|
+
this.keys.set(name, key);
|
|
31
|
+
}
|
|
32
|
+
this.transferState.remove(key);
|
|
33
|
+
}
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, providedIn: 'root' }); }
|
|
36
|
+
}
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: TransferStateService, decorators: [{
|
|
38
|
+
type: Injectable,
|
|
39
|
+
args: [{
|
|
40
|
+
providedIn: 'root',
|
|
41
|
+
}]
|
|
42
|
+
}] });
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Generated bundle index. Do not edit.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
export { TransferStateService };
|
|
49
|
+
//# sourceMappingURL=rededor-site-front-end-lib-services-transfer-state.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-services-transfer-state.mjs","sources":["../../../projects/site-front-end-lib/services/transfer-state/transfer-state.service.ts","../../../projects/site-front-end-lib/services/transfer-state/rededor-site-front-end-lib-services-transfer-state.ts"],"sourcesContent":["import { inject, Injectable, makeStateKey, StateKey, TransferState } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TransferStateService {\n private transferState = inject(TransferState);\n\n private keys = new Map<string, StateKey<string>>();\n\n setKey(name: any, response: any | any[]) {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n this.transferState.set(key, response);\n }\n\n getKey(name: string, defaultValue: any | any[] = null): any | any[] {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n const response = this.transferState.get(key, defaultValue);\n return response;\n }\n\n remove(name: string) {\n let key = this.keys.get(name);\n if (!key) {\n key = makeStateKey(name);\n this.keys.set(name, key);\n }\n this.transferState.remove(key);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAKa,oBAAoB,CAAA;AAHjC,IAAA,WAAA,GAAA;AAIU,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;AAErC,QAAA,IAAA,CAAA,IAAI,GAAG,IAAI,GAAG,EAA4B;AA6BnD,IAAA;IA3BC,MAAM,CAAC,IAAS,EAAE,QAAqB,EAAA;QACrC,IAAI,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAC7B,IAAI,CAAC,GAAG,EAAE;AACR,YAAA,GAAG,GAAG,YAA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EAAA,CAAA;kBAHhC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rededor/site-front-end-lib",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.5",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0",
|
|
@@ -313,6 +313,10 @@
|
|
|
313
313
|
"types": "./services/ssr-loading/index.d.ts",
|
|
314
314
|
"default": "./fesm2022/rededor-site-front-end-lib-services-ssr-loading.mjs"
|
|
315
315
|
},
|
|
316
|
+
"./services/transfer-state": {
|
|
317
|
+
"types": "./services/transfer-state/index.d.ts",
|
|
318
|
+
"default": "./fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs"
|
|
319
|
+
},
|
|
316
320
|
"./services/youtube": {
|
|
317
321
|
"types": "./services/youtube/index.d.ts",
|
|
318
322
|
"default": "./fesm2022/rededor-site-front-end-lib-services-youtube.mjs"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class TransferStateService {
|
|
4
|
+
private transferState;
|
|
5
|
+
private keys;
|
|
6
|
+
setKey(name: any, response: any | any[]): void;
|
|
7
|
+
getKey(name: string, defaultValue?: any | any[]): any | any[];
|
|
8
|
+
remove(name: string): void;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TransferStateService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TransferStateService>;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { TransferStateService };
|