ngx-fixed-footer 1.0.2 → 1.0.4

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 13, Ivy and SSR compatible_
17
+ > ✓ _Angular 15, Ivy and SSR 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
 
@@ -39,7 +39,7 @@ yarn add ngx-fixed-footer
39
39
  // ...
40
40
  imports: [
41
41
  // ...
42
- NgxCutModule.forRoot({
42
+ NgxFixedFooterModule.forRoot({
43
43
  containerSelector: '[role="main"]',
44
44
  cssAttribute: 'padding'
45
45
  })
@@ -13,9 +13,9 @@ export class NgxFixedFooterOptionsService {
13
13
  this.containerSelector = DEFAULT_CONTAINER_SELECTOR;
14
14
  }
15
15
  }
16
- NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
17
- NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService });
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
16
+ NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
17
+ NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService });
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
19
19
  type: Injectable
20
20
  }] });
21
21
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWZpeGVkLWZvb3Rlci1vcHRpb25zLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtZml4ZWQtZm9vdGVyL3NyYy9saWIvbmd4LWZpeGVkLWZvb3Rlci1vcHRpb25zLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsMEJBQTBCLEVBQUUscUJBQXFCLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQzs7QUFJakcsTUFBTSxPQUFPLDRCQUE0QjtJQUR6QztRQUVFOztXQUVHO1FBQ0ksaUJBQVksR0FBK0IscUJBQXFCLENBQUM7UUFFeEU7O1dBRUc7UUFDSSxzQkFBaUIsR0FBVywwQkFBMEIsQ0FBQztLQUMvRDs7eUhBVlksNEJBQTRCOzZIQUE1Qiw0QkFBNEI7MkZBQTVCLDRCQUE0QjtrQkFEeEMsVUFBVSIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IERFRkFVTFRfQ09OVEFJTkVSX1NFTEVDVE9SLCBERUZBVUxUX0NTU19BVFRSSUJVVEUgfSBmcm9tICcuL25neC1maXhlZC1mb290ZXIuY29uc3RhbnRzJztcbmltcG9ydCB7IE5neEZpeGVkRm9vdGVyQ3NzQXR0cmlidXRlIH0gZnJvbSAnLi9uZ3gtZml4ZWQtZm9vdGVyLmludGVyZmFjZSc7XG5cbkBJbmplY3RhYmxlKClcbmV4cG9ydCBjbGFzcyBOZ3hGaXhlZEZvb3Rlck9wdGlvbnNTZXJ2aWNlIHtcbiAgLyoqXG4gICAqIEByZXR1cm5zIENzcyBhdHRyaWJ1dGUgb2YgSFRNTCBlbGVtZW50IHdoaWNoIGdldHMgc3R5bGUuIEl0IG1lYW5zIG1hcmdpbiBvciBwYWRkaW5nXG4gICAqL1xuICBwdWJsaWMgY3NzQXR0cmlidXRlOiBOZ3hGaXhlZEZvb3RlckNzc0F0dHJpYnV0ZSA9IERFRkFVTFRfQ1NTX0FUVFJJQlVURTtcblxuICAvKipcbiAgICogQHJldHVybnMgQ3NzIHNlbGVjdG9yIG9mIEhUTUwgZWxlbWVudCB3aGljaCBnZXRzIGV4dHJhIG1hcmdpbiBvciBwYWRkaW5nXG4gICAqL1xuICBwdWJsaWMgY29udGFpbmVyU2VsZWN0b3I6IHN0cmluZyA9IERFRkFVTFRfQ09OVEFJTkVSX1NFTEVDVE9SO1xufVxuIl19
@@ -71,9 +71,9 @@ export class NgxFixedFooterDirective {
71
71
  return typeof ResizeObserver !== 'undefined';
72
72
  }
73
73
  }
74
- NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
75
- NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
74
+ NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
75
+ NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
77
77
  type: Directive,
78
78
  args: [{
79
79
  selector: '[ngxFixedFooter]'
@@ -22,10 +22,10 @@ export class NgxFixedFooterModule {
22
22
  };
23
23
  }
24
24
  }
25
- NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
26
- NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
27
- NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
25
+ NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
26
+ NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
27
+ NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
29
29
  type: NgModule,
30
30
  args: [{
31
31
  declarations: [NgxFixedFooterDirective],
@@ -17,9 +17,9 @@ class NgxFixedFooterOptionsService {
17
17
  this.containerSelector = DEFAULT_CONTAINER_SELECTOR;
18
18
  }
19
19
  }
20
- NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
- NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService });
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
20
+ NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
+ NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService });
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
23
23
  type: Injectable
