ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
369 lines • 29.5 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { ComponentFactoryResolver, Directive, ElementRef, EventEmitter, Host, Input, Optional, Output, Renderer2, ViewContainerRef } from '@angular/core';
import { Subscription } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive';
import { isNotNil } from '../core/util/check';
import { NzToolTipComponent } from './nz-tooltip.component';
var NzTooltipDirective = /** @class */ (function () {
function NzTooltipDirective(elementRef, hostView, resolver, renderer, tooltip, noAnimation) {
this.elementRef = elementRef;
this.hostView = hostView;
this.resolver = resolver;
this.renderer = renderer;
this.tooltip = tooltip;
this.noAnimation = noAnimation;
// [NOTE] Here hard coded, and nzTitle used only under NzTooltipDirective currently.
this.isTooltipOpen = false;
this.isDynamicTooltip = false; // Indicate whether current tooltip is dynamic created
this.factory = this.resolver.resolveComponentFactory(NzToolTipComponent);
/**
* Names of properties that should be proxy to child component.
*/
this.needProxyProperties = [
'nzTitle',
'nzContent',
'nzOverlayClassName',
'nzOverlayStyle',
'nzMouseEnterDelay',
'nzMouseLeaveDelay',
'nzVisible',
'nzTrigger',
'nzPlacement'
];
this.subs_ = new Subscription();
this.nzVisibleChange = new EventEmitter();
}
Object.defineProperty(NzTooltipDirective.prototype, "setTitle", {
set: /**
* @param {?} title
* @return {?}
*/
function (title) {
this.nzTitle = title;
},
enumerable: true,
configurable: true
});
/**
* @param {?} changes
* @return {?}
*/
NzTooltipDirective.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
this.updateProxies(changes);
};
/**
* @return {?}
*/
NzTooltipDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
// Support faster tooltip mode: <a nz-tooltip="xxx"></a>. [NOTE] Used only under NzTooltipDirective currently.
if (!this.tooltip) {
/** @type {?} */
var tooltipComponent = this.hostView.createComponent(this.factory);
this.tooltip = tooltipComponent.instance;
this.tooltip.noAnimation = this.noAnimation;
// Remove element when use directive https://github.com/NG-ZORRO/ng-zorro-antd/issues/1967
this.renderer.removeChild(this.renderer.parentNode(this.elementRef.nativeElement), tooltipComponent.location.nativeElement);
this.isDynamicTooltip = true;
this.needProxyProperties.forEach((/**
* @param {?} property
* @return {?}
*/
function (property) { return _this.updateCompValue(property, _this[property]); }));
/** @type {?} */
var visible_ = this.tooltip.nzVisibleChange.pipe(distinctUntilChanged()).subscribe((/**
* @param {?} data
* @return {?}
*/
function (data) {
_this.visible = data;
_this.nzVisibleChange.emit(data);
}));
this.subs_.add(visible_);
}
this.tooltip.setOverlayOrigin(this);
};
/**
* @return {?}
*/
NzTooltipDirective.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
var _this = this;
if (this.tooltip.nzTrigger === 'hover') {
/** @type {?} */
var overlayElement_1;
this.renderer.listen(this.elementRef.nativeElement, 'mouseenter', (/**
* @return {?}
*/
function () {
return _this.delayEnterLeave(true, true, _this.tooltip.nzMouseEnterDelay);
}));
this.renderer.listen(this.elementRef.nativeElement, 'mouseleave', (/**
* @return {?}
*/
function () {
_this.delayEnterLeave(true, false, _this.tooltip.nzMouseLeaveDelay);
if (_this.tooltip.overlay.overlayRef && !overlayElement_1) {
// NOTE: we bind events under "mouseleave" due to the overlayRef is only created after the overlay was completely shown up
overlayElement_1 = _this.tooltip.overlay.overlayRef.overlayElement;
_this.renderer.listen(overlayElement_1, 'mouseenter', (/**
* @return {?}
*/
function () { return _this.delayEnterLeave(false, true); }));
_this.renderer.listen(overlayElement_1, 'mouseleave', (/**
* @return {?}
*/
function () { return _this.delayEnterLeave(false, false); }));
}
}));
}
else if (this.tooltip.nzTrigger === 'focus') {
this.renderer.listen(this.elementRef.nativeElement, 'focus', (/**
* @return {?}
*/
function () { return _this.show(); }));
this.renderer.listen(this.elementRef.nativeElement, 'blur', (/**
* @return {?}
*/
function () { return _this.hide(); }));
}
else if (this.tooltip.nzTrigger === 'click') {
this.renderer.listen(this.elementRef.nativeElement, 'click', (/**
* @param {?} e
* @return {?}
*/
function (e) {
e.preventDefault();
_this.show();
}));
}
};
/**
* @return {?}
*/
NzTooltipDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.subs_.unsubscribe();
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @protected
* @param {?} key
* @param {?} value
* @return {?}
*/
NzTooltipDirective.prototype.updateCompValue =
// tslint:disable-next-line:no-any
/**
* @protected
* @param {?} key
* @param {?} value
* @return {?}
*/
function (key, value) {
if (this.isDynamicTooltip && isNotNil(value)) {
this.tooltip[key] = value;
}
};
/**
* @private
* @return {?}
*/
NzTooltipDirective.prototype.show = /**
* @private
* @return {?}
*/
function () {
this.tooltip.show();
this.isTooltipOpen = true;
};
/**
* @private
* @return {?}
*/
NzTooltipDirective.prototype.hide = /**
* @private
* @return {?}
*/
function () {
this.tooltip.hide();
this.isTooltipOpen = false;
};
/**
* @private
* @param {?} isOrigin
* @param {?} isEnter
* @param {?=} delay
* @return {?}
*/
NzTooltipDirective.prototype.delayEnterLeave = /**
* @private
* @param {?} isOrigin
* @param {?} isEnter
* @param {?=} delay
* @return {?}
*/
function (isOrigin, isEnter, delay) {
var _this = this;
if (delay === void 0) { delay = -1; }
if (this.delayTimer) {
// Clear timer during the delay time
clearTimeout(this.delayTimer);
this.delayTimer = null;
}
else if (delay > 0) {
this.delayTimer = setTimeout((/**
* @return {?}
*/
function () {
_this.delayTimer = null;
isEnter ? _this.show() : _this.hide();
}), delay * 1000);
}
else {
isEnter && isOrigin ? this.show() : this.hide(); // [Compatible] The "isOrigin" is used due to the tooltip will not hide immediately (may caused by the fade-out animation)
}
};
/**
* Set inputs of child components when this component's inputs change.
* @param changes
*/
/**
* Set inputs of child components when this component's inputs change.
* @private
* @param {?} changes
* @return {?}
*/
NzTooltipDirective.prototype.updateProxies = /**
* Set inputs of child components when this component's inputs change.
* @private
* @param {?} changes
* @return {?}
*/
function (changes) {
var _this = this;
if (this.tooltip) {
Object.keys(changes).forEach((/**
* @param {?} key
* @return {?}
*/
function (key) {
/** @type {?} */
var change = changes[key];
if (change) {
_this.updateCompValue(key, change.currentValue);
}
}));
if (changes.setTitle) {
this.nzTitle = changes.setTitle.currentValue;
this.updateCompValue('nzTitle', changes.setTitle.currentValue);
}
this.tooltip.cdr.markForCheck(); // Manually trigger change detection of component.
}
};
NzTooltipDirective.decorators = [
{ type: Directive, args: [{
selector: '[nz-tooltip]',
host: {
'[class.ant-tooltip-open]': 'isTooltipOpen'
}
},] }
];
/** @nocollapse */
NzTooltipDirective.ctorParameters = function () { return [
{ type: ElementRef },
{ type: ViewContainerRef },
{ type: ComponentFactoryResolver },
{ type: Renderer2 },
{ type: NzToolTipComponent, decorators: [{ type: Optional }] },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
]; };
NzTooltipDirective.propDecorators = {
nzVisibleChange: [{ type: Output }],
nzTitle: [{ type: Input, args: ['nz-tooltip',] }],
setTitle: [{ type: Input, args: ['nzTitle',] }],
nzContent: [{ type: Input }],
nzMouseEnterDelay: [{ type: Input }],
nzMouseLeaveDelay: [{ type: Input }],
nzOverlayClassName: [{ type: Input }],
nzOverlayStyle: [{ type: Input }],
nzTrigger: [{ type: Input }],
nzVisible: [{ type: Input }],
nzPlacement: [{ type: Input }]
};
return NzTooltipDirective;
}());
export { NzTooltipDirective };
if (false) {
/** @type {?} */
NzTooltipDirective.prototype.isTooltipOpen;
/** @type {?} */
NzTooltipDirective.prototype.isDynamicTooltip;
/** @type {?} */
NzTooltipDirective.prototype.delayTimer;
/** @type {?} */
NzTooltipDirective.prototype.visible;
/** @type {?} */
NzTooltipDirective.prototype.factory;
/**
* Names of properties that should be proxy to child component.
* @type {?}
* @protected
*/
NzTooltipDirective.prototype.needProxyProperties;
/**
* @type {?}
* @protected
*/
NzTooltipDirective.prototype.subs_;
/** @type {?} */
NzTooltipDirective.prototype.nzVisibleChange;
/** @type {?} */
NzTooltipDirective.prototype.nzTitle;
/** @type {?} */
NzTooltipDirective.prototype.nzContent;
/** @type {?} */
NzTooltipDirective.prototype.nzMouseEnterDelay;
/** @type {?} */
NzTooltipDirective.prototype.nzMouseLeaveDelay;
/** @type {?} */
NzTooltipDirective.prototype.nzOverlayClassName;
/** @type {?} */
NzTooltipDirective.prototype.nzOverlayStyle;
/** @type {?} */
NzTooltipDirective.prototype.nzTrigger;
/** @type {?} */
NzTooltipDirective.prototype.nzVisible;
/** @type {?} */
NzTooltipDirective.prototype.nzPlacement;
/** @type {?} */
NzTooltipDirective.prototype.elementRef;
/** @type {?} */
NzTooltipDirective.prototype.hostView;
/** @type {?} */
NzTooltipDirective.prototype.resolver;
/** @type {?} */
NzTooltipDirective.prototype.renderer;
/** @type {?} */
NzTooltipDirective.prototype.tooltip;
/** @type {?} */
NzTooltipDirective.prototype.noAnimation;
/* Skipping unhandled member: [property: string]: any;*/
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotdG9vbHRpcC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsidG9vbHRpcC9uei10b29sdGlwLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUdMLHdCQUF3QixFQUN4QixTQUFTLEVBQ1QsVUFBVSxFQUNWLFlBQVksRUFDWixJQUFJLEVBQ0osS0FBSyxFQUlMLFFBQVEsRUFDUixNQUFNLEVBQ04sU0FBUyxFQUdULGdCQUFnQixFQUNqQixNQUFNLGVBQWUsQ0FBQztBQUV2QixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ3BDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGdCQU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