Skip to content

Commit

Permalink
build: fix integration
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuanxyz committed Jul 5, 2019
1 parent 308ff02 commit ee932c0
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 19 deletions.
22 changes: 17 additions & 5 deletions components/core/no-animation/nz-no-animation.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
*/

import { coerceElement } from '@angular/cdk/coercion';
import { AfterViewInit, Directive, ElementRef, Inject, Input, OnChanges, Optional, Renderer2 } from '@angular/core';
import {
AfterViewInit,
Directive,
ElementRef,
// HostBinding,
Inject,
Input,
OnChanges,
Optional,
Renderer2
} from '@angular/core';
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';

import { InputBoolean } from '../util/convert';
Expand All @@ -16,14 +26,16 @@ const DISABLED_CLASSNAME = 'nz-animate-disabled';

@Directive({
selector: '[nzNoAnimation]',
exportAs: 'nzNoAnimation',
host: {
'[@.disabled]': 'nzNoAnimation'
}
exportAs: 'nzNoAnimation'
})
export class NzNoAnimationDirective implements OnChanges, AfterViewInit {
@Input() @InputBoolean() nzNoAnimation: boolean = false;

// TODO ivy
// @HostBinding('@.disabled')
// get noAnimation(): boolean {
// return this.nzNoAnimation
// }
constructor(
private element: ElementRef,
private renderer: Renderer2,
Expand Down
20 changes: 14 additions & 6 deletions components/tooltip/nz-tooltip.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/

import {
AfterContentInit,
AfterViewInit,
ComponentFactory,
ComponentFactoryResolver,
Expand Down Expand Up @@ -40,7 +41,7 @@ import { NzToolTipComponent } from './nz-tooltip.component';
'[class.ant-tooltip-open]': 'isTooltipOpen'
}
})
export class NzTooltipDirective implements AfterViewInit, OnChanges, OnInit, OnDestroy {
export class NzTooltipDirective implements AfterViewInit, OnChanges, OnInit, OnDestroy, AfterContentInit {
// [NOTE] Here hard coded, and nzTitle used only under NzTooltipDirective currently.
isTooltipOpen: boolean = false;
isDynamicTooltip = false; // Indicate whether current tooltip is dynamic created
Expand Down Expand Up @@ -96,10 +97,20 @@ export class NzTooltipDirective implements AfterViewInit, OnChanges, OnInit, OnD
this.updateProxies(changes);
}

ngOnInit(): void {
ngOnInit(): void {}

ngAfterContentInit(): void {}

ngAfterViewInit(): void {
// Support faster tooltip mode: <a nz-tooltip="xxx"></a>. [NOTE] Used only under NzTooltipDirective currently.
if (!this.tooltip) {
const tooltipComponent = this.hostView.createComponent(this.factory);
const componentFactory = this.resolver.resolveComponentFactory(NzToolTipComponent);

const tooltipComponent = this.hostView.createComponent(
componentFactory,
this.hostView.length,
this.hostView.injector
);
this.tooltip = tooltipComponent.instance;
this.tooltip.noAnimation = this.noAnimation;
// Remove element when use directive https://github.com/NG-ZORRO/ng-zorro-antd/issues/1967
Expand All @@ -116,9 +127,6 @@ export class NzTooltipDirective implements AfterViewInit, OnChanges, OnInit, OnD
this.subs_.add(visible_);
}
this.tooltip.setOverlayOrigin(this);
}

ngAfterViewInit(): void {
if (this.tooltip.nzTrigger === 'hover') {
let overlayElement: HTMLElement;
const listenerMouseEnter = this.renderer.listen(this.elementRef.nativeElement, 'mouseenter', () =>
Expand Down
3 changes: 1 addition & 2 deletions integration/angular-cli/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'core-js/es/reflect';

/**
* Required to support Web Animations `@angular/animation`.
Expand Down
3 changes: 1 addition & 2 deletions integration/rollup/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'core-js/es/reflect';

/**
* Required to support Web Animations `@angular/animation`.
Expand Down
3 changes: 1 addition & 2 deletions integration/webpack/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
import 'core-js/es7/reflect';
import 'core-js/es/reflect';

/**
* Required to support Web Animations `@angular/animation`.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"dependencies": {
"@angular/cdk": "^8.0.0",
"@ant-design/icons-angular": "^8.0.0",
"date-fns": "^1.30.1"
"date-fns": "^1.30.1",
"ng-zorro-antd": "file:./publish/ng-zorro-antd-8.0.2.tgz"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.801.0",
Expand Down Expand Up @@ -104,7 +105,7 @@
"readline-sync": "^1.4.9",
"remark": "^10.0.1",
"rxjs": "^6.5.2",
"sitemap": "^3.1.0",
"sitemap": "^2.1.0",
"ts-node": "^8.3.0",
"tsickle": ">=0.34.0",
"tslib": "^1.9.0",
Expand Down

0 comments on commit ee932c0

Please sign in to comment.