24
24
  }] });
25
25
 
@@ -93,9 +93,9 @@ class NgxFixedFooterDirective {
93
93
  return typeof ResizeObserver !== 'undefined';
94
94
  }
95
95
  }
96
- NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
97
- NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
96
+ NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
97
+ NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
99
99
  type: Directive,
100
100
  args: [{
101
101
  selector: '[ngxFixedFooter]'
@@ -143,10 +143,10 @@ class NgxFixedFooterModule {
143
143
  };
144
144
  }
145
145
  }
146
- NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
147
- NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
148
- NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
149
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
146
+ NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
147
+ NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
148
+ NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
149
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
150
150
  type: NgModule,
151
151
  args: [{
152
152
  declarations: [NgxFixedFooterDirective],
@@ -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-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"],"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;;yHAVY,4BAA4B;6HAA5B,4BAA4B;2FAA5B,4BAA4B;kBADxC,UAAU;;;MCcE,uBAAuB;IAOlC,YAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,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,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;;iHAhBU,oBAAoB;kHAApB,oBAAoB,iBAJhB,uBAAuB,aAC5B,uBAAuB;kHAGtB,oBAAoB,aAFpB,CAAC,4BAA4B,CAAC;2FAE9B,oBAAoB;kBALhC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;;;ACdD;;;;ACAA;;;;;;"}
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-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"],"names":["i1.NgxFixedFooterOptionsService"],"mappings":";;;;AAAO,MAAM,qBAAqB,GAAG,UAAU;AACxC,MAAM,0BAA0B,GAAG;;MCI7B,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;AAEE;;AAEG;AACI,QAAA,IAAY,CAAA,YAAA,GAA+B,qBAAqB,CAAC;AAExE;;AAEG;AACI,QAAA,IAAiB,CAAA,iBAAA,GAAW,0BAA0B,CAAC;KAC/D;;yHAVY,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;6HAA5B,4BAA4B,EAAA,CAAA,CAAA;2FAA5B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;;;MCcE,uBAAuB,CAAA;AAOlC,IAAA,WAAA,CAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,EACjB,OAAqC,EAAA;AAHnB,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAK;AAC/B,QAAA,IAAE,CAAA,EAAA,GAAF,E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AC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C,CAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -17,9 +17,9 @@ class NgxFixedFooterOptionsService {
17
17
  this.containerSelector = DEFAULT_CONTAINER_SELECTOR;
18
18
  }
19
19
  }
20
- NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
- NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService });
22
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
20
+ NgxFixedFooterOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
21
+ NgxFixedFooterOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService });
22
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterOptionsService, decorators: [{
23
23
  type: Injectable
24
24
  }] });
25
25
 
@@ -92,9 +92,9 @@ class NgxFixedFooterDirective {
92
92
  return typeof ResizeObserver !== 'undefined';
93
93
  }
94
94
  }
95
- NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
96
- NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
95
+ NgxFixedFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: NgxFixedFooterOptionsService }], target: i0.ɵɵFactoryTarget.Directive });
96
+ NgxFixedFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.3", type: NgxFixedFooterDirective, selector: "[ngxFixedFooter]", inputs: { containerSelector: "containerSelector", cssAttribute: "cssAttribute" }, usesOnChanges: true, ngImport: i0 });
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterDirective, decorators: [{
98
98
  type: Directive,
99
99
  args: [{
100
100
  selector: '[ngxFixedFooter]'
@@ -140,10 +140,10 @@ class NgxFixedFooterModule {
140
140
  };
141
141
  }
142
142
  }
143
- NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
144
- NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
145
- NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
143
+ NgxFixedFooterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
144
+ NgxFixedFooterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, declarations: [NgxFixedFooterDirective], exports: [NgxFixedFooterDirective] });
145
+ NgxFixedFooterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, providers: [NgxFixedFooterOptionsService] });
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgxFixedFooterModule, decorators: [{
147
147
  type: NgModule,
148
148
  args: [{
149
149
  declarations: [NgxFixedFooterDirective],
@@ -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-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"],"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;;yHAVY,4BAA4B;6HAA5B,4BAA4B;2FAA5B,4BAA4B;kBADxC,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,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vC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;iBAC1C;;;ACdD;;;;ACAA;;;;;;"}
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-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"],"names":["i1.NgxFixedFooterOptionsService"],"mappings":";;;;AAAO,MAAM,qBAAqB,GAAG,UAAU;AACxC,MAAM,0BAA0B,GAAG;;MCI7B,4BAA4B,CAAA;AADzC,IAAA,WAAA,GAAA;AAEE;;AAEG;QACI,IAAY,CAAA,YAAA,GAA+B,qBAAqB,CAAC;AAExE;;AAEG;QACI,IAAiB,CAAA,iBAAA,GAAW,0BAA0B,CAAC;AAC/D,KAAA;;yHAVY,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;6HAA5B,4BAA4B,EAAA,CAAA,CAAA;2FAA5B,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;;;MCcE,uBAAuB,CAAA;AAOlC,IAAA,WAAA,CAC4B,QAAa,EAC/B,EAAc,EACd,MAAiB,EACjB,OAAqC,EAAA;QAHnB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAK;QAC/B,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;QACd,IAAM,CAAA,MAAA,GAAN,MAAM,CAAW;QACjB,IAAO,CAAA,OAAA,GAAP,OAAO,CAA8B;AAV/B,QAAA,IAAA,CAAA,iBAAiB,GAAW,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAC3D,QAAA,IAAA,CAAA,YAAY,GAA+B,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAE7E,IAAY,CAAA,YAAA,GAAW,SAAS,CAAC;KAQrC;IAEG,QAAQ,GAAA;AACb,QAAA,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,QAAQ,EAAE;AAC3C,YAAA,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACpE,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YAAY,EAAE;AACxB,YAAA,4BAA4B,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAClE,SAAA;AACF,KAAA;AACD,IAAA,OAAO,4BAA4B,CAAC;AACtC,CAAC;;ICRU,sBAAsB,GAAG,IAAI,cAAc,CACpD,+CAA+C,EAC/C;MAOW,oBAAoB,CAAA;IACxB,OAAO,OAAO,CAAC,OAA+B,EAAA;QACnD,OAAO;AACL,YAAA,QAAQ,EAAE,oBAAoB;AAC9B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,sBAAsB;AAC/B,oBAAA,QAAQ,EAAE,OAAO;AAClB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,4BAA4B;AACrC,oBAAA,UAAU,EAAE,4BAA4B;oBACxC,IAAI,EAAE,CAAC,sBAAsB,CAAC;AAC/B,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;iHAhBU,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,YAAA,EAAA,CAJhB,uBAAuB,CAAA,EAAA,OAAA,EAAA,CAC5B,uBAAuB,CAAA,EAAA,CAAA,CAAA;kHAGtB,oBAAoB,EAAA,SAAA,EAFpB,CAAC,4BAA4B,CAAC,EAAA,CAAA,CAAA;2FAE9B,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,uBAAuB,CAAC;oBACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;oBAClC,SAAS,EAAE,CAAC,4BAA4B,CAAC;AAC1C,iBAAA,CAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
File without changes
@@ -22,5 +22,5 @@ export declare class NgxFixedFooterDirective implements OnDestroy, OnChanges, On
22
22
  private get html();
23
23
  private get hasResizeObserver();
24
24
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxFixedFooterDirective, never>;
25
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxFixedFooterDirective, "[ngxFixedFooter]", never, { "containerSelector": "containerSelector"; "cssAttribute": "cssAttribute"; }, {}, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxFixedFooterDirective, "[ngxFixedFooter]", never, { "containerSelector": "containerSelector"; "cssAttribute": "cssAttribute"; }, {}, never, never, false, never>;
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-fixed-footer",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "author": {
5
5
  "name": "Dominik Hladík",
6
6
  "email": "dominik.hladik@seznam.cz",
@@ -10,7 +10,7 @@
10
10
  "license": "MIT",
11
11
  "description": "Angular directive that adds fixed footer without overlap",
12
12
  "dependencies": {
13
- "tslib": "^2.2.0"
13
+ "tslib": "^2.4.1"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@angular/common": ">=12",
@@ -42,13 +42,13 @@
42
42
  "esm2020": "esm2020/ngx-fixed-footer.mjs",
43
43
  "fesm2020": "fesm2020/ngx-fixed-footer.mjs",
44
44
  "fesm2015": "fesm2015/ngx-fixed-footer.mjs",
45
- "typings": "ngx-fixed-footer.d.ts",
45
+ "typings": "index.d.ts",
46
46
  "exports": {
47
47
  "./package.json": {
48
48
  "default": "./package.json"
49
49
  },
50
50
  ".": {
51
- "types": "./ngx-fixed-footer.d.ts",
51
+ "types": "./index.d.ts",
52
52
  "esm2020": "./esm2020/ngx-fixed-footer.mjs",
53
53
  "es2020": "./fesm2020/ngx-fixed-footer.mjs",
54
54
  "es2015": "./fesm2015/ngx-fixed-footer.mjs",