Commit f33f0a26 by Emile TAVERNE

Build

parent 07591b18
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/core')) :
typeof define === 'function' && define.amd ? define('aitp-utils', ['exports', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/core'], factory) :
(factory((global['aitp-utils'] = {}), global.ng.common, global.rxjs, global.rxjs.operators, global.ng.core));
}(this, (function (exports, common, rxjs, operators, core) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('rxjs'), require('rxjs/operators')) :
typeof define === 'function' && define.amd ? define('aitp-utils', ['exports', '@angular/common', '@angular/core', 'rxjs', 'rxjs/operators'], factory) :
(factory((global['aitp-utils'] = {}), global.ng.common, global.ng.core, global.rxjs, global.rxjs.operators));
}(this, (function (exports, common, core, rxjs, operators) {
'use strict';
/**
......@@ -309,43 +309,6 @@
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?=} args
* @return {?}
*/
function AiutComponent(args) {
if (args === void 0) {
args = {};
}
/** @type {?} */
var ngCompDecorator = core.Component(args);
return (/**
* @param {?} compType
* @return {?}
*/function (compType) {
ngCompDecorator(compType);
if (core.isDevMode()) {
/** @type {?} */
var orignalChange_1 = compType.ngOnChange;
compType.ngOnChange = (/**
* @return {?}
*/function () {
console.info(compType.constructor.name + " changed");
orignalChange_1.call(compType);
});
}
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
......@@ -354,7 +317,6 @@
exports.AitpUtilsModule = AitpUtilsModule;
exports.InViewportComponent = InViewportComponent;
exports.AiutComponent = AiutComponent;
exports.InViewportDirective = InViewportDirective;
exports.addDestroyObservableToComponent = addDestroyObservableToComponent;
exports.destroy$ = destroy$;
......
......@@ -6,16 +6,14 @@
"ng://aitp-utils/lib/services/viewport.service.ts",
"ng://aitp-utils/lib/operators/until-destroy.ts",
"ng://aitp-utils/lib/directives/in-viewport.directive.ts",
"ng://aitp-utils/lib/aitp-utils.module.ts",
"ng://aitp-utils/lib/decorators/component.decorator.ts"
"ng://aitp-utils/lib/aitp-utils.module.ts"
],
"sourcesContent": [
"import {ChangeDetectorRef, Component} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'aiut-in-viewport',\r\n templateUrl: './in-viewport.component.html'\r\n})\r\nexport class InViewportComponent {\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {\r\n }\r\n\r\n onViewportChange(intersectionObserverEntry: IntersectionObserverEntry) {\r\n if (intersectionObserverEntry.isIntersecting) {\r\n this.changeDetectorRef.reattach();\r\n } else {\r\n this.changeDetectorRef.detach();\r\n }\r\n }\r\n}\r\n",
"import {Injectable} from '@angular/core';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {filter, finalize} from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class ViewportService {\r\n private readonly options: IntersectionObserverInit = {\r\n rootMargin: '0px 0px 0px 0px',\r\n threshold: [0.5],\r\n };\r\n private observer: IntersectionObserver;\r\n private callback$: Subject<IntersectionObserverEntry> = new Subject();\r\n\r\n constructor() {\r\n this.observer = new IntersectionObserver(this.handler.bind(this), this.options);\r\n }\r\n\r\n observe(element: Element): Observable<IntersectionObserverEntry> {\r\n this.observer.observe(element);\r\n\r\n return this.callback$.asObservable().pipe(\r\n filter((entry: IntersectionObserverEntry) => entry.target === element),\r\n finalize(() => this.observer.unobserve(element)),\r\n );\r\n }\r\n\r\n private handler(entries: Array<IntersectionObserverEntry>): void {\r\n entries.forEach(entry => this.callback$.next(entry));\r\n }\r\n}\r\n",
"import {MonoTypeOperatorFunction, Observable} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\n// create a symbol identify the observable I add to\r\n// the component so it doesn't conflict with anything.\r\n// I need this so I'm able to add the desired behaviour to the component.\r\nexport const destroy$ = Symbol('destroy$');\r\n\r\n/**\r\n * An operator that takes until destroy it takes a components this a parameter\r\n * returns a pipeable RxJS operator.\r\n */\r\nexport const untilDestroy = <T>(component: any): MonoTypeOperatorFunction<T> => {\r\n if (component[destroy$] === undefined) {\r\n // only hookup each component once.\r\n addDestroyObservableToComponent(component);\r\n }\r\n\r\n // pipe in the takeUntil destroy$ and return the source unaltered\r\n return takeUntil<T>(component[destroy$]);\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function addDestroyObservableToComponent(component: any) {\r\n component[destroy$] = new Observable<void>(observer => {\r\n // keep track of the original destroy function,\r\n // the user might do something in there\r\n const orignalDestroy = component.ngOnDestroy;\r\n if (orignalDestroy == null) {\r\n // Angular does not support dynamic added destroy methods\r\n // so make sure there is one.\r\n throw new Error('untilDestroy operator needs the component to have an ngOnDestroy method');\r\n }\r\n // replace the ngOndestroy\r\n component.ngOnDestroy = () => {\r\n // fire off the destroy observable\r\n observer.next();\r\n // complete the observable\r\n observer.complete();\r\n // and at last, call the original destroy\r\n orignalDestroy.call(component);\r\n };\r\n // return cleanup function.\r\n return (_: any) => (component[destroy$] = undefined);\r\n });\r\n}\r\n",
"import {Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID,} from '@angular/core';\r\nimport {isPlatformBrowser} from '@angular/common';\r\nimport {filter, take} from 'rxjs/operators';\r\nimport {ViewportService} from '../services';\r\nimport {untilDestroy} from '../operators';\r\n\r\n@Directive({\r\n selector: '[aiutInViewport]',\r\n})\r\nexport class InViewportDirective implements OnInit, OnDestroy {\r\n @Input() public preRender = true;\r\n @Input() public oneTime = false;\r\n @Output() readonly inViewport = new EventEmitter<Partial<IntersectionObserverEntry>>();\r\n\r\n constructor(\r\n private readonly elementRef: ElementRef,\r\n private viewportService: ViewportService,\r\n @Inject(PLATFORM_ID) private platformId: Object,\r\n ) {\r\n }\r\n\r\n public ngOnInit() {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.oneTime) {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(\r\n untilDestroy(this),\r\n filter(entry => entry.intersectionRatio >= 0.5),\r\n take(1),\r\n )\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n } else {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(untilDestroy(this))\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n }\r\n } else {\r\n if (this.preRender) {\r\n this.inViewport.emit({isIntersecting: true, intersectionRatio: 1});\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n }\r\n}\r\n",
"import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport * as Components from './components';\nimport * as Directives from './directives';\nimport * as Services from './services';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\n providers: [Services.ViewportService],\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\n})\nexport class AitpUtilsModule { }\n",
"import {Component, isDevMode} from '@angular/core';\r\n\r\nexport function AiutComponent(args: any = {}): (cls: any) => any {\r\n const ngCompDecorator = Component(args);\r\n\r\n return function (compType: any) {\r\n ngCompDecorator(compType);\r\n\r\n if (isDevMode()) {\r\n const orignalChange = compType.ngOnChange;\r\n\r\n compType.ngOnChange = () => {\r\n console.info(`${compType.constructor.name} changed`);\r\n\r\n orignalChange.call(compType);\r\n };\r\n }\r\n };\r\n}\r\n"
"import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport * as Components from './components';\r\nimport * as Directives from './directives';\r\nimport * as Services from './services';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\r\n providers: [Services.ViewportService],\r\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\r\n})\r\nexport class AitpUtilsModule { }\r\n"
],
"names": [
"Component",
......@@ -39,8 +37,7 @@
"CommonModule",
"Directives.InViewportDirective",
"Components.InViewportComponent",
"Services.ViewportService",
"isDevMode"
"Services.ViewportService"
],
"mappings": ";;;;;;;;;;AAAA;QAOE,6BAAoB,iBAAoC;YAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;SACvD;;;;;QAED,8CAAgB;;;;YAAhB,UAAiB,yBAAoD;gBACnE,IAAI,yBAAyB,CAAC,cAAc,EAAE;oBAC5C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;iBACnC;qBAAM;oBACL,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;iBACjC;aACF;;oBAdFA,cAAS,SAAC;wBACT,QAAQ,EAAE,kBAAkB;wBAC5B,uHAA2C;qBAC5C;;;;;wBALOC,sBAAiB;;;QAiBzB,0BAAC;KAfD;;;;;;;;;;;ACFA;QAaE;YAPiB,YAAO,GAA6B;gBACnD,UAAU,EAAE,iBAAiB;gBAC7B,SAAS,EAAE,CAAC,GAAG,CAAC;aACjB,CAAC;YAEM,cAAS,GAAuC,IAAIC,YAAO,EAAE,CAAC;YAGpE,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACjF;;;;;QAED,iCAAO;;;;YAAP,UAAQ,OAAgB;gBAAxB,iBAOC;gBANC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAE/B,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,IAAI,CACvCC,gBAAM;;;mBAAC,UAAC,KAAgC,IAAK,OAAA,KAAK,CAAC,MAAM,KAAK,OAAO,GAAA,EAAC,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AC1E;;QAC8B,sBAAC;KANhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
}
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("aitp-utils",["exports","@angular/common","rxjs","rxjs/operators","@angular/core"],t):t(e["aitp-utils"]={},e.ng.common,e.rxjs,e.rxjs.operators,e.ng.core)}(this,function(e,n,t,r,o){"use strict";var i=function(){function e(e){this.changeDetectorRef=e}return e.prototype.onViewportChange=function(e){e.isIntersecting?this.changeDetectorRef.reattach():this.changeDetectorRef.detach()},e.decorators=[{type:o.Component,args:[{selector:"aiut-in-viewport",template:'<div (inViewport)="onViewportChange($event)" aiutInViewport>\r\n <ng-content></ng-content>\r\n</div>\r\n'}]}],e.ctorParameters=function(){return[{type:o.ChangeDetectorRef}]},e}(),s=function(){function e(){this.options={rootMargin:"0px 0px 0px 0px",threshold:[.5]},this.callback$=new t.Subject,this.observer=new IntersectionObserver(this.handler.bind(this),this.options)}return e.prototype.observe=function(t){var e=this;return this.observer.observe(t),this.callback$.asObservable().pipe(r.filter(function(e){return e.target===t}),r.finalize(function(){return e.observer.unobserve(t)}))},e.prototype.handler=function(e){var t=this;e.forEach(function(e){return t.callback$.next(e)})},e.decorators=[{type:o.Injectable}],e.ctorParameters=function(){return[]},e}(),c=Symbol("destroy$"),a=function(e){return e[c]===undefined&&p(e),r.takeUntil(e[c])};function p(n){n[c]=new t.Observable(function(e){var t=n.ngOnDestroy;if(null==t)throw new Error("untilDestroy operator needs the component to have an ngOnDestroy method");return n.ngOnDestroy=function(){e.next(),e.complete(),t.call(n)},function(e){return n[c]=undefined}})}var u=function(){function e(e,t,n){this.elementRef=e,this.viewportService=t,this.platformId=n,this.preRender=!0,this.oneTime=!1,this.inViewport=new o.EventEmitter}return e.prototype.ngOnInit=function(){var t=this;n.isPlatformBrowser(this.platformId)?this.oneTime?this.viewportService.observe(this.elementRef.nativeElement).pipe(a(this),r.filter(function(e){return.5<=e.intersectionRatio}),r.take(1)).subscribe(function(e){t.inViewport.emit(e)}):this.viewportService.observe(this.elementRef.nativeElement).pipe(a(this)).subscribe(function(e){t.inViewport.emit(e)}):this.preRender&&this.inViewport.emit({isIntersecting:!0,intersectionRatio:1})},e.prototype.ngOnDestroy=function(){},e.decorators=[{type:o.Directive,args:[{selector:"[aiutInViewport]"}]}],e.ctorParameters=function(){return[{type:o.ElementRef},{type:s},{type:Object,decorators:[{type:o.Inject,args:[o.PLATFORM_ID]}]}]},e.propDecorators={preRender:[{type:o.Input}],oneTime:[{type:o.Input}],inViewport:[{type:o.Output}]},e}(),f=function(){function e(){}return e.decorators=[{type:o.NgModule,args:[{imports:[n.CommonModule],declarations:[u,i],providers:[s],exports:[u,i]}]}],e}();e.AitpUtilsModule=f,e.InViewportComponent=i,e.AiutComponent=function l(e){void 0===e&&(e={});var n=o.Component(e);return function(e){if(n(e),o.isDevMode()){var t=e.ngOnChange;e.ngOnChange=function(){console.info(e.constructor.name+" changed"),t.call(e)}}}},e.InViewportDirective=u,e.addDestroyObservableToComponent=p,e.destroy$=c,e.untilDestroy=a,e.ViewportService=s,e.ɵb=i,e.ɵa=u,e.ɵc=s,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("aitp-utils",["exports","@angular/common","@angular/core","rxjs","rxjs/operators"],t):t(e["aitp-utils"]={},e.ng.common,e.ng.core,e.rxjs,e.rxjs.operators)}(this,function(e,r,n,t,o){"use strict";var i=function(){function e(e){this.changeDetectorRef=e}return e.prototype.onViewportChange=function(e){e.isIntersecting?this.changeDetectorRef.reattach():this.changeDetectorRef.detach()},e.decorators=[{type:n.Component,args:[{selector:"aiut-in-viewport",template:'<div (inViewport)="onViewportChange($event)" aiutInViewport>\r\n <ng-content></ng-content>\r\n</div>\r\n'}]}],e.ctorParameters=function(){return[{type:n.ChangeDetectorRef}]},e}(),s=function(){function e(){this.options={rootMargin:"0px 0px 0px 0px",threshold:[.5]},this.callback$=new t.Subject,this.observer=new IntersectionObserver(this.handler.bind(this),this.options)}return e.prototype.observe=function(t){var e=this;return this.observer.observe(t),this.callback$.asObservable().pipe(o.filter(function(e){return e.target===t}),o.finalize(function(){return e.observer.unobserve(t)}))},e.prototype.handler=function(e){var t=this;e.forEach(function(e){return t.callback$.next(e)})},e.decorators=[{type:n.Injectable}],e.ctorParameters=function(){return[]},e}(),c=Symbol("destroy$"),a=function(e){return e[c]===undefined&&p(e),o.takeUntil(e[c])};function p(r){r[c]=new t.Observable(function(e){var t=r.ngOnDestroy;if(null==t)throw new Error("untilDestroy operator needs the component to have an ngOnDestroy method");return r.ngOnDestroy=function(){e.next(),e.complete(),t.call(r)},function(e){return r[c]=undefined}})}var u=function(){function e(e,t,r){this.elementRef=e,this.viewportService=t,this.platformId=r,this.preRender=!0,this.oneTime=!1,this.inViewport=new n.EventEmitter}return e.prototype.ngOnInit=function(){var t=this;r.isPlatformBrowser(this.platformId)?this.oneTime?this.viewportService.observe(this.elementRef.nativeElement).pipe(a(this),o.filter(function(e){return.5<=e.intersectionRatio}),o.take(1)).subscribe(function(e){t.inViewport.emit(e)}):this.viewportService.observe(this.elementRef.nativeElement).pipe(a(this)).subscribe(function(e){t.inViewport.emit(e)}):this.preRender&&this.inViewport.emit({isIntersecting:!0,intersectionRatio:1})},e.prototype.ngOnDestroy=function(){},e.decorators=[{type:n.Directive,args:[{selector:"[aiutInViewport]"}]}],e.ctorParameters=function(){return[{type:n.ElementRef},{type:s},{type:Object,decorators:[{type:n.Inject,args:[n.PLATFORM_ID]}]}]},e.propDecorators={preRender:[{type:n.Input}],oneTime:[{type:n.Input}],inViewport:[{type:n.Output}]},e}(),f=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{imports:[r.CommonModule],declarations:[u,i],providers:[s],exports:[u,i]}]}],e}();e.AitpUtilsModule=f,e.InViewportComponent=i,e.InViewportDirective=u,e.addDestroyObservableToComponent=p,e.destroy$=c,e.untilDestroy=a,e.ViewportService=s,e.ɵb=i,e.ɵa=u,e.ɵc=s,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=aitp-utils.umd.min.js.map
\ No newline at end of file
......@@ -5,8 +5,7 @@
"ng://aitp-utils/lib/services/viewport.service.ts",
"ng://aitp-utils/lib/operators/until-destroy.ts",
"ng://aitp-utils/lib/directives/in-viewport.directive.ts",
"ng://aitp-utils/lib/aitp-utils.module.ts",
"ng://aitp-utils/lib/decorators/component.decorator.ts"
"ng://aitp-utils/lib/aitp-utils.module.ts"
],
"names": [
"InViewportComponent",
......@@ -94,25 +93,14 @@
"Components.InViewportComponent",
"providers",
"Services.ViewportService",
"exports",
"AiutComponent",
"ngCompDecorator",
"compType",
"isDevMode",
"orignalChange_1",
"ngOnChange",
"console",
"info",
"constructor",
"name"
"exports"
],
"mappings": "2ZAAA,IAAAA,EAAA,WAOE,SAAAA,EAAoBC,GAAAC,KAAAD,kBAAAA,EAUtB,OAPED,EAAAG,UAAAC,iBAAA,SAAiBC,GACXA,EAA0BC,eAC5BJ,KAAKD,kBAAkBM,WAEvBL,KAAKD,kBAAkBO,8BAZ5BC,EAAAA,UAASC,KAAA,CAAC,CACTC,SAAU,mBACVC,SAAA,yJAJMC,EAAAA,qBAiBRb,EAjBA,GCAAc,EAAA,WAaE,SAAAA,IAPiBZ,KAAAa,QAAoC,CACnDC,WAAY,kBACZC,UAAW,CAAC,KAGNf,KAAAgB,UAAgD,IAAIC,EAAAA,QAG1DjB,KAAKkB,SAAW,IAAIC,qBAAqBnB,KAAKoB,QAAQC,KAAKrB,MAAOA,KAAKa,SAe3E,OAZED,EAAAX,UAAAqB,QAAA,SAAQC,GAAR,IAAAC,EAAAxB,KAGE,OAFAA,KAAKkB,SAASI,QAAQC,GAEfvB,KAAKgB,UAAUS,eAAeC,KACnCC,EAAAA,OAAM,SAA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ACxBlC,KACCY,EAAatC,MACb2B,EAAAA,OAAM,SAACC,GAAS,MAA2B,IAA3BA,EAAMiC,oBACtBC,EAAAA,KAAK,IAENC,UAAS,SAAEnC,GACVJ,EAAKgC,WAAWQ,KAAKpC,KAGzB5B,KAAKoD,gBACF9B,QAAQtB,KAAKmD,WAAWS,eACxBlC,KAAKY,EAAatC,OAClB+D,UAAS,SAAEnC,GACVJ,EAAKgC,WAAWQ,KAAKpC,KAIvB5B,KAAKsD,WACPtD,KAAKwD,WAAWQ,KAAK,CAAC5D,gBAAgB,EAAMyD,kBAAmB,KAKrEX,EAAAjD,UAAA4C,YAAA,iCA3CDoB,EAAAA,UAASzD,KAAA,CAAC,CACTC,SAAU,gEAPOyD,EAAAA,kBAGXtD,SAcqCuD,OAAMC,WAAA,CAAA,CAAAC,KAA9CC,EAAAA,OAAM9D,KAAA,CAAC+D,EAAAA,qDAPTC,EAAAA,uBACAA,EAAAA,0BACAC,EAAAA,UAuCHvB,EAnDA,GCAAwB,EAAA,WAOA,SAAAA,KAM+B,2BAN9BC,EAAAA,SAAQnE,KAAA,CAAC,CACRoE,QAAS,CAACC,EAAAA,cACVC,aAAc,CAACC,EAAgCC,GAC/CC,UAAW,CAACC,GACZC,QAAS,CAACJ,EAAgCC,OAEbN,EAb/B",
"sourcesContent": [
"import {ChangeDetectorRef, Component} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'aiut-in-viewport',\r\n templateUrl: './in-viewport.component.html'\r\n})\r\nexport class InViewportComponent {\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {\r\n }\r\n\r\n onViewportChange(intersectionObserverEntry: IntersectionObserverEntry) {\r\n if (intersectionObserverEntry.isIntersecting) {\r\n this.changeDetectorRef.reattach();\r\n } else {\r\n this.changeDetectorRef.detach();\r\n }\r\n }\r\n}\r\n",
"import {Injectable} from '@angular/core';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {filter, finalize} from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class ViewportService {\r\n private readonly options: IntersectionObserverInit = {\r\n rootMargin: '0px 0px 0px 0px',\r\n threshold: [0.5],\r\n };\r\n private observer: IntersectionObserver;\r\n private callback$: Subject<IntersectionObserverEntry> = new Subject();\r\n\r\n constructor() {\r\n this.observer = new IntersectionObserver(this.handler.bind(this), this.options);\r\n }\r\n\r\n observe(element: Element): Observable<IntersectionObserverEntry> {\r\n this.observer.observe(element);\r\n\r\n return this.callback$.asObservable().pipe(\r\n filter((entry: IntersectionObserverEntry) => entry.target === element),\r\n finalize(() => this.observer.unobserve(element)),\r\n );\r\n }\r\n\r\n private handler(entries: Array<IntersectionObserverEntry>): void {\r\n entries.forEach(entry => this.callback$.next(entry));\r\n }\r\n}\r\n",
"import {MonoTypeOperatorFunction, Observable} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\n// create a symbol identify the observable I add to\r\n// the component so it doesn't conflict with anything.\r\n// I need this so I'm able to add the desired behaviour to the component.\r\nexport const destroy$ = Symbol('destroy$');\r\n\r\n/**\r\n * An operator that takes until destroy it takes a components this a parameter\r\n * returns a pipeable RxJS operator.\r\n */\r\nexport const untilDestroy = <T>(component: any): MonoTypeOperatorFunction<T> => {\r\n if (component[destroy$] === undefined) {\r\n // only hookup each component once.\r\n addDestroyObservableToComponent(component);\r\n }\r\n\r\n // pipe in the takeUntil destroy$ and return the source unaltered\r\n return takeUntil<T>(component[destroy$]);\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function addDestroyObservableToComponent(component: any) {\r\n component[destroy$] = new Observable<void>(observer => {\r\n // keep track of the original destroy function,\r\n // the user might do something in there\r\n const orignalDestroy = component.ngOnDestroy;\r\n if (orignalDestroy == null) {\r\n // Angular does not support dynamic added destroy methods\r\n // so make sure there is one.\r\n throw new Error('untilDestroy operator needs the component to have an ngOnDestroy method');\r\n }\r\n // replace the ngOndestroy\r\n component.ngOnDestroy = () => {\r\n // fire off the destroy observable\r\n observer.next();\r\n // complete the observable\r\n observer.complete();\r\n // and at last, call the original destroy\r\n orignalDestroy.call(component);\r\n };\r\n // return cleanup function.\r\n return (_: any) => (component[destroy$] = undefined);\r\n });\r\n}\r\n",
"import {Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID,} from '@angular/core';\r\nimport {isPlatformBrowser} from '@angular/common';\r\nimport {filter, take} from 'rxjs/operators';\r\nimport {ViewportService} from '../services';\r\nimport {untilDestroy} from '../operators';\r\n\r\n@Directive({\r\n selector: '[aiutInViewport]',\r\n})\r\nexport class InViewportDirective implements OnInit, OnDestroy {\r\n @Input() public preRender = true;\r\n @Input() public oneTime = false;\r\n @Output() readonly inViewport = new EventEmitter<Partial<IntersectionObserverEntry>>();\r\n\r\n constructor(\r\n private readonly elementRef: ElementRef,\r\n private viewportService: ViewportService,\r\n @Inject(PLATFORM_ID) private platformId: Object,\r\n ) {\r\n }\r\n\r\n public ngOnInit() {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.oneTime) {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(\r\n untilDestroy(this),\r\n filter(entry => entry.intersectionRatio >= 0.5),\r\n take(1),\r\n )\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n } else {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(untilDestroy(this))\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n }\r\n } else {\r\n if (this.preRender) {\r\n this.inViewport.emit({isIntersecting: true, intersectionRatio: 1});\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n }\r\n}\r\n",
"import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport * as Components from './components';\nimport * as Directives from './directives';\nimport * as Services from './services';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\n providers: [Services.ViewportService],\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\n})\nexport class AitpUtilsModule { }\n",
"import {Component, isDevMode} from '@angular/core';\r\n\r\nexport function AiutComponent(args: any = {}): (cls: any) => any {\r\n const ngCompDecorator = Component(args);\r\n\r\n return function (compType: any) {\r\n ngCompDecorator(compType);\r\n\r\n if (isDevMode()) {\r\n const orignalChange = compType.ngOnChange;\r\n\r\n compType.ngOnChange = () => {\r\n console.info(`${compType.constructor.name} changed`);\r\n\r\n orignalChange.call(compType);\r\n };\r\n }\r\n };\r\n}\r\n"
"import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport * as Components from './components';\r\nimport * as Directives from './directives';\r\nimport * as Services from './services';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\r\n providers: [Services.ViewportService],\r\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\r\n})\r\nexport class AitpUtilsModule { }\r\n"
]
}
......@@ -8,7 +8,6 @@
export {
AitpUtilsModule,
InViewportComponent,
AiutComponent,
InViewportDirective,
addDestroyObservableToComponent,
destroy$,
......@@ -18,4 +17,4 @@ export {
export {InViewportComponent as ɵb} from './lib/components';
export {InViewportDirective as ɵa} from './lib/directives';
export {ViewportService as ɵc} from './lib/services';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWl0cC11dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJhaXRwLXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxtS0FBYyxjQUFjLENBQUM7QUFFN0IsT0FBTyxFQUFDLG1CQUFtQixJQUFJLEVBQUUsRUFBQyxNQUFNLGtCQUFrQixDQUFDO0FBQzNELE9BQU8sRUFBQyxtQkFBbUIsSUFBSSxFQUFFLEVBQUMsTUFBTSxrQkFBa0IsQ0FBQztBQUMzRCx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XBvbmVudHMuSW5WaWV3cG9ydENvbXBvbmVudF1cclxufSlcclxuZXhwb3J0IGNsYXNzIEFpdHBVdGlsc01vZHVsZSB7IH1cclxuIl19
......@@ -7,8 +7,7 @@
*/
export {AitpUtilsModule} from './lib/aitp-utils.module';
export {InViewportComponent} from './lib/components';
export {AiutComponent} from './lib/decorators';
export {InViewportDirective} from './lib/directives';
export {addDestroyObservableToComponent, destroy$, untilDestroy} from './lib/operators';
export {ViewportService} from './lib/services';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxnQ0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyw4QkFBYyxrQkFBa0IsQ0FBQztBQUNqQyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyx3RUFBYyxpQkFBaUIsQ0FBQztBQUNoQyxnQ0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgYWl0cC11dGlsc1xuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2FpdHAtdXRpbHMubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbXBvbmVudHMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZGVjb3JhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kaXJlY3RpdmVzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL29wZXJhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcyc7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxnQ0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyx3RUFBYyxpQkFBaUIsQ0FBQztBQUNoQyxnQ0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBhaXRwLXV0aWxzXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvYWl0cC11dGlscy5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb21wb25lbnRzJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvZGlyZWN0aXZlcyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL29wZXJhdG9ycyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzJztcclxuIl19
......@@ -8,7 +8,6 @@
export {
AitpUtilsModule,
InViewportComponent,
AiutComponent,
InViewportDirective,
addDestroyObservableToComponent,
destroy$,
......@@ -18,4 +17,4 @@ export {
export {InViewportComponent as ɵb} from './lib/components';
export {InViewportDirective as ɵa} from './lib/directives';
export {ViewportService as ɵc} from './lib/services';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWl0cC11dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJhaXRwLXV0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxtS0FBYyxjQUFjLENBQUM7QU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G4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuXG5leHBvcnQge0luVmlld3BvcnRDb21wb25lbnQgYXMgybVifSBmcm9tICcuL2xpYi9jb21wb25lbnRzJztcbmV4cG9ydCB7SW5WaWV3cG9ydERpcmVjdGl2ZSBhcyDJtWF9IGZyb20gJy4vbGliL2RpcmVjdGl2ZXMnO1xuZXhwb3J0IHtWaWV3cG9ydFNlcnZpY2UgYXMgybVjfSBmcm9tICcuL2xpYi9zZXJ2aWNlcyc7Il19
......@@ -25,4 +25,4 @@ var AitpUtilsModule = /** @class */ (function () {
return AitpUtilsModule;
}());
export {AitpUtilsModule};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWl0cC11dGlscy5tb2R1bGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9haXRwLXV0aWxzLyIsInNvdXJjZXMiOlsibGliL2FpdHAtdXRpbHMubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sRUFBQyxZQUFZLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQztBQUU3QyxPQUFPLEtBQUssVUFBVSxNQUFNLGNBQWMsQ0FBQztBQUMzQyxPQUFPLEtBQUssVUFBVSxNQUFNLGNBQWMsQ0FBQztBQUMzQyxPQUFPLEtBQUssUUFBUSxNQUFNLFlBQVksQ0FBQztBQUV2QztJQUFBO0lBTStCLENBQUM7O2dCQU4vQixRQUFRLFNBQUM7b0JBQ1IsT0FBTyxFQUFFLENBQUMsWUFBWSxDQUFDO29CQUN2QixZQUFZLEVBQUUsQ0FBQyxVQUFVLENBQUMsbUJBQW1CLEVBQUUsVUFBVSxDQUFDLG1CQUFtQixDQU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xuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlXSxcclxuICBkZWNsYXJhdGlvbnM6IFtEaXJlY3RpdmVzLkluVmlld3BvcnREaXJlY3RpdmUsIENvbXBvbmVudHMuSW5WaWV3cG9ydENvbXBvbmVudF0sXHJcbiAgcHJvdmlkZXJzOiBbU2VydmljZXMuVmlld3BvcnRTZXJ2aWNlXSxcclxuICBleHBvcnRzOiBbRGlyZWN0aXZlcy5JblZpZXdwb3J0RGlyZWN0aXZlLCBDb21wb25lbnRzLkluVmlld3BvcnRDb21wb25lbnRdXHJcbn0pXHJcbmV4cG9ydCBjbGFzcyBBaXRwVXRpbHNNb2R1bGUgeyB9XHJcbiJdfQ==
......@@ -7,8 +7,7 @@
*/
export {AitpUtilsModule} from './lib/aitp-utils.module';
export {InViewportComponent} from './lib/components';
export {AiutComponent} from './lib/decorators';
export {InViewportDirective} from './lib/directives';
export {addDestroyObservableToComponent, destroy$, untilDestroy} from './lib/operators';
export {ViewportService} from './lib/services';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxnQ0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyw4QkFBYyxrQkFBa0IsQ0FBQztBQUNqQyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyx3RUFBYyxpQkFBaUIsQ0FBQztBQUNoQyxnQ0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgYWl0cC11dGlsc1xuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL2FpdHAtdXRpbHMubW9kdWxlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbXBvbmVudHMnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZGVjb3JhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kaXJlY3RpdmVzJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL29wZXJhdG9ycyc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcyc7XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL2FpdHAtdXRpbHMvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSxnQ0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxvQ0FBYyxrQkFBa0IsQ0FBQztBQUNqQyx3RUFBYyxpQkFBaUIsQ0FBQztBQUNoQyxnQ0FBYyxnQkFBZ0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiBhaXRwLXV0aWxzXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvYWl0cC11dGlscy5tb2R1bGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb21wb25lbnRzJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvZGlyZWN0aXZlcyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL29wZXJhdG9ycyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzJztcclxuIl19
import {CommonModule, isPlatformBrowser} from '@angular/common';
import {Observable, Subject} from 'rxjs';
import {filter, finalize, take, takeUntil} from 'rxjs/operators';
import {
ChangeDetectorRef,
Component,
......@@ -10,11 +8,12 @@ import {
Inject,
Injectable,
Input,
isDevMode,
NgModule,
Output,
PLATFORM_ID
} from '@angular/core';
import {Observable, Subject} from 'rxjs';
import {filter, finalize, take, takeUntil} from 'rxjs/operators';
/**
* @fileoverview added by tsickle
......@@ -294,42 +293,6 @@ AitpUtilsModule.decorators = [
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?=} args
* @return {?}
*/
function AiutComponent(args = {}) {
/** @type {?} */
const ngCompDecorator = Component(args);
return (/**
* @param {?} compType
* @return {?}
*/
function (compType) {
ngCompDecorator(compType);
if (isDevMode()) {
/** @type {?} */
const orignalChange = compType.ngOnChange;
compType.ngOnChange = (/**
* @return {?}
*/
() => {
console.info(`${compType.constructor.name} changed`);
orignalChange.call(compType);
});
}
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
......@@ -339,7 +302,6 @@ function AiutComponent(args = {}) {
export {
AitpUtilsModule,
InViewportComponent,
AiutComponent,
InViewportDirective,
addDestroyObservableToComponent,
destroy$,
......
......@@ -6,21 +6,19 @@
"ng://aitp-utils/lib/services/viewport.service.ts",
"ng://aitp-utils/lib/operators/until-destroy.ts",
"ng://aitp-utils/lib/directives/in-viewport.directive.ts",
"ng://aitp-utils/lib/aitp-utils.module.ts",
"ng://aitp-utils/lib/decorators/component.decorator.ts"
"ng://aitp-utils/lib/aitp-utils.module.ts"
],
"sourcesContent": [
"import {ChangeDetectorRef, Component} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'aiut-in-viewport',\r\n templateUrl: './in-viewport.component.html'\r\n})\r\nexport class InViewportComponent {\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {\r\n }\r\n\r\n onViewportChange(intersectionObserverEntry: IntersectionObserverEntry) {\r\n if (intersectionObserverEntry.isIntersecting) {\r\n this.changeDetectorRef.reattach();\r\n } else {\r\n this.changeDetectorRef.detach();\r\n }\r\n }\r\n}\r\n",
"import {Injectable} from '@angular/core';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {filter, finalize} from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class ViewportService {\r\n private readonly options: IntersectionObserverInit = {\r\n rootMargin: '0px 0px 0px 0px',\r\n threshold: [0.5],\r\n };\r\n private observer: IntersectionObserver;\r\n private callback$: Subject<IntersectionObserverEntry> = new Subject();\r\n\r\n constructor() {\r\n this.observer = new IntersectionObserver(this.handler.bind(this), this.options);\r\n }\r\n\r\n observe(element: Element): Observable<IntersectionObserverEntry> {\r\n this.observer.observe(element);\r\n\r\n return this.callback$.asObservable().pipe(\r\n filter((entry: IntersectionObserverEntry) => entry.target === element),\r\n finalize(() => this.observer.unobserve(element)),\r\n );\r\n }\r\n\r\n private handler(entries: Array<IntersectionObserverEntry>): void {\r\n entries.forEach(entry => this.callback$.next(entry));\r\n }\r\n}\r\n",
"import {MonoTypeOperatorFunction, Observable} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\n// create a symbol identify the observable I add to\r\n// the component so it doesn't conflict with anything.\r\n// I need this so I'm able to add the desired behaviour to the component.\r\nexport const destroy$ = Symbol('destroy$');\r\n\r\n/**\r\n * An operator that takes until destroy it takes a components this a parameter\r\n * returns a pipeable RxJS operator.\r\n */\r\nexport const untilDestroy = <T>(component: any): MonoTypeOperatorFunction<T> => {\r\n if (component[destroy$] === undefined) {\r\n // only hookup each component once.\r\n addDestroyObservableToComponent(component);\r\n }\r\n\r\n // pipe in the takeUntil destroy$ and return the source unaltered\r\n return takeUntil<T>(component[destroy$]);\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function addDestroyObservableToComponent(component: any) {\r\n component[destroy$] = new Observable<void>(observer => {\r\n // keep track of the original destroy function,\r\n // the user might do something in there\r\n const orignalDestroy = component.ngOnDestroy;\r\n if (orignalDestroy == null) {\r\n // Angular does not support dynamic added destroy methods\r\n // so make sure there is one.\r\n throw new Error('untilDestroy operator needs the component to have an ngOnDestroy method');\r\n }\r\n // replace the ngOndestroy\r\n component.ngOnDestroy = () => {\r\n // fire off the destroy observable\r\n observer.next();\r\n // complete the observable\r\n observer.complete();\r\n // and at last, call the original destroy\r\n orignalDestroy.call(component);\r\n };\r\n // return cleanup function.\r\n return (_: any) => (component[destroy$] = undefined);\r\n });\r\n}\r\n",
"import {Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID,} from '@angular/core';\r\nimport {isPlatformBrowser} from '@angular/common';\r\nimport {filter, take} from 'rxjs/operators';\r\nimport {ViewportService} from '../services';\r\nimport {untilDestroy} from '../operators';\r\n\r\n@Directive({\r\n selector: '[aiutInViewport]',\r\n})\r\nexport class InViewportDirective implements OnInit, OnDestroy {\r\n @Input() public preRender = true;\r\n @Input() public oneTime = false;\r\n @Output() readonly inViewport = new EventEmitter<Partial<IntersectionObserverEntry>>();\r\n\r\n constructor(\r\n private readonly elementRef: ElementRef,\r\n private viewportService: ViewportService,\r\n @Inject(PLATFORM_ID) private platformId: Object,\r\n ) {\r\n }\r\n\r\n public ngOnInit() {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.oneTime) {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(\r\n untilDestroy(this),\r\n filter(entry => entry.intersectionRatio >= 0.5),\r\n take(1),\r\n )\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n } else {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(untilDestroy(this))\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n }\r\n } else {\r\n if (this.preRender) {\r\n this.inViewport.emit({isIntersecting: true, intersectionRatio: 1});\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n }\r\n}\r\n",
"import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport * as Components from './components';\nimport * as Directives from './directives';\nimport * as Services from './services';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\n providers: [Services.ViewportService],\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\n})\nexport class AitpUtilsModule { }\n",
"import {Component, isDevMode} from '@angular/core';\r\n\r\nexport function AiutComponent(args: any = {}): (cls: any) => any {\r\n const ngCompDecorator = Component(args);\r\n\r\n return function (compType: any) {\r\n ngCompDecorator(compType);\r\n\r\n if (isDevMode()) {\r\n const orignalChange = compType.ngOnChange;\r\n\r\n compType.ngOnChange = () => {\r\n console.info(`${compType.constructor.name} changed`);\r\n\r\n orignalChange.call(compType);\r\n };\r\n }\r\n };\r\n}\r\n"
"import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport * as Components from './components';\r\nimport * as Directives from './directives';\r\nimport * as Services from './services';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\r\n providers: [Services.ViewportService],\r\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\r\n})\r\nexport class AitpUtilsModule { }\r\n"
],
"names": [
"Directives.InViewportDirective",
"Components.InViewportComponent",
"Services.ViewportService"
],
"mappings": ";;;;;;;;;AAAA,MAMa,mBAAmB;;;;IAC9B,YAAoB,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;KACvD;;;;;IAED,gBAAgB,CAAC,yBAAoD;QACnE,IAAI,yBAAyB,CAAC,cAAc,EAAE;YAC5C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;SACjC;KACF;;;YAdF,SAAS,SAAC;g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E,CAACC,eAAwB,CAAC;gBACrC,OAAO,EAAE,CAACF,mBAA8B,EAAEC,mBAA8B,CAAC;aAC1E;;;;;;;;;;;;;;;"
}
import {CommonModule, isPlatformBrowser} from '@angular/common';
import {Observable, Subject} from 'rxjs';
import {filter, finalize, take, takeUntil} from 'rxjs/operators';
import {
ChangeDetectorRef,
Component,
......@@ -10,11 +8,12 @@ import {
Inject,
Injectable,
Input,
isDevMode,
NgModule,
Output,
PLATFORM_ID
} from '@angular/core';
import {Observable, Subject} from 'rxjs';
import {filter, finalize, take, takeUntil} from 'rxjs/operators';
/**
* @fileoverview added by tsickle
......@@ -329,45 +328,6 @@ var AitpUtilsModule = /** @class */ (function () {
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?=} args
* @return {?}
*/
function AiutComponent(args) {
if (args === void 0) {
args = {};
}
/** @type {?} */
var ngCompDecorator = Component(args);
return (/**
* @param {?} compType
* @return {?}
*/
function (compType) {
ngCompDecorator(compType);
if (isDevMode()) {
/** @type {?} */
var orignalChange_1 = compType.ngOnChange;
compType.ngOnChange = (/**
* @return {?}
*/
function () {
console.info(compType.constructor.name + " changed");
orignalChange_1.call(compType);
});
}
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @fileoverview added by tsickle
......@@ -377,7 +337,6 @@ function AiutComponent(args) {
export {
AitpUtilsModule,
InViewportComponent,
AiutComponent,
InViewportDirective,
addDestroyObservableToComponent,
destroy$,
......
......@@ -6,21 +6,19 @@
"ng://aitp-utils/lib/services/viewport.service.ts",
"ng://aitp-utils/lib/operators/until-destroy.ts",
"ng://aitp-utils/lib/directives/in-viewport.directive.ts",
"ng://aitp-utils/lib/aitp-utils.module.ts",
"ng://aitp-utils/lib/decorators/component.decorator.ts"
"ng://aitp-utils/lib/aitp-utils.module.ts"
],
"sourcesContent": [
"import {ChangeDetectorRef, Component} from '@angular/core';\r\n\r\n@Component({\r\n selector: 'aiut-in-viewport',\r\n templateUrl: './in-viewport.component.html'\r\n})\r\nexport class InViewportComponent {\r\n constructor(private changeDetectorRef: ChangeDetectorRef) {\r\n }\r\n\r\n onViewportChange(intersectionObserverEntry: IntersectionObserverEntry) {\r\n if (intersectionObserverEntry.isIntersecting) {\r\n this.changeDetectorRef.reattach();\r\n } else {\r\n this.changeDetectorRef.detach();\r\n }\r\n }\r\n}\r\n",
"import {Injectable} from '@angular/core';\r\nimport {Observable, Subject} from 'rxjs';\r\nimport {filter, finalize} from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class ViewportService {\r\n private readonly options: IntersectionObserverInit = {\r\n rootMargin: '0px 0px 0px 0px',\r\n threshold: [0.5],\r\n };\r\n private observer: IntersectionObserver;\r\n private callback$: Subject<IntersectionObserverEntry> = new Subject();\r\n\r\n constructor() {\r\n this.observer = new IntersectionObserver(this.handler.bind(this), this.options);\r\n }\r\n\r\n observe(element: Element): Observable<IntersectionObserverEntry> {\r\n this.observer.observe(element);\r\n\r\n return this.callback$.asObservable().pipe(\r\n filter((entry: IntersectionObserverEntry) => entry.target === element),\r\n finalize(() => this.observer.unobserve(element)),\r\n );\r\n }\r\n\r\n private handler(entries: Array<IntersectionObserverEntry>): void {\r\n entries.forEach(entry => this.callback$.next(entry));\r\n }\r\n}\r\n",
"import {MonoTypeOperatorFunction, Observable} from 'rxjs';\r\nimport {takeUntil} from 'rxjs/operators';\r\n\r\n// create a symbol identify the observable I add to\r\n// the component so it doesn't conflict with anything.\r\n// I need this so I'm able to add the desired behaviour to the component.\r\nexport const destroy$ = Symbol('destroy$');\r\n\r\n/**\r\n * An operator that takes until destroy it takes a components this a parameter\r\n * returns a pipeable RxJS operator.\r\n */\r\nexport const untilDestroy = <T>(component: any): MonoTypeOperatorFunction<T> => {\r\n if (component[destroy$] === undefined) {\r\n // only hookup each component once.\r\n addDestroyObservableToComponent(component);\r\n }\r\n\r\n // pipe in the takeUntil destroy$ and return the source unaltered\r\n return takeUntil<T>(component[destroy$]);\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function addDestroyObservableToComponent(component: any) {\r\n component[destroy$] = new Observable<void>(observer => {\r\n // keep track of the original destroy function,\r\n // the user might do something in there\r\n const orignalDestroy = component.ngOnDestroy;\r\n if (orignalDestroy == null) {\r\n // Angular does not support dynamic added destroy methods\r\n // so make sure there is one.\r\n throw new Error('untilDestroy operator needs the component to have an ngOnDestroy method');\r\n }\r\n // replace the ngOndestroy\r\n component.ngOnDestroy = () => {\r\n // fire off the destroy observable\r\n observer.next();\r\n // complete the observable\r\n observer.complete();\r\n // and at last, call the original destroy\r\n orignalDestroy.call(component);\r\n };\r\n // return cleanup function.\r\n return (_: any) => (component[destroy$] = undefined);\r\n });\r\n}\r\n",
"import {Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, OnInit, Output, PLATFORM_ID,} from '@angular/core';\r\nimport {isPlatformBrowser} from '@angular/common';\r\nimport {filter, take} from 'rxjs/operators';\r\nimport {ViewportService} from '../services';\r\nimport {untilDestroy} from '../operators';\r\n\r\n@Directive({\r\n selector: '[aiutInViewport]',\r\n})\r\nexport class InViewportDirective implements OnInit, OnDestroy {\r\n @Input() public preRender = true;\r\n @Input() public oneTime = false;\r\n @Output() readonly inViewport = new EventEmitter<Partial<IntersectionObserverEntry>>();\r\n\r\n constructor(\r\n private readonly elementRef: ElementRef,\r\n private viewportService: ViewportService,\r\n @Inject(PLATFORM_ID) private platformId: Object,\r\n ) {\r\n }\r\n\r\n public ngOnInit() {\r\n if (isPlatformBrowser(this.platformId)) {\r\n if (this.oneTime) {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(\r\n untilDestroy(this),\r\n filter(entry => entry.intersectionRatio >= 0.5),\r\n take(1),\r\n )\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n } else {\r\n this.viewportService\r\n .observe(this.elementRef.nativeElement)\r\n .pipe(untilDestroy(this))\r\n .subscribe((entry: IntersectionObserverEntry) => {\r\n this.inViewport.emit(entry);\r\n });\r\n }\r\n } else {\r\n if (this.preRender) {\r\n this.inViewport.emit({isIntersecting: true, intersectionRatio: 1});\r\n }\r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n }\r\n}\r\n",
"import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\n\nimport * as Components from './components';\nimport * as Directives from './directives';\nimport * as Services from './services';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\n providers: [Services.ViewportService],\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\n})\nexport class AitpUtilsModule { }\n",
"import {Component, isDevMode} from '@angular/core';\r\n\r\nexport function AiutComponent(args: any = {}): (cls: any) => any {\r\n const ngCompDecorator = Component(args);\r\n\r\n return function (compType: any) {\r\n ngCompDecorator(compType);\r\n\r\n if (isDevMode()) {\r\n const orignalChange = compType.ngOnChange;\r\n\r\n compType.ngOnChange = () => {\r\n console.info(`${compType.constructor.name} changed`);\r\n\r\n orignalChange.call(compType);\r\n };\r\n }\r\n };\r\n}\r\n"
"import {NgModule} from '@angular/core';\r\nimport {CommonModule} from '@angular/common';\r\n\r\nimport * as Components from './components';\r\nimport * as Directives from './directives';\r\nimport * as Services from './services';\r\n\r\n@NgModule({\r\n imports: [CommonModule],\r\n declarations: [Directives.InViewportDirective, Components.InViewportComponent],\r\n providers: [Services.ViewportService],\r\n exports: [Directives.InViewportDirective, Components.InViewportComponent]\r\n})\r\nexport class AitpUtilsModule { }\r\n"
],
"names": [
"Directives.InViewportDirective",
"Components.InViewportComponent",
"Services.ViewportService"
],
"mappings": ";;;;;;;;;AAAA;IAOE,6BAAoB,iBAAoC;QAApC,sBAAiB,G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BACxB,SAAS;;;;gBAAC,UAAC,KAAgC;oBAC1C,KAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAC7B,EAAC,CAAC;aACN;SACF;aAAM;YACL,IAAI,IAAI,CAAC,SAAS,EAAE;gBAClB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAC,cAAc,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,EAAC,CAAC,CAAC;aACpE;SACF;KACF;;;;IAED,yCAAW;;;IAAX;KACC;;gBA5CF,SAAS,SAAC;oBACT,QAAQ,EAAE,kBAAkB;iBAC7B;;;;gBARkB,UAAU;gBAGrB,eAAe;gBAcsB,MAAM,uBAA9C,MAAM,SAAC,WAAW;;;4BAPpB,KAAK;0BACL,KAAK;6BACL,MAAM;;IAuCT,0BAAC;CA7CD;;;;;;;;;;;ACNA;IAOA;KAMgC;;gBAN/B,QAAQ,SAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAACA,mBAA8B,EAAEC,mBAA8B,CAAC;oBAC9E,SAAS,EAAE,CAACC,eAAwB,CAAC;oBACrC,OAAO,EAAE,CAACF,mBAA8B,EAAEC,mBAA8B,CAAC;iBAC1E;;IAC8B,sBAAC;CANhC;;;;;;;;;;;;;;"
}
export * from './lib/aitp-utils.module';
export * from './lib/components';
export * from './lib/decorators';
export * from './lib/directives';
export * from './lib/operators';
export * from './lib/services';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment