ngx-fixed-footer 0.0.3 → 0.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 +2 -2
- package/bundles/ngx-fixed-footer.umd.js +38 -17
- package/bundles/ngx-fixed-footer.umd.js.map +1 -1
- package/esm2015/lib/ngx-fixed-footer.directive.js +34 -18
- package/fesm2015/ngx-fixed-footer.js +33 -17
- package/fesm2015/ngx-fixed-footer.js.map +1 -1
- package/lib/ngx-fixed-footer.directive.d.ts +6 -3
- package/ngx-fixed-footer.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
> ✓ _Angular 12, Ivy and SSR compatible_
|
|
18
18
|
|
|
19
|
-
Here's the [demo](http://celtian.github.io/ngx-fixed-footer/) or [stackblitz live preview](https://stackblitz.com/edit/ngx-fixed-footer)
|
|
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
|
|
|
21
21
|
- Lightweight
|
|
22
22
|
- No dependencies!
|
|
@@ -71,7 +71,7 @@ yarn add ngx-fixed-footer
|
|
|
71
71
|
### Result
|
|
72
72
|
|
|
73
73
|
```html
|
|
74
|
-
<div role="main" style="padding-
|
|
74
|
+
<div role="main" style="padding-bottom: {{ /* dynamic height of footer */ }}">...some content here</div>
|
|
75
75
|
<div ngxFixedFooter [containerSelector]="[role='main']" [cssAttribute]="'padding'">... some content here</div>
|
|
76
76
|
```
|
|
77
77
|
|
|
@@ -34,31 +34,45 @@
|
|
|
34
34
|
this.cssAttribute = this.options.cssAttribute;
|
|
35
35
|
this.offsetHeight = undefined;
|
|
36
36
|
}
|
|
37
|
+
NgxFixedFooterDirective.prototype.ngOnInit = function () {
|
|
38
|
+
var _this = this;
|
|
39
|
+
if (this.hasResizeObserver && this.document) {
|
|
40
|
+
var resizeObserver = new ResizeObserver(function () { return _this.checkHeight(); });
|
|
41
|
+
resizeObserver.observe(this.html);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
37
44
|
NgxFixedFooterDirective.prototype.ngOnChanges = function (changes) {
|
|
38
45
|
var _a, _b, _c, _d, _e, _f;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
if (this.hasResizeObserver && this.document) {
|
|
47
|
+
// swap selector
|
|
48
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.containerSelector) && !((_a = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _a === void 0 ? void 0 : _a.firstChange)) {
|
|
49
|
+
var prev = (_b = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _b === void 0 ? void 0 : _b.previousValue;
|
|
50
|
+
var next = (_c = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _c === void 0 ? void 0 : _c.currentValue;
|
|
51
|
+
if (next !== prev) {
|
|
52
|
+
this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);
|
|
53
|
+
this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);
|
|
54
|
+
}
|
|
46
55
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
// swap css attribute
|
|
57
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.cssAttribute) && !((_d = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _d === void 0 ? void 0 : _d.firstChange)) {
|
|
58
|
+
var prev = (_e = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _e === void 0 ? void 0 : _e.previousValue;
|
|
59
|
+
var next = (_f = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _f === void 0 ? void 0 : _f.currentValue;
|
|
60
|
+
if (next !== prev) {
|
|
61
|
+
this.removeStyle(this.container, prev);
|
|
62
|
+
this.setStyle(this.container, next, this.offsetHeight);
|
|
63
|
+
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
66
|
};
|
|
58
67
|
NgxFixedFooterDirective.prototype.ngOnDestroy = function () {
|
|
59
|
-
|
|
68
|
+
if (this.hasResizeObserver && this.document) {
|
|
69
|
+
this.removeStyle(this.container, this.cssAttribute);
|
|
70
|
+
if (this.resizeObserver) {
|
|
71
|
+
this.resizeObserver.unobserve(this.html);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
60
74
|
};
|
|
61
|
-
NgxFixedFooterDirective.prototype.
|
|
75
|
+
NgxFixedFooterDirective.prototype.checkHeight = function () {
|
|
62
76
|
var height = this.html.offsetHeight;
|
|
63
77
|
if (this.offsetHeight !== height) {
|
|
64
78
|
this.setStyle(this.container, this.cssAttribute, height);
|
|
@@ -85,6 +99,13 @@
|
|
|
85
99
|
enumerable: false,
|
|
86
100
|
configurable: true
|
|
87
101
|
});
|
|
102
|
+
Object.defineProperty(NgxFixedFooterDirective.prototype, "hasResizeObserver", {
|
|
103
|
+
get: function () {
|
|
104
|
+
return typeof ResizeObserver !== 'undefined';
|
|
105
|
+
},
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
88
109
|
return NgxFixedFooterDirective;
|
|
89
110
|
}());
|
|
90
111
|
NgxFixedFooterDirective.decorators = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-fixed-footer.umd.js","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-options.service.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-factory.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.module.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["export const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\n","import { Injectable } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Injectable()\nexport class NgxFixedFooterOptionsService {\n /**\n * @returns Css attribute of HTML element which gets style. It means margin or padding\n */\n public cssAttribute: NgxFixedFooterCssAttribute = DEFAULT_CSS_ATTRIBUTE;\n\n /**\n * @returns Css selector of HTML element which gets extra margin or padding\n */\n public containerSelector: string = DEFAULT_CONTAINER_SELECTOR;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n DoCheck,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Renderer2,\n SimpleChanges\n} from '@angular/core';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements DoCheck, OnDestroy, OnChanges {\n @Input() public containerSelector: string = this.options.containerSelector;\n @Input() public cssAttribute: NgxFixedFooterCssAttribute = this.options.cssAttribute;\n\n private offsetHeight: number = undefined;\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n private el: ElementRef,\n private render: Renderer2,\n private options: NgxFixedFooterOptionsService\n ) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n // swap selector\n if (changes?.containerSelector && !changes?.containerSelector?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.containerSelector?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);\n this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);\n }\n }\n\n // swap css attribute\n if (changes?.cssAttribute && !changes?.cssAttribute?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.cssAttribute?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.container, prev);\n this.setStyle(this.container, next, this.offsetHeight);\n }\n }\n }\n\n public ngOnDestroy(): void {\n this.removeStyle(this.container, this.cssAttribute);\n }\n\n public ngDoCheck(): void {\n const height = this.html.offsetHeight;\n if (this.offsetHeight !== height) {\n this.setStyle(this.container, this.cssAttribute, height);\n this.offsetHeight = height;\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get container(): HTMLElement {\n return this.document.body.querySelector(this.containerSelector);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n}\n","import { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const ngxFixedFooterOptionsFactory = (options?: NgxFixedFooterOptions): NgxFixedFooterOptionsService => {\n const ngxFixedFooterOptionsService = new NgxFixedFooterOptionsService();\n if (options) {\n if (options.containerSelector) {\n ngxFixedFooterOptionsService.containerSelector = options.containerSelector;\n }\n if (options.cssAttribute) {\n ngxFixedFooterOptionsService.cssAttribute = options.cssAttribute;\n }\n }\n return ngxFixedFooterOptionsService;\n};\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { ngxFixedFooterOptionsFactory } from './ngx-fixed-footer-factory';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterDirective } from './ngx-fixed-footer.directive';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport let FOR_ROOT_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>(\n 'forRoot() NgxCutOptionsService configuration.'\n);\n\n@NgModule({\n declarations: [NgxFixedFooterDirective],\n exports: [NgxFixedFooterDirective],\n providers: [NgxFixedFooterOptionsService]\n})\nexport class NgxFixedFooterModule {\n public static forRoot(options?: NgxFixedFooterOptions): ModuleWithProviders<NgxFixedFooterModule> {\n return {\n ngModule: NgxFixedFooterModule,\n providers: [\n {\n provide: FOR_ROOT_OPTIONS_TOKEN,\n useValue: options\n },\n {\n provide: NgxFixedFooterOptionsService,\n useFactory: ngxFixedFooterOptionsFactory,\n deps: [FOR_ROOT_OPTIONS_TOKEN]\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer-options.service';\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.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {ngxFixedFooterOptionsFactory as ɵa} from './lib/ngx-fixed-footer-factory';"],"names":["Injectable","Directive","Inject","DOCUMENT","ElementRef","Renderer2","Input","InjectionToken","NgModule"],"mappings":";;;;;;QAAa,qBAAqB,GAAG,UAAU;QAClC,0BAA0B,GAAG;;;QCG1C;;;;YAKS,iBAAY,GAA+B,qBAAqB,CAAC;;;;YAKjE,sBAAiB,GAAW,0BAA0B,CAAC;SAC/D;;;;gBAXAA,eAAU;;;;QCoBT,iCAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,EACjB,OAAqC;YAHnB,aAAQ,GAAR,QAAQ,CAAK;YAC/B,OAAE,GAAF,EAAE,CAAY;YACd,WAAM,GAAN,MAAM,CAAW;YACjB,YAAO,GAAP,OAAO,CAA8B;YAT/B,sBAAiB,GAAW,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;YAC3D,iBAAY,GAA+B,IAAI,C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K;+BACLA,UAAK;;;QCjBK,4BAA4B,GAAG,UAAC,OAA+B;QAC1E,IAAM,4BAA4B,GAAG,IAAI,4BAA4B,EAAE,CAAC;QACxE,IAAI,OAAO,EAAE;YACX,IAAI,OAAO,CAAC,iBAAiB,EAAE;gBAC7B,4BAA4B,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;aAC5E;YACD,IAAI,OAAO,CAAC,YAAY,EAAE;gBACxB,4BAA4B,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;aAClE;SACF;QACD,OAAO,4BAA4B,CAAC;IACtC;;QCRW,sBAAsB,GAAG,IAAIC,mBAAc,CACpD,+CAA+C,EAC/C;;QAOF;;QACgB,4BAAO,GAAd,UAAe,OAA+B;YACnD,OAAO;gBACL,QAAQ,EAAE,oBAAoB;gBAC9B,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,sBAAsB;wBAC/B,QAAQ,EAAE,OAAO;qBAClB;oBACD;wBACE,OAAO,EAAE,4BAA4B;wBACrC,UAAU,EAAE,4BAA4B;wBACxC,IAAI,EAAE,CAAC,sBAAsB,CAAC;qBAC/B;iBACF;aACF,CAAC;SACH;;;;gBArBFC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;;;ICdD;;;;ICAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-fixed-footer.umd.js","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-options.service.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-factory.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.module.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["export const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\n","import { Injectable } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Injectable()\nexport class NgxFixedFooterOptionsService {\n /**\n * @returns Css attribute of HTML element which gets style. It means margin or padding\n */\n public cssAttribute: NgxFixedFooterCssAttribute = DEFAULT_CSS_ATTRIBUTE;\n\n /**\n * @returns Css selector of HTML element which gets extra margin or padding\n */\n public containerSelector: string = DEFAULT_CONTAINER_SELECTOR;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges\n} from '@angular/core';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements OnDestroy, OnChanges, OnInit {\n @Input() public containerSelector: string = this.options.containerSelector;\n @Input() public cssAttribute: NgxFixedFooterCssAttribute = this.options.cssAttribute;\n\n private offsetHeight: number = undefined;\n private resizeObserver: ResizeObserver;\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n private el: ElementRef,\n private render: Renderer2,\n private options: NgxFixedFooterOptionsService\n ) {}\n\n public ngOnInit(): void {\n if (this.hasResizeObserver && this.document) {\n const resizeObserver = new ResizeObserver(() => this.checkHeight());\n resizeObserver.observe(this.html);\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.hasResizeObserver && this.document) {\n // swap selector\n if (changes?.containerSelector && !changes?.containerSelector?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.containerSelector?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);\n this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);\n }\n }\n\n // swap css attribute\n if (changes?.cssAttribute && !changes?.cssAttribute?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.cssAttribute?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.container, prev);\n this.setStyle(this.container, next, this.offsetHeight);\n }\n }\n }\n }\n\n public ngOnDestroy(): void {\n if (this.hasResizeObserver && this.document) {\n this.removeStyle(this.container, this.cssAttribute);\n if (this.resizeObserver) {\n this.resizeObserver.unobserve(this.html);\n }\n }\n }\n\n private checkHeight(): void {\n const height = this.html.offsetHeight;\n if (this.offsetHeight !== height) {\n this.setStyle(this.container, this.cssAttribute, height);\n this.offsetHeight = height;\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get container(): HTMLElement {\n return this.document.body.querySelector(this.containerSelector);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n\n private get hasResizeObserver(): boolean {\n return typeof ResizeObserver !== 'undefined';\n }\n}\n","import { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const ngxFixedFooterOptionsFactory = (options?: NgxFixedFooterOptions): NgxFixedFooterOptionsService => {\n const ngxFixedFooterOptionsService = new NgxFixedFooterOptionsService();\n if (options) {\n if (options.containerSelector) {\n ngxFixedFooterOptionsService.containerSelector = options.containerSelector;\n }\n if (options.cssAttribute) {\n ngxFixedFooterOptionsService.cssAttribute = options.cssAttribute;\n }\n }\n return ngxFixedFooterOptionsService;\n};\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { ngxFixedFooterOptionsFactory } from './ngx-fixed-footer-factory';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterDirective } from './ngx-fixed-footer.directive';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport let FOR_ROOT_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>(\n 'forRoot() NgxCutOptionsService configuration.'\n);\n\n@NgModule({\n declarations: [NgxFixedFooterDirective],\n exports: [NgxFixedFooterDirective],\n providers: [NgxFixedFooterOptionsService]\n})\nexport class NgxFixedFooterModule {\n public static forRoot(options?: NgxFixedFooterOptions): ModuleWithProviders<NgxFixedFooterModule> {\n return {\n ngModule: NgxFixedFooterModule,\n providers: [\n {\n provide: FOR_ROOT_OPTIONS_TOKEN,\n useValue: options\n },\n {\n provide: NgxFixedFooterOptionsService,\n useFactory: ngxFixedFooterOptionsFactory,\n deps: [FOR_ROOT_OPTIONS_TOKEN]\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer-options.service';\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.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {ngxFixedFooterOptionsFactory as ɵa} from './lib/ngx-fixed-footer-factory';"],"names":["Injectable","Directive","Inject","DOCUMENT","ElementRef","Renderer2","Input","InjectionToken","NgModule"],"mappings":";;;;;;QAAa,qBAAqB,GAAG,UAAU;QAClC,0BAA0B,GAAG;;;QCG1C;;;;YAKS,iBAAY,GAA+B,qBAAqB,CAAC;;;;YAKjE,sBAAiB,GAAW,0BAA0B,CAAC;SAC/D;;;;gBAXAA,eAAU;;;;QCqBT,iCAC4B,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AA4B,CAAC;IACtC;;QCRW,sBAAsB,GAAG,IAAIC,mBAAc,CACpD,+CAA+C,EAC/C;;QAOF;;QACgB,4BAAO,GAAd,UAAe,OAA+B;YACnD,OAAO;gBACL,QAAQ,EAAE,oBAAoB;gBAC9B,SAAS,EAAE;oBACT;wBACE,OAAO,EAAE,sBAAsB;wBAC/B,QAAQ,EAAE,OAAO;qBAClB;oBACD;wBACE,OAAO,EAAE,4BAA4B;wBACrC,UAAU,EAAE,4BAA4B;wBACxC,IAAI,EAAE,CAAC,sBAAsB,CAAC;qBAC/B;iBACF;aACF,CAAC;SACH;;;;gBArBFC,aAAQ,SAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;;;ICdD;;;;ICAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,31 +11,44 @@ export class NgxFixedFooterDirective {
|
|
|
11
11
|
this.cssAttribute = this.options.cssAttribute;
|
|
12
12
|
this.offsetHeight = undefined;
|
|
13
13
|
}
|
|
14
|
+
ngOnInit() {
|
|
15
|
+
if (this.hasResizeObserver && this.document) {
|
|
16
|
+
const resizeObserver = new ResizeObserver(() => this.checkHeight());
|
|
17
|
+
resizeObserver.observe(this.html);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
ngOnChanges(changes) {
|
|
15
21
|
var _a, _b, _c, _d, _e, _f;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
if (this.hasResizeObserver && this.document) {
|
|
23
|
+
// swap selector
|
|
24
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.containerSelector) && !((_a = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _a === void 0 ? void 0 : _a.firstChange)) {
|
|
25
|
+
const prev = (_b = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _b === void 0 ? void 0 : _b.previousValue;
|
|
26
|
+
const next = (_c = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _c === void 0 ? void 0 : _c.currentValue;
|
|
27
|
+
if (next !== prev) {
|
|
28
|
+
this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);
|
|
29
|
+
this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);
|
|
30
|
+
}
|
|
23
31
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
// swap css attribute
|
|
33
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.cssAttribute) && !((_d = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _d === void 0 ? void 0 : _d.firstChange)) {
|
|
34
|
+
const prev = (_e = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _e === void 0 ? void 0 : _e.previousValue;
|
|
35
|
+
const next = (_f = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _f === void 0 ? void 0 : _f.currentValue;
|
|
36
|
+
if (next !== prev) {
|
|
37
|
+
this.removeStyle(this.container, prev);
|
|
38
|
+
this.setStyle(this.container, next, this.offsetHeight);
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
}
|
|
35
43
|
ngOnDestroy() {
|
|
36
|
-
|
|
44
|
+
if (this.hasResizeObserver && this.document) {
|
|
45
|
+
this.removeStyle(this.container, this.cssAttribute);
|
|
46
|
+
if (this.resizeObserver) {
|
|
47
|
+
this.resizeObserver.unobserve(this.html);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
|
-
|
|
51
|
+
checkHeight() {
|
|
39
52
|
const height = this.html.offsetHeight;
|
|
40
53
|
if (this.offsetHeight !== height) {
|
|
41
54
|
this.setStyle(this.container, this.cssAttribute, height);
|
|
@@ -54,6 +67,9 @@ export class NgxFixedFooterDirective {
|
|
|
54
67
|
get html() {
|
|
55
68
|
return this.el.nativeElement;
|
|
56
69
|
}
|
|
70
|
+
get hasResizeObserver() {
|
|
71
|
+
return typeof ResizeObserver !== 'undefined';
|
|
72
|
+
}
|
|
57
73
|
}
|
|
58
74
|
NgxFixedFooterDirective.decorators = [
|
|
59
75
|
{ type: Directive, args: [{
|
|
@@ -70,4 +86,4 @@ NgxFixedFooterDirective.propDecorators = {
|
|
|
70
86
|
containerSelector: [{ type: Input }],
|
|
71
87
|
cssAttribute: [{ type: Input }]
|
|
72
88
|
};
|
|
73
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
89
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZpeGVkLWZvb3Rlci5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtZml4ZWQtZm9vdGVyL3NyYy9saWIvbmd4LWZpeGVkLWZvb3Rlci5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzNDLE9BQU8sRUFDTCxTQUFTLEVBQ1QsVUFBVSxFQUNWLE1BQU0sRUFDTixLQUFLLEVBSUwsU0FBUyxFQUVWLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLG9DQUFvQyxDQUFDO0FBTWxGLE1BQU0sT0FBTyx1QkFBdUI7SUFPbEMsWUFDNEIsUUFBYSxFQUMvQixFQUFjLEVBQ2QsTUFBaUIsRUFDakIsT0FBcUM7UUFIbkIsYUFBUSxHQUFSLFFBQVEsQ0FBSztRQUMvQixPQUFFLEdBQUYsRUFBRSxDQUFZO1FBQ2QsV0FBTSxHQUFOLE1BQU0sQ0FBVztRQU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U6IE5neEZpeGVkRm9vdGVyQ3NzQXR0cmlidXRlLCBoZWlnaHQ6IG51bWJlcik6IHZvaWQge1xuICAgIHRoaXMucmVuZGVyLnNldFN0eWxlKGNvbnRhaW5lciwgYCR7Y3NzQXR0cmlidXRlfS1ib3R0b21gLCBoZWlnaHQgPT09IDAgPyAnJyA6IGAke2hlaWdodH1weGApO1xuICB9XG5cbiAgcHJpdmF0ZSBnZXQgY29udGFpbmVyKCk6IEhUTUxFbGVtZW50IHtcbiAgICByZXR1cm4gdGhpcy5kb2N1bWVudC5ib2R5LnF1ZXJ5U2VsZWN0b3IodGhpcy5jb250YWluZXJTZWxlY3Rvcik7XG4gIH1cblxuICBwcml2YXRlIGdldCBodG1sKCk6IEhUTUxFbGVtZW50IHtcbiAgICByZXR1cm4gdGhpcy5lbC5uYXRpdmVFbGVtZW50O1xuICB9XG5cbiAgcHJpdmF0ZSBnZXQgaGFzUmVzaXplT2JzZXJ2ZXIoKTogYm9vbGVhbiB7XG4gICAgcmV0dXJuIHR5cGVvZiBSZXNpemVPYnNlcnZlciAhPT0gJ3VuZGVmaW5lZCc7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -30,31 +30,44 @@ class NgxFixedFooterDirective {
|
|
|
30
30
|
this.cssAttribute = this.options.cssAttribute;
|
|
31
31
|
this.offsetHeight = undefined;
|
|
32
32
|
}
|
|
33
|
+
ngOnInit() {
|
|
34
|
+
if (this.hasResizeObserver && this.document) {
|
|
35
|
+
const resizeObserver = new ResizeObserver(() => this.checkHeight());
|
|
36
|
+
resizeObserver.observe(this.html);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
33
39
|
ngOnChanges(changes) {
|
|
34
40
|
var _a, _b, _c, _d, _e, _f;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
if (this.hasResizeObserver && this.document) {
|
|
42
|
+
// swap selector
|
|
43
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.containerSelector) && !((_a = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _a === void 0 ? void 0 : _a.firstChange)) {
|
|
44
|
+
const prev = (_b = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _b === void 0 ? void 0 : _b.previousValue;
|
|
45
|
+
const next = (_c = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _c === void 0 ? void 0 : _c.currentValue;
|
|
46
|
+
if (next !== prev) {
|
|
47
|
+
this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);
|
|
48
|
+
this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
// swap css attribute
|
|
52
|
+
if ((changes === null || changes === void 0 ? void 0 : changes.cssAttribute) && !((_d = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _d === void 0 ? void 0 : _d.firstChange)) {
|
|
53
|
+
const prev = (_e = changes === null || changes === void 0 ? void 0 : changes.containerSelector) === null || _e === void 0 ? void 0 : _e.previousValue;
|
|
54
|
+
const next = (_f = changes === null || changes === void 0 ? void 0 : changes.cssAttribute) === null || _f === void 0 ? void 0 : _f.currentValue;
|
|
55
|
+
if (next !== prev) {
|
|
56
|
+
this.removeStyle(this.container, prev);
|
|
57
|
+
this.setStyle(this.container, next, this.offsetHeight);
|
|
58
|
+
}
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
}
|
|
54
62
|
ngOnDestroy() {
|
|
55
|
-
|
|
63
|
+
if (this.hasResizeObserver && this.document) {
|
|
64
|
+
this.removeStyle(this.container, this.cssAttribute);
|
|
65
|
+
if (this.resizeObserver) {
|
|
66
|
+
this.resizeObserver.unobserve(this.html);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
56
69
|
}
|
|
57
|
-
|
|
70
|
+
checkHeight() {
|
|
58
71
|
const height = this.html.offsetHeight;
|
|
59
72
|
if (this.offsetHeight !== height) {
|
|
60
73
|
this.setStyle(this.container, this.cssAttribute, height);
|
|
@@ -73,6 +86,9 @@ class NgxFixedFooterDirective {
|
|
|
73
86
|
get html() {
|
|
74
87
|
return this.el.nativeElement;
|
|
75
88
|
}
|
|
89
|
+
get hasResizeObserver() {
|
|
90
|
+
return typeof ResizeObserver !== 'undefined';
|
|
91
|
+
}
|
|
76
92
|
}
|
|
77
93
|
NgxFixedFooterDirective.decorators = [
|
|
78
94
|
{ type: Directive, args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-fixed-footer.js","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-options.service.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-factory.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.module.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["export const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\n","import { Injectable } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Injectable()\nexport class NgxFixedFooterOptionsService {\n /**\n * @returns Css attribute of HTML element which gets style. It means margin or padding\n */\n public cssAttribute: NgxFixedFooterCssAttribute = DEFAULT_CSS_ATTRIBUTE;\n\n /**\n * @returns Css selector of HTML element which gets extra margin or padding\n */\n public containerSelector: string = DEFAULT_CONTAINER_SELECTOR;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n DoCheck,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Renderer2,\n SimpleChanges\n} from '@angular/core';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements DoCheck, OnDestroy, OnChanges {\n @Input() public containerSelector: string = this.options.containerSelector;\n @Input() public cssAttribute: NgxFixedFooterCssAttribute = this.options.cssAttribute;\n\n private offsetHeight: number = undefined;\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n private el: ElementRef,\n private render: Renderer2,\n private options: NgxFixedFooterOptionsService\n ) {}\n\n public ngOnChanges(changes: SimpleChanges): void {\n // swap selector\n if (changes?.containerSelector && !changes?.containerSelector?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.containerSelector?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);\n this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);\n }\n }\n\n // swap css attribute\n if (changes?.cssAttribute && !changes?.cssAttribute?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.cssAttribute?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.container, prev);\n this.setStyle(this.container, next, this.offsetHeight);\n }\n }\n }\n\n public ngOnDestroy(): void {\n this.removeStyle(this.container, this.cssAttribute);\n }\n\n public ngDoCheck(): void {\n const height = this.html.offsetHeight;\n if (this.offsetHeight !== height) {\n this.setStyle(this.container, this.cssAttribute, height);\n this.offsetHeight = height;\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get container(): HTMLElement {\n return this.document.body.querySelector(this.containerSelector);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n}\n","import { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const ngxFixedFooterOptionsFactory = (options?: NgxFixedFooterOptions): NgxFixedFooterOptionsService => {\n const ngxFixedFooterOptionsService = new NgxFixedFooterOptionsService();\n if (options) {\n if (options.containerSelector) {\n ngxFixedFooterOptionsService.containerSelector = options.containerSelector;\n }\n if (options.cssAttribute) {\n ngxFixedFooterOptionsService.cssAttribute = options.cssAttribute;\n }\n }\n return ngxFixedFooterOptionsService;\n};\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { ngxFixedFooterOptionsFactory } from './ngx-fixed-footer-factory';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterDirective } from './ngx-fixed-footer.directive';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport let FOR_ROOT_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>(\n 'forRoot() NgxCutOptionsService configuration.'\n);\n\n@NgModule({\n declarations: [NgxFixedFooterDirective],\n exports: [NgxFixedFooterDirective],\n providers: [NgxFixedFooterOptionsService]\n})\nexport class NgxFixedFooterModule {\n public static forRoot(options?: NgxFixedFooterOptions): ModuleWithProviders<NgxFixedFooterModule> {\n return {\n ngModule: NgxFixedFooterModule,\n providers: [\n {\n provide: FOR_ROOT_OPTIONS_TOKEN,\n useValue: options\n },\n {\n provide: NgxFixedFooterOptionsService,\n useFactory: ngxFixedFooterOptionsFactory,\n deps: [FOR_ROOT_OPTIONS_TOKEN]\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer-options.service';\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.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {ngxFixedFooterOptionsFactory as ɵa} from './lib/ngx-fixed-footer-factory';"],"names":[],"mappings":";;;MAAa,qBAAqB,GAAG,UAAU;MAClC,0BAA0B,GAAG;;MCI7B,4BAA4B;IADzC;;;;QAKS,iBAAY,GAA+B,qBAAqB,CAAC;;;;QAKjE,sBAAiB,GAAW,0BAA0B,CAAC;KAC/D;;;YAXA,UAAU;;;MCcE,uBAAuB;IAMlC,YAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,EACjB,OAAqC;QAHnB,aAAQ,GAAR,QAAQ,CAAK;QAC/B,OAAE,GAAF,EAAE,CAAY;QACd,WAAM,GAAN,MAAM,CAAW;QACjB,YAAO,GAAP,OAAO,CAA8B;QAT/B,sBAAiB,GAAW,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAC3D,iBAAY,GAA+B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAE7E,iBAAY,GAAW,SAAS,CAAC;KAOrC;IAEG,WAAW,CAAC,OAAsB;;;QAEvC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,KAAI,EAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,0CAAE,WAAW,CAAA,EAAE;YAC1E,MAAM,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,0CAAE,aAAa,CAAC;YACvD,MAAM,IAAI,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,0CAAE,YAAY,CAAC;YACtD,IAAI,IAAI,KAAK,IAAI,EAAE;gBACjB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI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C,IAAI,EAAE,CAAC,sBAAsB,CAAC;iBAC/B;aACF;SACF,CAAC;KACH;;;YArBF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;gBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;aAC1C;;;ACdD;;;;ACAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-fixed-footer.js","sources":["../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.constants.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-options.service.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.directive.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer-factory.ts","../../../projects/ngx-fixed-footer/src/lib/ngx-fixed-footer.module.ts","../../../projects/ngx-fixed-footer/src/public-api.ts","../../../projects/ngx-fixed-footer/src/ngx-fixed-footer.ts"],"sourcesContent":["export const DEFAULT_CSS_ATTRIBUTE = 'padding';\nexport const DEFAULT_CONTAINER_SELECTOR = '[role=\"main\"]';\n","import { Injectable } from '@angular/core';\nimport { DEFAULT_CONTAINER_SELECTOR, DEFAULT_CSS_ATTRIBUTE } from './ngx-fixed-footer.constants';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Injectable()\nexport class NgxFixedFooterOptionsService {\n /**\n * @returns Css attribute of HTML element which gets style. It means margin or padding\n */\n public cssAttribute: NgxFixedFooterCssAttribute = DEFAULT_CSS_ATTRIBUTE;\n\n /**\n * @returns Css selector of HTML element which gets extra margin or padding\n */\n public containerSelector: string = DEFAULT_CONTAINER_SELECTOR;\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n Directive,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Renderer2,\n SimpleChanges\n} from '@angular/core';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';\n\n@Directive({\n selector: '[ngxFixedFooter]'\n})\nexport class NgxFixedFooterDirective implements OnDestroy, OnChanges, OnInit {\n @Input() public containerSelector: string = this.options.containerSelector;\n @Input() public cssAttribute: NgxFixedFooterCssAttribute = this.options.cssAttribute;\n\n private offsetHeight: number = undefined;\n private resizeObserver: ResizeObserver;\n\n constructor(\n @Inject(DOCUMENT) private document: any,\n private el: ElementRef,\n private render: Renderer2,\n private options: NgxFixedFooterOptionsService\n ) {}\n\n public ngOnInit(): void {\n if (this.hasResizeObserver && this.document) {\n const resizeObserver = new ResizeObserver(() => this.checkHeight());\n resizeObserver.observe(this.html);\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (this.hasResizeObserver && this.document) {\n // swap selector\n if (changes?.containerSelector && !changes?.containerSelector?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.containerSelector?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.document.body.querySelector(prev), this.cssAttribute);\n this.setStyle(this.document.body.querySelector(next), this.cssAttribute, this.offsetHeight);\n }\n }\n\n // swap css attribute\n if (changes?.cssAttribute && !changes?.cssAttribute?.firstChange) {\n const prev = changes?.containerSelector?.previousValue;\n const next = changes?.cssAttribute?.currentValue;\n if (next !== prev) {\n this.removeStyle(this.container, prev);\n this.setStyle(this.container, next, this.offsetHeight);\n }\n }\n }\n }\n\n public ngOnDestroy(): void {\n if (this.hasResizeObserver && this.document) {\n this.removeStyle(this.container, this.cssAttribute);\n if (this.resizeObserver) {\n this.resizeObserver.unobserve(this.html);\n }\n }\n }\n\n private checkHeight(): void {\n const height = this.html.offsetHeight;\n if (this.offsetHeight !== height) {\n this.setStyle(this.container, this.cssAttribute, height);\n this.offsetHeight = height;\n }\n }\n\n private removeStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, '');\n }\n\n private setStyle(container: HTMLElement, cssAttribute: NgxFixedFooterCssAttribute, height: number): void {\n this.render.setStyle(container, `${cssAttribute}-bottom`, height === 0 ? '' : `${height}px`);\n }\n\n private get container(): HTMLElement {\n return this.document.body.querySelector(this.containerSelector);\n }\n\n private get html(): HTMLElement {\n return this.el.nativeElement;\n }\n\n private get hasResizeObserver(): boolean {\n return typeof ResizeObserver !== 'undefined';\n }\n}\n","import { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport const ngxFixedFooterOptionsFactory = (options?: NgxFixedFooterOptions): NgxFixedFooterOptionsService => {\n const ngxFixedFooterOptionsService = new NgxFixedFooterOptionsService();\n if (options) {\n if (options.containerSelector) {\n ngxFixedFooterOptionsService.containerSelector = options.containerSelector;\n }\n if (options.cssAttribute) {\n ngxFixedFooterOptionsService.cssAttribute = options.cssAttribute;\n }\n }\n return ngxFixedFooterOptionsService;\n};\n","import { InjectionToken, ModuleWithProviders, NgModule } from '@angular/core';\nimport { ngxFixedFooterOptionsFactory } from './ngx-fixed-footer-factory';\nimport { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';\nimport { NgxFixedFooterDirective } from './ngx-fixed-footer.directive';\nimport { NgxFixedFooterOptions } from './ngx-fixed-footer.interface';\n\nexport let FOR_ROOT_OPTIONS_TOKEN = new InjectionToken<NgxFixedFooterOptions>(\n 'forRoot() NgxCutOptionsService configuration.'\n);\n\n@NgModule({\n declarations: [NgxFixedFooterDirective],\n exports: [NgxFixedFooterDirective],\n providers: [NgxFixedFooterOptionsService]\n})\nexport class NgxFixedFooterModule {\n public static forRoot(options?: NgxFixedFooterOptions): ModuleWithProviders<NgxFixedFooterModule> {\n return {\n ngModule: NgxFixedFooterModule,\n providers: [\n {\n provide: FOR_ROOT_OPTIONS_TOKEN,\n useValue: options\n },\n {\n provide: NgxFixedFooterOptionsService,\n useFactory: ngxFixedFooterOptionsFactory,\n deps: [FOR_ROOT_OPTIONS_TOKEN]\n }\n ]\n };\n }\n}\n","/*\n * Public API Surface of ngx-fixed-footer\n */\n\nexport * from './lib/ngx-fixed-footer-options.service';\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.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {ngxFixedFooterOptionsFactory as ɵa} from './lib/ngx-fixed-footer-factory';"],"names":[],"mappings":";;;MAAa,qBAAqB,GAAG,UAAU;MAClC,0BAA0B,GAAG;;MCI7B,4BAA4B;IADzC;;;;QAKS,iBAAY,GAA+B,qBAAqB,CAAC;;;;QAKjE,sBAAiB,GAAW,0BAA0B,CAAC;KAC/D;;;YAXA,UAAU;;;MCcE,uBAAuB;IAOlC,YAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,EACjB,OAAqC;QAHnB,aAAQ,GAAR,QAAQ,CAAK;QAC/B,OAAE,GAAF,EAAE,CAAY;QACd,WAAM,GAAN,MAAM,CAAW;QACjB,YAAO,GAAP,OAAO,CAA8B;QAV/B,sBAAiB,GAAW,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;QAC3D,iBAAY,GAA+B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAE7E,iBAAY,GAAW,SAAS,CAAC;KAQrC;IAEG,QAAQ;QACb,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC3C,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YACpE,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACnC;KACF;IAEM,WAAW,CAAC,OAAsB;;QACvC,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,QAAQ,EAAE;;YAE3C,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,KAAI,EAAC,M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;;;gCAOlC,KAAK;2BACL,KAAK;;;MCjBK,4BAA4B,GAAG,CAAC,OAA+B;IAC1E,MAAM,4BAA4B,GAAG,IAAI,4BAA4B,EAAE,CAAC;IACxE,IAAI,OAAO,EAAE;QACX,IAAI,OAAO,CAAC,iBAAiB,EAAE;YAC7B,4BAA4B,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;SAC5E;QACD,IAAI,OAAO,CAAC,YAAY,EAAE;YACxB,4BAA4B,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;SAClE;KACF;IACD,OAAO,4BAA4B,CAAC;AACtC;;ICRW,sBAAsB,GAAG,IAAI,cAAc,CACpD,+CAA+C,EAC/C;MAOW,oBAAoB;IACxB,OAAO,OAAO,CAAC,OAA+B;QACnD,OAAO;YACL,QAAQ,EAAE,oBAAoB;YAC9B,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,sBAAsB;oBAC/B,QAAQ,EAAE,OAAO;iBAClB;gBACD;oBACE,OAAO,EAAE,4BAA4B;oBACrC,UAAU,EAAE,4BAA4B;oBACxC,IAAI,EAAE,CAAC,sBAAsB,CAAC;iBAC/B;aACF;SACF,CAAC;KACH;;;YArBF,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;gBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;gBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;aAC1C;;;ACdD;;;;ACAA;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy, OnInit, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { NgxFixedFooterOptionsService } from './ngx-fixed-footer-options.service';
|
|
3
3
|
import { NgxFixedFooterCssAttribute } from './ngx-fixed-footer.interface';
|
|
4
|
-
export declare class NgxFixedFooterDirective implements
|
|
4
|
+
export declare class NgxFixedFooterDirective implements OnDestroy, OnChanges, OnInit {
|
|
5
5
|
private document;
|
|
6
6
|
private el;
|
|
7
7
|
private render;
|
|
@@ -9,12 +9,15 @@ export declare class NgxFixedFooterDirective implements DoCheck, OnDestroy, OnCh
|
|
|
9
9
|
containerSelector: string;
|
|
10
10
|
cssAttribute: NgxFixedFooterCssAttribute;
|
|
11
11
|
private offsetHeight;
|
|
12
|
+
private resizeObserver;
|
|
12
13
|
constructor(document: any, el: ElementRef, render: Renderer2, options: NgxFixedFooterOptionsService);
|
|
14
|
+
ngOnInit(): void;
|
|
13
15
|
ngOnChanges(changes: SimpleChanges): void;
|
|
14
16
|
ngOnDestroy(): void;
|
|
15
|
-
|
|
17
|
+
private checkHeight;
|
|
16
18
|
private removeStyle;
|
|
17
19
|
private setStyle;
|
|
18
20
|
private get container();
|
|
19
21
|
private get html();
|
|
22
|
+
private get hasResizeObserver();
|
|
20
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"NgxFixedFooterOptionsService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":4,"character":1}}],"members":{}},"DEFAULT_CSS_ATTRIBUTE":"padding","DEFAULT_CONTAINER_SELECTOR":"[role=\"main\"]","NgxFixedFooterDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":15,"character":1},"arguments":[{"selector":"[ngxFixedFooter]"}]}],"members":{"containerSelector":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"cssAttribute":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"NgxFixedFooterOptionsService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":4,"character":1}}],"members":{}},"DEFAULT_CSS_ATTRIBUTE":"padding","DEFAULT_CONTAINER_SELECTOR":"[role=\"main\"]","NgxFixedFooterDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":15,"character":1},"arguments":[{"selector":"[ngxFixedFooter]"}]}],"members":{"containerSelector":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}}]}],"cssAttribute":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":26,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":26,"character":12}]}],null,null,null],"parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":27,"character":16},{"__symbolic":"reference","module":"@angular/core","name":"Renderer2","line":28,"character":20},{"__symbolic":"reference","name":"NgxFixedFooterOptionsService"}]}],"ngOnInit":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"checkHeight":[{"__symbolic":"method"}],"removeStyle":[{"__symbolic":"method"}],"setStyle":[{"__symbolic":"method"}]}},"NgxFixedFooterCssAttribute":{"__symbolic":"interface"},"NgxFixedFooterOptions":{"__symbolic":"interface"},"FOR_ROOT_OPTIONS_TOKEN":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":40},"arguments":["forRoot() NgxCutOptionsService configuration."]},"NgxFixedFooterModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"NgxFixedFooterDirective"}],"exports":[{"__symbolic":"reference","name":"NgxFixedFooterDirective"}],"providers":[{"__symbolic":"reference","name":"NgxFixedFooterOptionsService"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":["options"],"value":{"ngModule":{"__symbolic":"reference","name":"NgxFixedFooterModule"},"providers":[{"provide":{"__symbolic":"reference","name":"FOR_ROOT_OPTIONS_TOKEN"},"useValue":{"__symbolic":"reference","name":"options"}},{"provide":{"__symbolic":"reference","name":"NgxFixedFooterOptionsService"},"useFactory":{"__symbolic":"reference","name":"ɵa"},"deps":[{"__symbolic":"reference","name":"FOR_ROOT_OPTIONS_TOKEN"}]}]}}}},"ɵa":{"__symbolic":"error","message":"Lambda not supported","line":3,"character":44,"module":"./lib/ngx-fixed-footer-factory"}},"origins":{"NgxFixedFooterOptionsService":"./lib/ngx-fixed-footer-options.service","DEFAULT_CSS_ATTRIBUTE":"./lib/ngx-fixed-footer.constants","DEFAULT_CONTAINER_SELECTOR":"./lib/ngx-fixed-footer.constants","NgxFixedFooterDirective":"./lib/ngx-fixed-footer.directive","NgxFixedFooterCssAttribute":"./lib/ngx-fixed-footer.interface","NgxFixedFooterOptions":"./lib/ngx-fixed-footer.interface","FOR_ROOT_OPTIONS_TOKEN":"./lib/ngx-fixed-footer.module","NgxFixedFooterModule":"./lib/ngx-fixed-footer.module","ɵa":"./lib/ngx-fixed-footer-factory"},"importAs":"ngx-fixed-footer"}
|