feat(angular): angular 9 support (#19515)

* init ivy support

* chore(): angular prerelease

* chore: update

* updates

* angular 8 deps

* chore(angular): update sync script

* updates

* chore(): remove console log

* chore(): updates

* chore(): update release script

* fix(): remove comments

* fix(): remove test version

* fix(): failing angular test

* fix(): failing angular tests

* fix(): update ci steps

* fix(): fix sync script

* chore(): refactor angular proxies

* chore(): updates

* chore(): updates

* chore(): lint

* chore(): updates

* chore(ssr): check for window

* chore(): fix virtual scroll angular tests

* chore(): lint

* chore(): add server to link

* chore(scripts): update release script

* chore(): bump version check

* style(scripts): spacing
This commit is contained in:
Mike Hartington
2019-12-18 18:43:59 -05:00
committed by GitHub
parent 49c394c3d3
commit 2344d0b272
35 changed files with 501 additions and 359 deletions

View File

@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, EmbeddedViewRef, IterableDiffer, IterableDiffers, NgZone, SimpleChanges, TrackByFunction } from '@angular/core';
import { Cell, CellType, FooterHeightFn, HeaderFn, HeaderHeightFn, ItemHeightFn } from '@ionic/core';
import { proxyInputs, proxyMethods } from '../proxies-utils';
import { ProxyCmp } from '../proxies-utils';
import { VirtualFooter } from './virtual-footer';
import { VirtualHeader } from './virtual-header';
@ -112,6 +112,10 @@ export declare interface IonVirtualScroll {
'positionForItem': (index: number) => Promise<number>;
}
@ProxyCmp({
inputs: ['approxItemHeight', 'approxHeaderHeight', 'approxFooterHeight', 'headerFn', 'footerFn', 'items', 'itemHeight', 'headerHeight', 'footerHeight'],
methods: ['checkEnd', 'checkRange', 'positionForItem']
})
@Component({
selector: 'ion-virtual-scroll',
template: '<ng-content></ng-content>',
@ -133,11 +137,11 @@ export class IonVirtualScroll {
private differ?: IterableDiffer<any>;
private el: HTMLIonVirtualScrollElement;
private refMap = new WeakMap<HTMLElement, EmbeddedViewRef<VirtualContext>> ();
private refMap = new WeakMap<HTMLElement, EmbeddedViewRef<VirtualContext>>();
@ContentChild(VirtualItem) itmTmp!: VirtualItem;
@ContentChild(VirtualHeader) hdrTmp!: VirtualHeader;
@ContentChild(VirtualFooter) ftrTmp!: VirtualFooter;
@ContentChild(VirtualItem, { static: false }) itmTmp!: VirtualItem;
@ContentChild(VirtualHeader, { static: false }) hdrTmp!: VirtualHeader;
@ContentChild(VirtualFooter, { static: false }) ftrTmp!: VirtualFooter;
constructor(
private z: NgZone,
@ -215,21 +219,3 @@ const getElement = (view: EmbeddedViewRef<VirtualContext>): HTMLElement => {
}
throw new Error('virtual element was not created');
};
proxyInputs(IonVirtualScroll, [
'approxItemHeight',
'approxHeaderHeight',
'approxFooterHeight',
'headerFn',
'footerFn',
'items',
'itemHeight',
'headerHeight',
'footerHeight'
]);
proxyMethods(IonVirtualScroll, [
'checkEnd',
'checkRange',
'positionForItem'
]);