ngx-fixed-footer 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
> Angular directive that adds fixed footer without overlap
|
|
16
16
|
|
|
17
|
-
> ✓ _Angular
|
|
17
|
+
> ✓ _Angular 21 compatible_
|
|
18
18
|
|
|
19
19
|
Here's the [demo](http://celtian.github.io/ngx-fixed-footer/) or [stackblitz live preview](https://stackblitz.com/edit/ngx-fixed-footer) or [codesandbox live preview](https://codesandbox.io/s/ngx-fixed-footer-m4f21)
|
|
20
20
|
|
|
@@ -106,15 +106,15 @@ class NgxFixedFooterDirective {
|
|
|
106
106
|
get html() {
|
|
107
107
|
return this.el.nativeElement;
|
|
108
108
|
}
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
110
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
109
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgxFixedFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
110
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", type: NgxFixedFooterDirective, isStandalone: true, selector: "[ngxFixedFooter]", inputs: { containerSelector: { classPropertyName: "containerSelector", publicName: "containerSelector", isSignal: true, isRequired: false, transformFunction: null }, cssAttribute: { classPropertyName: "cssAttribute", publicName: "cssAttribute", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
111
111
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
|
|
113
113
|
type: Directive,
|
|
114
114
|
args: [{
|
|
115
115
|
selector: '[ngxFixedFooter]'
|
|
116
116
|
}]
|
|
117
|
-
}], ctorParameters: () => [] });
|
|
117
|
+
}], ctorParameters: () => [], propDecorators: { containerSelector: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerSelector", required: false }] }], cssAttribute: [{ type: i0.Input, args: [{ isSignal: true, alias: "cssAttribute", required: false }] }] } });
|
|
118
118
|
|
|
119
119
|
/*
|
|
120
120
|
* Public API Surface of ngx-fixed-footer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-fixed-footer.mjs","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.provider.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["import { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\nexport const DEFAULT_FIXED_FOOTER_OPTIONS: NgxFixedFooterOptions = {\n containerSelector: DEFAULT_CONTAINER_SELECTOR,\n cssAttribute: DEFAULT_CSS_ATTRIBUTE\n};\n","import { InjectionToken, Provider } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const APP_FIXED_FOOTER_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>('[ngxFixedFooter] Options');\n\nexport const provideFixedFooter = (options: Partial<NgxFixedFooterOptions>): Provider => {\n return {\n provide: APP_FIXED_FOOTER_OPTIONS_TOKEN,\n useValue: {\n cssAttribute: options.cssAttribute || DEFAULT_CSS_ATTRIBUTE,\n containerSelector: options.containerSelector || DEFAULT_CONTAINER_SELECTOR\n }\n };\n};\n","import {\n DOCUMENT,\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n computed,\n effect,\n inject,\n input,\n signal\n} from '@angular/core';\nimport { DEFAULT_FIXED_FOOTER_OPTIONS } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute, NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\nimport { APP_FIXED_FOOTER_OPTIONS_TOKEN } from './ngx-fixed-footer.provider';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements OnDestroy, OnInit {\n private readonly document = inject(DOCUMENT);\n private readonly el = inject(ElementRef);\n private readonly render = inject(Renderer2);\n private options: NgxFixedFooterOptions =\n inject(APP_FIXED_FOOTER_OPTIONS_TOKEN, { optional: true }) || DEFAULT_FIXED_FOOTER_OPTIONS;\n private readonly hasResizeObserver = typeof ResizeObserver !== 'undefined';\n private resizeObserver?: ResizeObserver;\n\n private offsetHeight = signal<number | undefined>(undefined);\n private prevContainerSelector = signal<string | undefined>(undefined);\n\n public containerSelector = input<string>(this.options.containerSelector);\n public cssAttribute = input<NgxFixedFooterCssAttribute>(this.options.cssAttribute);\n\n private container = computed(() => {\n const selector = this.containerSelector() || this.options.containerSelector;\n return this.document.body.querySelector<HTMLElement>(selector);\n });\n\n constructor() {\n // swap selector\n effect(() => {\n if (!this.hasResizeObserver || !this.document) return;\n const containerSelector = this.containerSelector();\n const offsetHeight = this.offsetHeight();\n if (!containerSelector || typeof offsetHeight !== 'number') return;\n const cssAttribute = this.cssAttribute();\n const prevContainerSelector = this.prevContainerSelector();\n if (prevContainerSelector && prevContainerSelector !== containerSelector) {\n const prevContainer = this.document.body.querySelector<HTMLElement>(prevContainerSelector);\n if (prevContainer) {\n this.removeStyle(prevContainer, cssAttribute);\n }\n }\n const container = this.document.body.querySelector<HTMLElement>(containerSelector);\n if (container) {\n this.setStyle(container, cssAttribute, offsetHeight);\n this.prevContainerSelector.set(containerSelector);\n }\n });\n\n // swap css attribute\n effect(() => {\n if (!this.hasResizeObserver || !this.document) return;\n const container = this.container();\n const offsetHeight = this.offsetHeight();\n if (!container || typeof offsetHeight !== 'number') return;\n const cssAttribute = this.cssAttribute();\n this.removeStyle(container, cssAttribute === 'padding' ? 'margin' : 'padding');\n this.setStyle(container, cssAttribute, offsetHeight);\n });\n }\n\n public ngOnInit(): void {\n if (this.hasResizeObserver && this.document) {\n this.resizeObserver = new ResizeObserver(() => this.checkHeight());\n this.resizeObserver.observe(this.html);\n }\n }\n\n public ngOnDestroy(): void {\n const container = this.container();\n if (this.resizeObserver && this.document && container) {\n this.removeStyle(container, this.cssAttribute());\n this.resizeObserver.unobserve(this.html);\n }\n }\n\n private checkHeight(): void {\n const height = this.html.offsetHeight;\n const container = this.container();\n if (this.offsetHeight() !== height && container) {\n this.setStyle(container, this.cssAttribute(), height);\n this.offsetHeight.set(height);\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n if (!container) {\n throw new Error(`Cannot removeStyle to undefined container`);\n }\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n if (!container) {\n throw new Error(`Cannot setStyle to undefined container`);\n }\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer.constants';\nexport * from './lib/ngx-fixed-footer.directive';\nexport * from './lib/ngx-fixed-footer.interface';\nexport * from './lib/ngx-fixed-footer.provider';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG;AAC9B,MAAM,0BAA0B,GAAG;AAC7B,MAA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AA,EAAA,CAAA;kBAHnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE;AACX,iBAAA;;;ACnBD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-fixed-footer.mjs","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.provider.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["import { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\nexport const DEFAULT_FIXED_FOOTER_OPTIONS: NgxFixedFooterOptions = {\n containerSelector: DEFAULT_CONTAINER_SELECTOR,\n cssAttribute: DEFAULT_CSS_ATTRIBUTE\n};\n","import { InjectionToken, Provider } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const APP_FIXED_FOOTER_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>('[ngxFixedFooter] Options');\n\nexport const provideFixedFooter = (options: Partial<NgxFixedFooterOptions>): Provider => {\n return {\n provide: APP_FIXED_FOOTER_OPTIONS_TOKEN,\n useValue: {\n cssAttribute: options.cssAttribute || DEFAULT_CSS_ATTRIBUTE,\n containerSelector: options.containerSelector || DEFAULT_CONTAINER_SELECTOR\n }\n };\n};\n","import {\n DOCUMENT,\n Directive,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n computed,\n effect,\n inject,\n input,\n signal\n} from '@angular/core';\nimport { DEFAULT_FIXED_FOOTER_OPTIONS } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute, NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\nimport { APP_FIXED_FOOTER_OPTIONS_TOKEN } from './ngx-fixed-footer.provider';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements OnDestroy, OnInit {\n private readonly document = inject(DOCUMENT);\n private readonly el = inject(ElementRef);\n private readonly render = inject(Renderer2);\n private options: NgxFixedFooterOptions =\n inject(APP_FIXED_FOOTER_OPTIONS_TOKEN, { optional: true }) || DEFAULT_FIXED_FOOTER_OPTIONS;\n private readonly hasResizeObserver = typeof ResizeObserver !== 'undefined';\n private resizeObserver?: ResizeObserver;\n\n private offsetHeight = signal<number | undefined>(undefined);\n private prevContainerSelector = signal<string | undefined>(undefined);\n\n public containerSelector = input<string>(this.options.containerSelector);\n public cssAttribute = input<NgxFixedFooterCssAttribute>(this.options.cssAttribute);\n\n private container = computed(() => {\n const selector = this.containerSelector() || this.options.containerSelector;\n return this.document.body.querySelector<HTMLElement>(selector);\n });\n\n constructor() {\n // swap selector\n effect(() => {\n if (!this.hasResizeObserver || !this.document) return;\n const containerSelector = this.containerSelector();\n const offsetHeight = this.offsetHeight();\n if (!containerSelector || typeof offsetHeight !== 'number') return;\n const cssAttribute = this.cssAttribute();\n const prevContainerSelector = this.prevContainerSelector();\n if (prevContainerSelector && prevContainerSelector !== containerSelector) {\n const prevContainer = this.document.body.querySelector<HTMLElement>(prevContainerSelector);\n if (prevContainer) {\n this.removeStyle(prevContainer, cssAttribute);\n }\n }\n const container = this.document.body.querySelector<HTMLElement>(containerSelector);\n if (container) {\n this.setStyle(container, cssAttribute, offsetHeight);\n this.prevContainerSelector.set(containerSelector);\n }\n });\n\n // swap css attribute\n effect(() => {\n if (!this.hasResizeObserver || !this.document) return;\n const container = this.container();\n const offsetHeight = this.offsetHeight();\n if (!container || typeof offsetHeight !== 'number') return;\n const cssAttribute = this.cssAttribute();\n this.removeStyle(container, cssAttribute === 'padding' ? 'margin' : 'padding');\n this.setStyle(container, cssAttribute, offsetHeight);\n });\n }\n\n public ngOnInit(): void {\n if (this.hasResizeObserver && this.document) {\n this.resizeObserver = new ResizeObserver(() => this.checkHeight());\n this.resizeObserver.observe(this.html);\n }\n }\n\n public ngOnDestroy(): void {\n const container = this.container();\n if (this.resizeObserver && this.document && container) {\n this.removeStyle(container, this.cssAttribute());\n this.resizeObserver.unobserve(this.html);\n }\n }\n\n private checkHeight(): void {\n const height = this.html.offsetHeight;\n const container = this.container();\n if (this.offsetHeight() !== height && container) {\n this.setStyle(container, this.cssAttribute(), height);\n this.offsetHeight.set(height);\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n if (!container) {\n throw new Error(`Cannot removeStyle to undefined container`);\n }\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n if (!container) {\n throw new Error(`Cannot setStyle to undefined container`);\n }\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer.constants';\nexport * from './lib/ngx-fixed-footer.directive';\nexport * from './lib/ngx-fixed-footer.interface';\nexport * from './lib/ngx-fixed-footer.provider';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAEO,MAAM,qBAAqB,GAAG;AAC9B,MAAM,0BAA0B,GAAG;AACnC,MAAM,4BAA4B,GAA0B;AACjE,IAAA,iBAAiB,EAAE,0BAA0B;AAC7C,IAAA,YAAY,EAAE;;;MCFH,8BAA8B,GAAG,IAAI,cAAc,CAAwB,0BAA0B;AAE3G,MAAM,kBAAkB,GAAG,CAAC,OAAuC,KAAc;IACtF,OAAO;AACL,QAAA,OAAO,EAAE,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AEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-fixed-footer",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Dominik Hladík",
|
|
6
6
|
"email": "dominik.hladik@seznam.cz",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"node": ">=20"
|
|
35
35
|
},
|
|
36
36
|
"module": "fesm2022/ngx-fixed-footer.mjs",
|
|
37
|
-
"typings": "
|
|
37
|
+
"typings": "types/ngx-fixed-footer.d.ts",
|
|
38
38
|
"exports": {
|
|
39
39
|
"./package.json": {
|
|
40
40
|
"default": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
".": {
|
|
43
|
-
"types": "./
|
|
43
|
+
"types": "./types/ngx-fixed-footer.d.ts",
|
|
44
44
|
"default": "./fesm2022/ngx-fixed-footer.mjs"
|
|
45
45
|
}
|
|
46
46
|
},
|
|
File without changes
|