ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
4,921 lines • 173 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/animations'), require('@angular/cdk/coercion'), require('@angular/cdk/overlay'), require('@angular/common'), require('@angular/platform-browser/animations'), require('@angular/cdk/platform'), require('rxjs'), require('@angular/core')) :
typeof define === 'function' && define.amd ? define('ng-zorro-antd/core', ['exports', '@angular/animations', '@angular/cdk/coercion', '@angular/cdk/overlay', '@angular/common', '@angular/platform-browser/animations', '@angular/cdk/platform', 'rxjs', '@angular/core'], factory) :
(factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].core = {}),global.ng.animations,global.ng.cdk.coercion,global.ng.cdk.overlay,global.ng.common,global.ng.platformBrowser.animations,global.ng.cdk.platform,global.rxjs,global.ng.core));
}(this, (function (exports,animations,coercion,overlay,i1,animations$1,platform,rxjs,i0) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzClassListAddDirective = /** @class */ (function () {
function NzClassListAddDirective(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.classList = [];
}
Object.defineProperty(NzClassListAddDirective.prototype, "nzClassListAdd", {
set: /**
* @param {?} list
* @return {?}
*/ function (list) {
var _this = this;
this.classList.forEach(( /**
* @param {?} name
* @return {?}
*/function (name) {
_this.renderer.removeClass(_this.elementRef.nativeElement, name);
}));
list.forEach(( /**
* @param {?} name
* @return {?}
*/function (name) {
_this.renderer.addClass(_this.elementRef.nativeElement, name);
}));
this.classList = list;
},
enumerable: true,
configurable: true
});
NzClassListAddDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[nzClassListAdd]',
exportAs: 'nzClassListAdd'
},] }
];
/** @nocollapse */
NzClassListAddDirective.ctorParameters = function () {
return [
{ type: i0.ElementRef },
{ type: i0.Renderer2 }
];
};
NzClassListAddDirective.propDecorators = {
nzClassListAdd: [{ type: i0.Input }]
};
return NzClassListAddDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzStringTemplateOutletDirective = /** @class */ (function () {
function NzStringTemplateOutletDirective(viewContainer, defaultTemplate) {
this.viewContainer = viewContainer;
this.defaultTemplate = defaultTemplate;
this.inputTemplate = null;
this.inputViewRef = null;
this.defaultViewRef = null;
}
Object.defineProperty(NzStringTemplateOutletDirective.prototype, "nzStringTemplateOutlet", {
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
if (value instanceof i0.TemplateRef) {
this.isTemplate = true;
this.inputTemplate = value;
}
else {
this.isTemplate = false;
}
this.updateView();
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
NzStringTemplateOutletDirective.prototype.updateView = /**
* @return {?}
*/
function () {
if (!this.isTemplate) {
/** use default template when input is string **/
if (!this.defaultViewRef) {
this.viewContainer.clear();
this.inputViewRef = null;
if (this.defaultTemplate) {
this.defaultViewRef = this.viewContainer.createEmbeddedView(this.defaultTemplate);
}
}
}
else {
/** use input template when input is templateRef **/
if (!this.inputViewRef) {
this.viewContainer.clear();
this.defaultViewRef = null;
if (this.inputTemplate) {
this.inputViewRef = this.viewContainer.createEmbeddedView(this.inputTemplate);
}
}
}
};
NzStringTemplateOutletDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[nzStringTemplateOutlet]',
exportAs: 'nzStringTemplateOutlet'
},] }
];
/** @nocollapse */
NzStringTemplateOutletDirective.ctorParameters = function () {
return [
{ type: i0.ViewContainerRef },
{ type: i0.TemplateRef }
];
};
NzStringTemplateOutletDirective.propDecorators = {
nzStringTemplateOutlet: [{ type: i0.Input }]
};
return NzStringTemplateOutletDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzAddOnModule = /** @class */ (function () {
function NzAddOnModule() {
}
NzAddOnModule.decorators = [
{ type: i0.NgModule, args: [{
imports: [i1.CommonModule],
exports: [NzStringTemplateOutletDirective, NzClassListAddDirective],
declarations: [NzStringTemplateOutletDirective, NzClassListAddDirective]
},] }
];
return NzAddOnModule;
}());
/**
* @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
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
var AnimationDuration = /** @class */ (function () {
function AnimationDuration() {
}
AnimationDuration.SLOW = '0.3s'; // Modal
// Modal
AnimationDuration.BASE = '0.2s';
AnimationDuration.FAST = '0.1s'; // Tooltip
return AnimationDuration;
}());
var AnimationCurves = /** @class */ (function () {
function AnimationCurves() {
}
AnimationCurves.EASE_BASE_OUT = 'cubic-bezier(0.7, 0.3, 0.1, 1)';
AnimationCurves.EASE_BASE_IN = 'cubic-bezier(0.9, 0, 0.3, 0.7)';
AnimationCurves.EASE_OUT = 'cubic-bezier(0.215, 0.61, 0.355, 1)';
AnimationCurves.EASE_IN = 'cubic-bezier(0.55, 0.055, 0.675, 0.19)';
AnimationCurves.EASE_IN_OUT = 'cubic-bezier(0.645, 0.045, 0.355, 1)';
AnimationCurves.EASE_OUT_BACK = 'cubic-bezier(0.12, 0.4, 0.29, 1.46)';
AnimationCurves.EASE_IN_BACK = 'cubic-bezier(0.71, -0.46, 0.88, 0.6)';
AnimationCurves.EASE_IN_OUT_BACK = 'cubic-bezier(0.71, -0.46, 0.29, 1.46)';
AnimationCurves.EASE_OUT_CIRC = 'cubic-bezier(0.08, 0.82, 0.17, 1)';
AnimationCurves.EASE_IN_CIRC = 'cubic-bezier(0.6, 0.04, 0.98, 0.34)';
AnimationCurves.EASE_IN_OUT_CIRC = 'cubic-bezier(0.78, 0.14, 0.15, 0.86)';
AnimationCurves.EASE_OUT_QUINT = 'cubic-bezier(0.23, 1, 0.32, 1)';
AnimationCurves.EASE_IN_QUINT = 'cubic-bezier(0.755, 0.05, 0.855, 0.06)';
AnimationCurves.EASE_IN_OUT_QUINT = 'cubic-bezier(0.86, 0, 0.07, 1)';
return AnimationCurves;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var collapseMotion = animations.trigger('collapseMotion', [
animations.state('expanded', animations.style({ height: '*' })),
animations.state('collapsed', animations.style({ height: 0, overflow: 'hidden' })),
animations.state('hidden', animations.style({ height: 0, display: 'none' })),
animations.transition('expanded => collapsed', animations.animate("150ms " + AnimationCurves.EASE_IN_OUT)),
animations.transition('expanded => hidden', animations.animate("150ms " + AnimationCurves.EASE_IN_OUT)),
animations.transition('collapsed => expanded', animations.animate("150ms " + AnimationCurves.EASE_IN_OUT)),
animations.transition('hidden => expanded', animations.animate("150ms " + AnimationCurves.EASE_IN_OUT))
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var fadeMotion = animations.trigger('fadeMotion', [
animations.transition(':enter', [animations.style({ opacity: 0 }), animations.animate("" + AnimationDuration.BASE, animations.style({ opacity: 1 }))]),
animations.transition(':leave', [animations.style({ opacity: 1 }), animations.animate("" + AnimationDuration.BASE, animations.style({ opacity: 0 }))])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var helpMotion = animations.trigger('helpMotion', [
animations.transition(':enter', [
animations.style({
opacity: 0,
transform: 'translateY(-5px)'
}),
animations.animate(AnimationDuration.SLOW + " " + AnimationCurves.EASE_IN_OUT, animations.style({
opacity: 1,
transform: 'translateY(0)'
}))
]),
animations.transition(':leave', [
animations.style({
opacity: 1,
transform: 'translateY(0)'
}),
animations.animate(AnimationDuration.SLOW + " " + AnimationCurves.EASE_IN_OUT, animations.style({
opacity: 0,
transform: 'translateY(-5px)'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var moveUpMotion = animations.trigger('moveUpMotion', [
animations.transition('* => enter', [
animations.style({
transformOrigin: '0 0',
transform: 'translateY(-100%)',
opacity: 0
}),
animations.animate("" + AnimationDuration.BASE, animations.style({
transformOrigin: '0 0',
transform: 'translateY(0%)',
opacity: 1
}))
]),
animations.transition('* => leave', [
animations.style({
transformOrigin: '0 0',
transform: 'translateY(0%)',
opacity: 1
}),
animations.animate("" + AnimationDuration.BASE, animations.style({
transformOrigin: '0 0',
transform: 'translateY(-100%)',
opacity: 0
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var notificationMotion = animations.trigger('notificationMotion', [
animations.state('enterRight', animations.style({ opacity: 1, transform: 'translateX(0)' })),
animations.transition('* => enterRight', [animations.style({ opacity: 0, transform: 'translateX(5%)' }), animations.animate('100ms linear')]),
animations.state('enterLeft', animations.style({ opacity: 1, transform: 'translateX(0)' })),
animations.transition('* => enterLeft', [animations.style({ opacity: 0, transform: 'translateX(-5%)' }), animations.animate('100ms linear')]),
animations.state('leave', animations.style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
})),
animations.transition('* => leave', [
animations.style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 0%'
}),
animations.animate('100ms linear')
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var ANIMATION_TRANSITION_IN = AnimationDuration.BASE + " " + AnimationCurves.EASE_OUT_QUINT;
/** @type {?} */
var ANIMATION_TRANSITION_OUT = AnimationDuration.BASE + " " + AnimationCurves.EASE_IN_QUINT;
/** @type {?} */
var slideMotion = animations.trigger('slideMotion', [
animations.state('bottom', animations.style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 0%'
})),
animations.state('top', animations.style({
opacity: 1,
transform: 'scaleY(1)',
transformOrigin: '0% 100%'
})),
animations.transition('void => bottom', [
animations.style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
}),
animations.animate(ANIMATION_TRANSITION_IN)
]),
animations.transition('bottom => void', [
animations.animate(ANIMATION_TRANSITION_OUT, animations.style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 0%'
}))
]),
animations.transition('void => top', [
animations.style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 100%'
}),
animations.animate(ANIMATION_TRANSITION_IN)
]),
animations.transition('top => void', [
animations.animate(ANIMATION_TRANSITION_OUT, animations.style({
opacity: 0,
transform: 'scaleY(0.8)',
transformOrigin: '0% 100%'
}))
])
]);
/** @type {?} */
var slideAlertMotion = animations.trigger('slideAlertMotion', [
animations.transition(':leave', [
animations.style({ opacity: 1, transform: 'scaleY(1)', transformOrigin: '0% 0%' }),
animations.animate(AnimationDuration.SLOW + " " + AnimationCurves.EASE_IN_OUT_CIRC, animations.style({
opacity: 0,
transform: 'scaleY(0)',
transformOrigin: '0% 0%'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var zoomMotion = animations.trigger('zoomMotion', [
animations.transition(':enter', [
animations.style({ opacity: 0, transform: 'scale(0.2)' }),
animations.animate(AnimationDuration.BASE + " " + AnimationCurves.EASE_OUT_CIRC, animations.style({
opacity: 1,
transform: 'scale(1)'
}))
]),
animations.transition(':leave', [
animations.style({ opacity: 1, transform: 'scale(1)' }),
animations.animate(AnimationDuration.BASE + " " + AnimationCurves.EASE_IN_OUT_CIRC, animations.style({
opacity: 0,
transform: 'scale(0.2)'
}))
])
]);
/** @type {?} */
var zoomBigMotion = animations.trigger('zoomBigMotion', [
animations.transition('void => active', [
animations.style({ opacity: 0, transform: 'scale(0.8)' }),
animations.animate(AnimationDuration.BASE + " " + AnimationCurves.EASE_OUT_CIRC, animations.style({
opacity: 1,
transform: 'scale(1)'
}))
]),
animations.transition('active => void', [
animations.style({ opacity: 1, transform: 'scale(1)' }),
animations.animate(AnimationDuration.BASE + " " + AnimationCurves.EASE_IN_OUT_CIRC, animations.style({
opacity: 0,
transform: 'scale(0.8)'
}))
])
]);
/** @type {?} */
var zoomBadgeMotion = animations.trigger('zoomBadgeMotion', [
animations.transition(':enter', [
animations.style({ opacity: 0, transform: 'scale(0) translate(50%, -50%)' }),
animations.animate(AnimationDuration.SLOW + " " + AnimationCurves.EASE_OUT_BACK, animations.style({
opacity: 1,
transform: 'scale(1) translate(50%, -50%)'
}))
]),
animations.transition(':leave', [
animations.style({ opacity: 1, transform: 'scale(1) translate(50%, -50%)' }),
animations.animate(AnimationDuration.SLOW + " " + AnimationCurves.EASE_IN_BACK, animations.style({
opacity: 0,
transform: 'scale(0) translate(50%, -50%)'
}))
])
]);
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b)
if (b.hasOwnProperty(p))
d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
return Reflect.metadata(metadataKey, metadataValue);
}
function __values(o) {
var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
if (m)
return m.call(o);
return {
next: function () {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
}
catch (error) {
e = { error: error };
}
finally {
try {
if (r && !r.done && (m = i["return"]))
m.call(i);
}
finally {
if (e)
throw e.error;
}
}
return ar;
}
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} value
* @return {?}
*/
function toBoolean(value) {
return coercion.coerceBooleanProperty(value);
}
/**
* @param {?} value
* @param {?=} fallbackValue
* @return {?}
*/
function toNumber(value, fallbackValue) {
if (fallbackValue === void 0) {
fallbackValue = 0;
}
return coercion._isNumberValue(value) ? Number(value) : fallbackValue;
}
/**
* @param {?} value
* @return {?}
*/
function toCssPixel(value) {
return coercion.coerceCssPixelValue(value);
}
/**
* Get the function-property type's value
* @template T
* @param {?} prop
* @param {...?} args
* @return {?}
*/
// tslint:disable-next-line: no-any
function valueFunctionProp(prop) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
return typeof prop === 'function' ? prop.apply(void 0, __spread(args)) : prop;
}
// tslint:disable-next-line: no-any
/**
* @template T, D
* @param {?} name
* @param {?} fallback
* @return {?}
*/
function propDecoratorFactory(name, fallback) {
// tslint:disable-next-line: no-any
/**
* @param {?} target
* @param {?} propName
* @return {?}
*/
function propDecorator(target, propName) {
/** @type {?} */
var privatePropName = "$$__" + propName;
if (Object.prototype.hasOwnProperty.call(target, privatePropName)) {
console.warn("The prop \"" + privatePropName + "\" is already exist, it will be overrided by " + name + " decorator.");
}
Object.defineProperty(target, privatePropName, {
configurable: true,
writable: true
});
Object.defineProperty(target, propName, {
get: /**
* @return {?}
*/ function () {
return this[privatePropName]; // tslint:disable-line:no-invalid-this
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this[privatePropName] = fallback(value); // tslint:disable-line:no-invalid-this
}
});
}
return propDecorator;
}
/**
* Input decorator that handle a prop to do get/set automatically with toBoolean
*
* Why not using \@InputBoolean alone without \@Input? AOT needs \@Input to be visible
*
* \@howToUse
* ```
* \@Input() \@InputBoolean() visible: boolean = false;
*
* // Act as below:
* // \@Input()
* // get visible() { return this.__visible; }
* // set visible(value) { this.__visible = value; }
* // __visible = false;
* ```
* @return {?}
*/
// tslint:disable-next-line: no-any
function InputBoolean() {
return propDecoratorFactory('InputBoolean', toBoolean);
}
// tslint:disable-next-line: no-any
/**
* @return {?}
*/
function InputCssPixel() {
return propDecoratorFactory('InputCssPixel', toCssPixel);
}
// tslint:disable-next-line: no-any
/**
* @return {?}
*/
function InputNumber() {
// tslint:disable-line: no-any
return propDecoratorFactory('InputNumber', toNumber);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var DISABLED_CLASSNAME = 'nz-animate-disabled';
var NzNoAnimationDirective = /** @class */ (function () {
function NzNoAnimationDirective(element, renderer, animationType) {
this.element = element;
this.renderer = renderer;
this.animationType = animationType;
this.nzNoAnimation = false;
}
/**
* @return {?}
*/
NzNoAnimationDirective.prototype.ngOnChanges = /**
* @return {?}
*/
function () {
this.updateClass();
};
/**
* @return {?}
*/
NzNoAnimationDirective.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
this.updateClass();
};
/**
* @private
* @return {?}
*/
NzNoAnimationDirective.prototype.updateClass = /**
* @private
* @return {?}
*/
function () {
/** @type {?} */
var element = coercion.coerceElement(this.element);
if (!element) {
return;
}
if (this.nzNoAnimation || this.animationType === 'NoopAnimations') {
this.renderer.addClass(element, DISABLED_CLASSNAME);
}
else {
this.renderer.removeClass(element, DISABLED_CLASSNAME);
}
};
NzNoAnimationDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[nzNoAnimation]',
exportAs: 'nzNoAnimation',
host: {
'[@.disabled]': 'nzNoAnimation'
}
},] }
];
/** @nocollapse */
NzNoAnimationDirective.ctorParameters = function () {
return [
{ type: i0.ElementRef },
{ type: i0.Renderer2 },
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [animations$1.ANIMATION_MODULE_TYPE,] }] }
];
};
NzNoAnimationDirective.propDecorators = {
nzNoAnimation: [{ type: i0.Input }]
};
__decorate([
InputBoolean(),
__metadata("design:type", Boolean)
], NzNoAnimationDirective.prototype, "nzNoAnimation", void 0);
return NzNoAnimationDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzNoAnimationModule = /** @class */ (function () {
function NzNoAnimationModule() {
}
NzNoAnimationModule.decorators = [
{ type: i0.NgModule, args: [{
declarations: [NzNoAnimationDirective],
exports: [NzNoAnimationDirective],
imports: [i1.CommonModule]
},] }
];
return NzNoAnimationModule;
}());
/**
* @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
*/
var NzConnectedOverlayDirective = /** @class */ (function () {
function NzConnectedOverlayDirective(cdkConnectedOverlay) {
this.cdkConnectedOverlay = cdkConnectedOverlay;
this.cdkConnectedOverlay.backdropClass = 'nz-overlay-transparent-backdrop';
}
NzConnectedOverlayDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[cdkConnectedOverlay][nzConnectedOverlay]',
exportAs: 'nzConnectedOverlay'
},] }
];
/** @nocollapse */
NzConnectedOverlayDirective.ctorParameters = function () {
return [
{ type: overlay.CdkConnectedOverlay }
];
};
return NzConnectedOverlayDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzOverlayModule = /** @class */ (function () {
function NzOverlayModule() {
}
NzOverlayModule.decorators = [
{ type: i0.NgModule, args: [{
declarations: [NzConnectedOverlayDirective],
exports: [NzConnectedOverlayDirective]
},] }
];
return NzOverlayModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var POSITION_MAP = {
top: new overlay.ConnectionPositionPair({ originX: 'center', originY: 'top' }, {
overlayX: 'center',
overlayY: 'bottom'
}),
topCenter: new overlay.ConnectionPositionPair({ originX: 'center', originY: 'top' }, { overlayX: 'center', overlayY: 'bottom' }),
topLeft: new overlay.ConnectionPositionPair({ originX: 'start', originY: 'top' }, {
overlayX: 'start',
overlayY: 'bottom'
}),
topRight: new overlay.ConnectionPositionPair({ originX: 'end', originY: 'top' }, { overlayX: 'end', overlayY: 'bottom' }),
right: new overlay.ConnectionPositionPair({ originX: 'end', originY: 'center' }, {
overlayX: 'start',
overlayY: 'center'
}),
rightTop: new overlay.ConnectionPositionPair({ originX: 'end', originY: 'top' }, { overlayX: 'start', overlayY: 'top' }),
rightBottom: new overlay.ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'start', overlayY: 'bottom' }),
bottom: new overlay.ConnectionPositionPair({ originX: 'center', originY: 'bottom' }, {
overlayX: 'center',
overlayY: 'top'
}),
bottomCenter: new overlay.ConnectionPositionPair({ originX: 'center', originY: 'bottom' }, { overlayX: 'center', overlayY: 'top' }),
bottomLeft: new overlay.ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'start', overlayY: 'top' }),
bottomRight: new overlay.ConnectionPositionPair({ originX: 'end', originY: 'bottom' }, { overlayX: 'end', overlayY: 'top' }),
left: new overlay.ConnectionPositionPair({ originX: 'start', originY: 'center' }, {
overlayX: 'end',
overlayY: 'center'
}),
leftTop: new overlay.ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'end', overlayY: 'top' }),
leftBottom: new overlay.ConnectionPositionPair({ originX: 'start', originY: 'bottom' }, { overlayX: 'end', overlayY: 'bottom' })
};
/** @type {?} */
var DEFAULT_TOOLTIP_POSITIONS = [POSITION_MAP.top, POSITION_MAP.right, POSITION_MAP.bottom, POSITION_MAP.left];
/** @type {?} */
var DEFAULT_DROPDOWN_POSITIONS = [
POSITION_MAP.bottomLeft,
POSITION_MAP.bottomRight,
POSITION_MAP.topLeft,
POSITION_MAP.topRight
];
/** @type {?} */
var DEFAULT_SUBMENU_POSITIONS = [POSITION_MAP.rightTop, POSITION_MAP.leftTop];
/** @type {?} */
var DEFAULT_CASCADER_POSITIONS = [
POSITION_MAP.bottomLeft,
POSITION_MAP.bottomRight,
POSITION_MAP.topLeft,
POSITION_MAP.topRight
];
/** @type {?} */
var DEFAULT_MENTION_POSITIONS = [
POSITION_MAP.bottomLeft,
new overlay.ConnectionPositionPair({
originX: 'start',
originY: 'bottom'
}, { overlayX: 'start', overlayY: 'bottom' })
];
/**
* @param {?} position
* @return {?}
*/
function getPlacementName(position) {
/** @type {?} */
var keyList = ['originX', 'originY', 'overlayX', 'overlayY'];
var _loop_1 = function (placement) {
// @ts-ignore
if (keyList.every(( /**
* @param {?} key
* @return {?}
*/function (key) { return position.connectionPair[key] === POSITION_MAP[placement][key]; }))) {
return { value: placement };
}
};
for (var placement in POSITION_MAP) {
var state_1 = _loop_1(placement);
if (typeof state_1 === "object")
return state_1.value;
}
}
/**
* @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
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
// tslint:disable:no-any typedef no-invalid-this
/** @type {?} */
var availablePrefixes = ['moz', 'ms', 'webkit'];
/**
* @return {?}
*/
function requestAnimationFramePolyfill() {
/** @type {?} */
var lastTime = 0;
return ( /**
* @param {?} callback
* @return {?}
*/function (callback) {
/** @type {?} */
var currTime = new Date().getTime();
/** @type {?} */
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
/** @type {?} */
var id = setTimeout(( /**
* @return {?}
*/function () {
callback(currTime + timeToCall);
}), timeToCall);
lastTime = currTime + timeToCall;
return id;
});
}
/**
* @return {?}
*/
function getRequestAnimationFrame() {
if (typeof window === 'undefined') {
return ( /**
* @return {?}
*/function () { return 0; });
}
if (window.requestAnimationFrame) {
// https://github.com/vuejs/vue/issues/4465
return window.requestAnimationFrame.bind(window);
}
/** @type {?} */
var prefix = availablePrefixes.filter(( /**
* @param {?} key
* @return {?}
*/function (key) { return key + "RequestAnimationFrame" in window; }))[0];
return prefix ? (( /** @type {?} */(window)))[prefix + "RequestAnimationFrame"] : requestAnimationFramePolyfill();
}
/**
* @param {?} id
* @return {?}
*/
function cancelRequestAnimationFrame(id) {
if (typeof window === 'undefined') {
return null;
}
if (window.cancelAnimationFrame) {
return window.cancelAnimationFrame(id);
}
/** @type {?} */
var prefix = availablePrefixes.filter(( /**
* @param {?} key
* @return {?}
*/function (key) { return key + "CancelAnimationFrame" in window || key + "CancelRequestAnimationFrame" in window; }))[0];
return prefix
? ((( /** @type {?} */(window)))[prefix + "CancelAnimationFrame"] || (( /** @type {?} */(window)))[prefix + "CancelRequestAnimationFrame"])
// @ts-ignore
.call(this, id)
: clearTimeout(id);
}
/** @type {?} */
var reqAnimFrame = getRequestAnimationFrame();
/**
* @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
*/
/**
* @param {?} t
* @param {?} b
* @param {?} c
* @param {?} d
* @return {?}
*/
function easeInOutCubic(t, b, c, d) {
/** @type {?} */
var cc = c - b;
/** @type {?} */
var tt = t / (d / 2);
if (tt < 1) {
return (cc / 2) * tt * tt * tt + b;
}
else {
return (cc / 2) * ((tt -= 2) * tt * tt + 2) + b;
}
}
var NzScrollService = /** @class */ (function () {
/* tslint:disable-next-line:no-any */
function NzScrollService(doc) {
this.doc = doc;
}
/** 设置 `el` 滚动条位置 */
/**
* 设置 `el` 滚动条位置
* @param {?} el
* @param {?=} topValue
* @return {?}
*/
NzScrollService.prototype.setScrollTop = /**
* 设置 `el` 滚动条位置
* @param {?} el
* @param {?=} topValue
* @return {?}
*/
function (el, topValue) {
if (topValue === void 0) {
topValue = 0;
}
if (el === window) {
this.doc.body.scrollTop = topValue;
( /** @type {?} */(this.doc.documentElement)).scrollTop = topValue;
}
else {
(( /** @type {?} */(el))).scrollTop = topValue;
}
};
/** 获取 `el` 相对于视窗距离 */
/**
* 获取 `el` 相对于视窗距离
* @param {?} el
* @return {?}
*/
NzScrollService.prototype.getOffset = /**
* 获取 `el` 相对于视窗距离
* @param {?} el
* @return {?}
*/
function (el) {
/** @type {?} */
var ret = {
top: 0,
left: 0
};
if (!el || !el.getClientRects().length) {
return ret;
}
/** @type {?} */
var rect = el.getBoundingClientRect();
if (rect.width || rect.height) {
/** @type {?} */
var doc = ( /** @type {?} */(el.ownerDocument)).documentElement;
ret.top = rect.top - ( /** @type {?} */(doc)).clientTop;
ret.left = rect.left - ( /** @type {?} */(doc)).clientLeft;
}
else {
ret.top = rect.top;
ret.left = rect.left;
}
return ret;
};
/** 获取 `el` 滚动条位置 */
// TODO: remove '| Window' as the fallback already happens here
/**
* 获取 `el` 滚动条位置
* @param {?=} el
* @param {?=} top
* @return {?}
*/
// TODO: remove '| Window' as the fallback already happens here
NzScrollService.prototype.getScroll = /**
* 获取 `el` 滚动条位置
* @param {?=} el
* @param {?=} top
* @return {?}
*/
// TODO: remove '| Window' as the fallback already happens here
function (el, top) {
if (top === void 0) {
top = true;
}
/** @type {?} */
var target = el ? el : window;
/** @type {?} */
var prop = top ? 'pageYOffset' : 'pageXOffset';
/** @type {?} */
var method = top ? 'scrollTop' : 'scrollLeft';
/** @type {?} */
var isWindow = target === window;
// @ts-ignore
/** @type {?} */
var ret = isWindow ? target[prop] : target[method];
if (isWindow && typeof ret !== 'number') {
ret = ( /** @type {?} */(this.doc.documentElement))[method];
}
return ret;
};
/**
* 使用动画形式将 `el` 滚动至某位置
*
* @param containerEl 容器,默认 `window`
* @param targetTopValue 滚动至目标 `top` 值,默认:0,相当于顶部
* @param easing 动作算法,默认:`easeInOutCubic`
* @param callback 动画结束后回调
*/
/**
* 使用动画形式将 `el` 滚动至某位置
*
* @param {?} containerEl 容器,默认 `window`
* @param {?=} targetTopValue 滚动至目标 `top` 值,默认:0,相当于顶部
* @param {?=} easing 动作算法,默认:`easeInOutCubic`
* @param {?=} callback 动画结束后回调
* @return {?}
*/
NzScrollService.prototype.scrollTo = /**
* 使用动画形式将 `el` 滚动至某位置
*
* @param {?} containerEl 容器,默认 `window`
* @param {?=} targetTopValue 滚动至目标 `top` 值,默认:0,相当于顶部
* @param {?=} easing 动作算法,默认:`easeInOutCubic`
* @param {?=} callback 动画结束后回调
* @return {?}
*/
function (containerEl, targetTopValue, easing, callback) {
var _this = this;
if (targetTopValue === void 0) {
targetTopValue = 0;
}
/** @type {?} */
var target = containerEl ? containerEl : window;
/** @type {?} */
var scrollTop = this.getScroll(target);
/** @type {?} */
var startTime = Date.now();
/** @type {?} */
var frameFunc = ( /**
* @return {?}
*/function () {
/** @type {?} */
var timestamp = Date.now();
/** @type {?} */
var time = timestamp - startTime;
_this.setScrollTop(target, (easing || easeInOutCubic)(time, scrollTop, targetTopValue, 450));
if (time < 450) {
reqAnimFrame(frameFunc);
}
else {
if (callback) {
callback();
}
}
});
reqAnimFrame(frameFunc);
};
NzScrollService.decorators = [
{ type: i0.Injectable }
];
/** @nocollapse */
NzScrollService.ctorParameters = function () {
return [
{ type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
];
};
return NzScrollService;
}());
/**
* @param {?} doc
* @param {?} scrollService
* @return {?}
*/
function SCROLL_SERVICE_PROVIDER_FACTORY(doc, scrollService) {
return scrollService || new NzScrollService(doc);
}
/** @type {?} */
var SCROLL_SERVICE_PROVIDER = {
provide: NzScrollService,
useFactory: SCROLL_SERVICE_PROVIDER_FACTORY,
deps: [i1.DOCUMENT, [new i0.Optional(), new i0.SkipSelf(), NzScrollService]]
};
/**
* @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
*/
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isNotNil(value) {
return typeof value !== 'undefined' && value !== null;
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isNil(value) {
return typeof value === 'undefined' || value === null;
}
/**
* Examine if two objects are shallowly equaled.
* @param {?=} objA
* @param {?=} objB
* @return {?}
*/
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
if (typeof objA !== 'object' || !objA || typeof objB !== 'object' || !objB) {
return false;
}
/** @type {?} */
var keysA = Object.keys(objA);
/** @type {?} */
var keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
/** @type {?} */
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
// tslint:disable-next-line:prefer-for-of
for (var idx = 0; idx < keysA.length; idx++) {
/** @type {?} */
var key = keysA[idx];
if (!bHasOwnProperty(key)) {
return false;
}
if (objA[key] !== objB[key]) {
return false;
}
}
return true;
}
/**
* @param {?} value
* @return {?}
*/
function isInteger(value) {
return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
}
/**
* @param {?} element
* @return {?}
*/
function isEmpty(element) {
/** @type {?} */
var nodes = element.childNodes;
for (var i = 0; i < nodes.length; i++) {
if (filterNotEmptyNode(nodes.item(i))) {
return false;
}
}
return true;
}
/**
* @param {?} node
* @return {?}
*/
function filterNotEmptyNode(node) {
if (node) {
if (node.nodeType === 1 && (( /** @type {?} */(node))).outerHTML.toString().trim().length !== 0) {
// ELEMENT_NODE
return node;
}
else if (node.nodeType === 3 && ( /** @type {?} */(node.textContent)).toString().trim().length !== 0) {
// TEXT_NODE
return node;
}
return null;
}
return null;
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isNonEmptyString(value) {
return typeof value === 'string' && value !== '';
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isTemplateRef(value) {
return value instanceof i0.TemplateRef;
}
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function isComponent(value) {
return value instanceof i0.Type;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzMeasureScrollbarService = /** @class */ (function () {
// tslint:disable-next-line:no-any
function NzMeasureScrollbarService(document) {
this.document = document;
this.scrollbarMeasure = {
position: 'absolute',
top: '-9999px',
width: '50px',
height: '50px',
overflow: 'scroll'
};
this.initScrollBarWidth();
}
Object.defineProperty(NzMeasureScrollbarService.prototype, "scrollBarWidth", {
get: /**
* @return {?}
*/ function () {
if (isNotNil(this._scrollbarWidth)) {
return this._scrollbarWidth;
}
this.initScrollBarWidth();
return this._scrollbarWidth;
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
NzMeasureScrollbarService.prototype.initScrollBarWidth = /**
* @return {?}
*/
function () {
/** @type {?} */
var scrollDiv = this.document.createElement('div');
for (var scrollProp in this.scrollbarMeasure) {
if (this.scrollbarMeasure.hasOwnProperty(scrollProp)) {
scrollDiv.style[scrollProp] = this.scrollbarMeasure[scrollProp];
}
}
this.document.body.appendChild(scrollDiv);
/** @type {?} */
var width = scrollDiv.offsetWidth - scrollDiv.clientWidth;
this.document.body.removeChild(scrollDiv);
this._scrollbarWidth = width;
};
NzMeasureScrollbarService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] }
];
/** @nocollapse */
NzMeasureScrollbarService.ctorParameters = function () {
return [
{ type: undefined, decorators: [{ type: i0.Inject, args: [i1.DOCUMENT,] }] }
];
};
/** @nocollapse */ NzMeasureScrollbarService.ngInjectableDef = i0.defineInjectable({ factory: function NzMeasureScrollbarService_Factory() { return new NzMeasureScrollbarService(i0.inject(i1.DOCUMENT)); }, token: NzMeasureScrollbarService, providedIn: "root" });
return NzMeasureScrollbarService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzUpdateHostClassService = /** @class */ (function () {
function NzUpdateHostClassService(rendererFactory2) {
this.classMap = {};
this.renderer = rendererFactory2.createRenderer(null, null);
}
/**
* @param {?} el
* @param {?} classMap
* @return {?}
*/
NzUpdateHostClassService.prototype.updateHostClass = /**
* @param {?} el
* @param {?} classMap
* @return {?}
*/
function (el, classMap) {
this.removeClass(el, this.classMap, this.renderer);
this.classMap = __assign({}, classMap);
this.addClass(el, this.classMap, this.renderer);
};
/**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
NzUpdateHostClassService.prototype.removeClass = /**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
function (el, classMap, renderer) {
for (var i in classMap) {
if (classMap.hasOwnProperty(i)) {
renderer.removeClass(el, i);
}
}
};
/**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
NzUpdateHostClassService.prototype.addClass = /**
* @private
* @param {?} el
* @param {?} classMap
* @param {?} renderer
* @return {?}
*/
function (el, classMap, renderer) {
for (var i in classMap) {
if (classMap.hasOwnProperty(i) && classMap[i]) {
renderer.addClass(el, i);
}
}
};
NzUpdateHostClassService.decorators = [
{ type: i0.Injectable }
];
/** @nocollapse */
NzUpdateHostClassService.ctorParameters = function () {
return [
{ type: i0.RendererFactory2 }
];
};
return NzUpdateHostClassService;
}());
/**
* @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
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Creates a browser MouseEvent with the specified options.
* @param {?} type
* @param {?=} x
* @param {?=} y
* @return {?}
*/
function createMouseEvent(type, x, y) {
if (x === void 0) {
x = 0;
}
if (y === void 0) {
y = 0;
}
/** @type {?} */
var event = document.createEvent('MouseEvent');
event.initMouseEvent(type, false /* canBubble */, false /* cancelable */, window /* view */, 0 /* detail */, x /* screenX */, y /* screenY */, x /* clientX */, y /* clientY */, false /* ctrlKey */, false /* altKey */, false /* shiftKey */, false /* metaKey */, 0 /* button */, null /* relatedTarget */);
return event;
}
/**
* Creates a browser TouchEvent with the specified pointer coordinates.
* @param {?} type
* @param {?=} pageX
* @param {?=} pageY
* @return {?}
*/
function createTouchEvent(type, pageX, pageY) {
if (pageX === void 0) {
pageX = 0;
}
if (pageY === void 0) {
pageY = 0;
}
// In favor of creating events that work for most of the browsers, the event is created
// as a basic UI Event. The necessary details for the event will be set manually.
/** @type {?} */
var event = document.createEvent('UIEvent');
/** @type {?} */
var touchDetails = { pageX: pageX, pageY: pageY };
event.initUIEvent(type, true, true, window, 0);
// Most of the browsers don't have a "initTouchEvent" method that can be used to define
// the touch details.
Object.defineProperties(event, {
touches: { value: [touchDetails] }
});
return ( /** @type {?} */(event));
}
/**
* Dispatches a keydown event from an element.
* @param {?} type
* @param {?} keyCode
* @param {?=} target
* @param {?=} key
* @return {?}
*/
function createKeyboardEvent(type, keyCode, target, key) {
/** @type {?} */
var event = ( /** @type {?} */(document.createEvent('KeyboardEvent')));
// Firefox does not support `initKeyboardEvent`, but supports `initKeyEvent`.
/** @type {?} */
var initEventFn = (event.initKeyEvent || event.initKeyboardEvent).bind(event);
/** @type {?} */
var originalPreventDefault = event.preventDefault;
initEventFn(type, true, true, window, 0, 0, 0, 0, 0, keyCode);
// Webkit Browsers don't set the keyCode when calling the init function.
// See related bug https://bugs.webkit.org/show_bug.cgi?id=16735
Object.defineProperties(event, {
keyCode: { get: ( /**
* @return {?}
*/function () { return keyCode; }) },
key: { get: ( /**
* @return {?}
*/function () { return key; }) },
target: { get: ( /**
* @return {?}
*/function () { return target; }) }
});
// IE won't set `defaultPrevented` on synthetic events so we need to do it manually.
event.preventDefault = ( /**
* @return {?}
*/function () {
Object.defineProperty(event, 'defaultPrevented', { get: ( /**
* @return {?}
*/function () { return true; }) });
return originalPreventDefault.apply(this, arguments);
});
return event;
}
/**
* Creates a fake event object with any desired event type.
* @param {?} type
* @param {?=} canBubble
* @param {?=} cancelable
* @return {?}
*/
function createFakeEvent(type, canBubble, cancelable) {
if (canBubble === void 0) {
canBubble = true;
}
if (cancelable === void 0) {
cancelable = true;
}
/** @type {?} */
var event = document.createEvent('Event');
event.initEvent(type, canBubble, cancelable);
return event;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Utility to dispatch any event on a Node.
* @param {?} node
* @param {?} event
* @return {?}
*/
function dispatchEvent(node, event) {
node.dispatchEvent(event);
return event;
}
/**
* Shorthand to dispatch a fake event on a specified node.
* @param {?} node
* @param {?} type
* @param {?=} canBubble
* @return {?}
*/
function dispatchFakeEvent(node, type, canBubble) {
return dispatchEvent(node, createFakeEvent(type, canBubble));
}
/**
* Shorthand to dispatch a keyboard event with a specified key code.
* @param {?} node
* @param {?} type
* @param {?} keyCode
* @param {?=} target
* @return {?}
*/
function dispatchKeyboardEvent(node, type, keyCode, target) {
return ( /** @type {?} */(dispatchEvent(node, createKeyboardEvent(type, keyCode, target))));
}
/**
* Shorthand to dispatch a mouse event on the specified coordinates.
* @param {?} node
* @param {?} type
* @param {?=} x
* @param {?=} y
* @param {?=} event
* @return {?}
*/
function dispatchMouseEvent(node, type, x, y, event) {
if (x === void 0) {
x = 0;
}
if (y === void 0) {
y = 0;
}
if (event === void 0) {
event = createMouseEvent(type, x, y);
}
return ( /** @type {?} */(dispatchEvent(node, event)));
}
/**
* Shorthand to dispatch a touch event on the specified coordinates.
* @param {?} node
* @param {?} type
* @param {?=} x
* @param {?=} y
* @return {?}
*/
function dispatchTouchEvent(node, type, x, y) {
if (x === void 0) {
x = 0;
}
if (y === void 0) {
y = 0;
}
return ( /** @type {?} */(dispatchEvent(node, createTouchEvent(type, x, y))));
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Focuses an input, sets its value and dispatches
* the `input` event, simulating the user typing.
* @param {?} value Value to be set on the input.
* @param {?} element Element onto which to set the value.
* @return {?}
*/
function typeInElement(value, element) {
element.focus();
element.value = value;
dispatchFakeEvent(element, 'input');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Gets a RegExp used to detect an angular wrapped error message.
* See https://github.com/angular/angular/issues/8348
* @param {?} e
* @return {?}
*/
function wrappedErrorMessage(e) {
/** @type {?} */
var escapedMessage = e.message.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
return new RegExp(escapedMessage);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* \@docs-private
*/
var /**
* \@docs-private
*/ FakeViewportRuler = /** @class */ (function () {
function FakeViewportRuler() {
}
/**
* @return {?}
*/
FakeViewportRuler.prototype.getViewportRect = /**
* @return {?}
*/
function () {
return {
left: 0,
top: 0,
width: 1014,
height: 686,
bottom: 686,
right: 1014
};
};
/**
* @return {?}
*/
FakeViewportRuler.prototype.getViewportSize = /**
* @return {?}
*/
function () {
return { width: 1014, height: 686 };
};
/**
* @return {?}
*/
FakeViewportRuler.prototype.getViewportScrollPosition = /**
* @return {?}
*/
function () {
return { top: 0, left: 0 };
};
return FakeViewportRuler;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Mock synchronous NgZone implementation that can be used
* to flush out `onStable` subscriptions in tests.
*
* via: https://github.com/angular/angular/blob/master/packages/core/testing/src/ng_zone_mock.ts
* \@docs-private
*/
var MockNgZone = /** @class */ (function (_super) {
__extends(MockNgZone, _super);
function MockNgZone() {
var _this = _super.call(this, { enableLongStackTrace: false }) || this;
_this.onStable = new i0.EventEmitter(false);
return _this;
}
/**
* @param {?} fn
* @return {?}
*/
MockNgZone.prototype.run = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
return fn();
};
/**
* @param {?} fn
* @return {?}
*/
MockNgZone.prototype.runOutsideAngular = /**
* @param {?} fn
* @return {?}
*/
function (fn) {
return fn();
};
/**
* @return {?}
*/
MockNgZone.prototype.simulateZoneExit = /**
* @return {?}
*/
function () {
this.onStable.emit(null);
};
MockNgZone.decorators = [
{ type: i0.Injectable }
];
/** @nocollapse */
MockNgZone.ctorParameters = function () { return []; };
return MockNgZone;
}(i0.NgZone));
/**
* @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
*/
var NzTreeNode = /** @class */ (function () {
function NzTreeNode(option, parent, service) {
if (parent === void 0) {
parent = null;
}
if (service === void 0) {
service = null;
}
var _this = this;
this.level = 0;
if (option instanceof NzTreeNode) {
return option;
}
this.service = service || null;
this.origin = option;
this.key = option.key;
this.parentNode = parent;
this._title = option.title || '---';
this._icon = option.icon || '';
this._isLeaf = option.isLeaf || false;
this._children = [];
// option params
this._isChecked = option.checked || false;
this._isSelectable = option.disabled || option.selectable !== false;
this._isDisabled = option.disabled || false;
this._isDisableCheckbox = option.disableCheckbox || false;
this._isExpanded = option.isLeaf ? false : option.expanded || false;
this._isHalfChecked = false;
this._isSelected = (!option.disabled && option.selected) || false;
this._isLoading = false;
this.isMatched = false;
/**
* parent's checked status will affect children while initializing
*/
if (parent) {
this.level = parent.level + 1;
}
else {
this.level = 0;
}
if (typeof option.children !== 'undefined' && option.children !== null) {
option.children.forEach(( /**
* @param {?} nodeOptions
* @return {?}
*/function (nodeOptions) {
/** @type {?} */
var s = _this.treeService;
if (s &&
!s.isCheckStrictly &&
option.checked &&
!option.disabled &&
!nodeOptions.disabled &&
!nodeOptions.disableCheckbox) {
nodeOptions.checked = option.checked;
}
_this._children.push(new NzTreeNode(nodeOptions, _this));
}));
}
}
Object.defineProperty(NzTreeNode.prototype, "treeService", {
get: /**
* @return {?}
*/ function () {
return this.service || (this.parentNode && this.parentNode.treeService);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "title", {
/**
* auto generate
* get
* set
*/
get: /**
* auto generate
* get
* set
* @return {?}
*/ function () {
return this._title;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._title = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "icon", {
get: /**
* @return {?}
*/ function () {
return this._icon;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._icon = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "children", {
get: /**
* @return {?}
*/ function () {
return this._children;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._children = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isLeaf", {
get: /**
* @return {?}
*/ function () {
return this._isLeaf;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isLeaf = value;
// this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isChecked", {
get: /**
* @return {?}
*/ function () {
return this._isChecked;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isChecked = value;
this._isAllChecked = value;
this.origin.checked = value;
this.afterValueChange('isChecked');
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isAllChecked", {
get: /**
* @return {?}
*/ function () {
return this._isAllChecked;
},
/**
* @deprecated Maybe removed in next major version, use isChecked instead
*/
set: /**
* @deprecated Maybe removed in next major version, use isChecked instead
* @param {?} value
* @return {?}
*/ function (value) {
this._isAllChecked = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isHalfChecked", {
get: /**
* @return {?}
*/ function () {
return this._isHalfChecked;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isHalfChecked = value;
this.afterValueChange('isHalfChecked');
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isSelectable", {
get: /**
* @return {?}
*/ function () {
return this._isSelectable;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isSelectable = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isDisabled", {
get: /**
* @return {?}
*/ function () {
return this._isDisabled;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isDisabled = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isDisableCheckbox", {
get: /**
* @return {?}
*/ function () {
return this._isDisableCheckbox;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isDisableCheckbox = value;
this.update();
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isExpanded", {
get: /**
* @return {?}
*/ function () {
return this._isExpanded;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isExpanded = value;
this.origin.expanded = value;
this.afterValueChange('isExpanded');
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isSelected", {
get: /**
* @return {?}
*/ function () {
return this._isSelected;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isSelected = value;
this.origin.selected = value;
this.afterValueChange('isSelected');
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzTreeNode.prototype, "isLoading", {
get: /**
* @return {?}
*/ function () {
return this._isLoading;
},
set: /**
* @param {?} value
* @return {?}
*/ function (value) {
this._isLoading = value;
this.update();
},
enumerable: true,
configurable: true
});
/**
* @param {?=} checked
* @param {?=} halfChecked
* @return {?}
*/
NzTreeNode.prototype.setSyncChecked = /**
* @param {?=} checked
* @param {?=} halfChecked
* @return {?}
*/
function (checked, halfChecked) {
if (checked === void 0) {
checked = false;
}
if (halfChecked === void 0) {
halfChecked = false;
}
this.setChecked(checked, halfChecked);
if (this.treeService && !this.treeService.isCheckStrictly) {
this.treeService.conduct(this);
}
};
/**
* @deprecated Maybe removed in next major version, use isChecked instead
*/
/**
* @deprecated Maybe removed in next major version, use isChecked instead
* @param {?=} checked
* @param {?=} halfChecked
* @return {?}
*/
NzTreeNode.prototype.setChecked = /**
* @deprecated Maybe removed in next major version, use isChecked instead
* @param {?=} checked
* @param {?=} halfChecked
* @return {?}
*/
function (checked, halfChecked) {
if (checked === void 0) {
checked = false;
}
if (halfChecked === void 0) {
halfChecked = false;
}
this.origin.checked = checked;
this.isChecked = checked;
this.isAllChecked = checked;
this.isHalfChecked = halfChecked;
};
/**
* @deprecated Maybe removed in next major version, use isExpanded instead
*/
/**
* @deprecated Maybe removed in next major version, use isExpanded instead
* @param {?} value
* @return {?}
*/
NzTreeNode.prototype.setExpanded = /**
* @deprecated Maybe removed in next major version, use isExpanded instead
* @param {?} value
* @return {?}
*/
function (value) {
this.isExpanded = value;
};
/**
* @deprecated Maybe removed in next major version, use isSelected instead
*/
/**
* @deprecated Maybe removed in next major version, use isSelected instead
* @param {?} value
* @return {?}
*/
NzTreeNode.prototype.setSelected = /**
* @deprecated Maybe removed in next major version, use isSelected instead
* @param {?} value
* @return {?}
*/
function (value) {
if (this.isDisabled) {
return;
}
this.isSelected = value;
};
/**
* @return {?}
*/
NzTreeNode.prototype.getParentNode = /**
* @return {?}
*/
function () {
return this.parentNode;
};
/**
* @return {?}
*/
NzTreeNode.prototype.getChildren = /**
* @return {?}
*/
function () {
return this.children;
};
/**
* 支持按索引位置插入,叶子节点不可添加
*/
// tslint:disable-next-line:no-any
/**
* 支持按索引位置插入,叶子节点不可添加
* @param {?} children
* @param {?=} childPos
* @return {?}
*/
// tslint:disable-next-line:no-any
NzTreeNode.prototype.addChildren = /**
* 支持按索引位置插入,叶子节点不可添加
* @param {?} children
* @param {?=} childPos
* @return {?}
*/
// tslint:disable-next-line:no-any
function (children, childPos) {
var _this = this;
if (childPos === void 0) {
childPos = -1;
}
if (!this.isLeaf) {
children.forEach(( /**
* @param {?} node
* @return {?}
*/function (node) {
/** @type {?} */
var refreshLevel = ( /**
* @param {?} n
* @return {?}
*/function (n) {
n.getChildren().forEach(( /**
* @param {?} c
* @return {?}
*/function (c) {
c.level = ( /** @type {?} */(c.getParentNode())).level + 1;
// flush origin
c.origin.level = c.level;
refreshLevel(c);
}));
});
/** @type {?} */
var child = node;
if (child instanceof NzTreeNode) {
child.parentNode = _this;
}
else {
child = new NzTreeNode(node, _this);
}
child.level = _this.level + 1;
child.origin.level = child.level;
refreshLevel(child);
try {
childPos === -1 ? _this.children.push(child) : _this.children.splice(childPos, 0, child);
// flush origin
}
catch (e) { }
}));
this.origin.children = this.getChildren().map(( /**
* @param {?} v
* @return {?}
*/function (v) { return v.origin; }));
// remove loading state
this.isLoading = false;
}
};
/**
* @return {?}
*/
NzTreeNode.prototype.clearChildren = /**
* @return {?}
*/
function () {
// refresh checked state
this.afterValueChange('clearChildren');
this.children = [];
this.origin.children = [];
};
/**
* @return {?}
*/
NzTreeNode.prototype.remove = /**
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var parentNode = this.getParentNode();
if (parentNode) {
parentNode.children = parentNode.getChildren().filter(( /**
* @param {?} v
* @return {?}
*/function (v) { return v.key !== _this.key; }));
parentNode.origin.children = ( /** @type {?} */(parentNode.origin.children)).filter(( /**
* @param {?} v
* @return {?}
*/function (v) { return v.key !== _this.key; }));
this.afterValueChange('remove');
}
};
/**
* @param {?} key
* @return {?}
*/
NzTreeNode.prototype.afterValueChange = /**
* @param {?} key
* @return {?}
*/
function (key) {
if (this.treeService) {
switch (key) {
case 'isChecked':
this.treeService.setCheckedNodeList(this);
break;
case 'isHalfChecked':
this.treeService.setHalfCheckedNodeList(this);
break;
case 'isExpanded':
this.treeService.setExpandedNodeList(this);
break;
case 'isSelected':
this.treeService.setNodeActive(this);
break;
case 'clearChildren':
this.treeService.afterRemove(this.getChildren());
break;
case 'remove':
this.treeService.afterRemove([this]);
break;
}
}
this.update();
};
/**
* @return {?}
*/
NzTreeNode.prototype.update = /**
* @return {?}
*/
function () {
if (this.component) {
this.component.setClassMap();
this.component.markForCheck();
}
};
return NzTreeNode;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @template T
* @param {?} value
* @return {?}
*/
function toArray(value) {
/** @type {?} */
var ret;
if (value == null) {
ret = [];
}
else if (!Array.isArray(value)) {
ret = [value];
}
else {
ret = value;
}
return ret;
}
/**
* @template T
* @param {?} array1
* @param {?} array2
* @return {?}
*/
function arraysEqual(array1, array2) {
if (!array1 || !array2 || array1.length !== array2.length) {
return false;
}
/** @type {?} */
var len = array1.length;
for (var i = 0; i < len; i++) {
if (array1[i] !== array2[i]) {
return false;
}
}
return true;
}
/**
* @template T
* @param {?} source
* @return {?}
*/
function shallowCopyArray(source) {
return source.slice();
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* Silent an event by stopping and preventing it.
* @param {?} e
* @return {?}
*/
function silentEvent(e) {
e.stopPropagation();
e.preventDefault();
}
/**
* @param {?} elem
* @return {?}
*/
function getElementOffset(elem) {
if (!elem.getClientRects().length) {
return { top: 0, left: 0 };
}
/** @type {?} */
var rect = elem.getBoundingClientRect();
/** @type {?} */
var win = ( /** @type {?} */(elem.ownerDocument)).defaultView;
return {
top: rect.top + ( /** @type {?} */(win)).pageYOffset,
left: rect.left + ( /** @type {?} */(win)).pageXOffset
};
}
/**
* @param {?} element
* @return {?}
*/
function findFirstNotEmptyNode(element) {
/** @type {?} */
var children = element.childNodes;
for (var i = 0; i < children.length; i++) {
/** @type {?} */
var node = children.item(i);
if (filterNotEmptyNode(node)) {
return node;
}
}
return null;
}
/**
* @param {?} element
* @return {?}
*/
function findLastNotEmptyNode(element) {
/** @type {?} */
var children = element.childNodes;
for (var i = children.length - 1; i >= 0; i--) {
/** @type {?} */
var node = children.item(i);
if (filterNotEmptyNode(node)) {
return node;
}
}
return null;
}
/**
* @param {?} parent
* @return {?}
*/
function reverseChildNodes(parent) {
/** @type {?} */
var children = parent.childNodes;
/** @type {?} */
var length = children.length;
if (length) {
/** @type {?} */
var nodes_1 = [];
children.forEach(( /**
* @param {?} node
* @param {?} i
* @return {?}
*/function (node, i) { return (nodes_1[i] = node); }));
while (length--) {
parent.appendChild(nodes_1[length]);
}
}
}
/**
* Investigate if an event is a `TouchEvent`.
* @param {?} event
* @return {?}
*/
function isTouchEvent(event) {
return event.type.startsWith('touch');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @param {?} prefix
* @return {?}
*/
function getRegExp(prefix) {
/** @type {?} */
var prefixArray = Array.isArray(prefix) ? prefix : [prefix];
/** @type {?} */
var prefixToken = prefixArray.join('').replace(/(\$|\^)/g, '\\$1');
if (prefixArray.length > 1) {
prefixToken = "[" + prefixToken + "]";
}
return new RegExp("(\\s|^)(" + prefixToken + ")[^\\s]*", 'g');
}
/**
* @param {?} value
* @param {?=} prefix
* @return {?}
*/
function getMentions(value, prefix) {
if (prefix === void 0) {
prefix = '@';
}
if (typeof value !== 'string') {
return [];
}
/** @type {?} */
var regex = getRegExp(prefix);
/** @type {?} */
var mentions = value.match(regex);
return mentions !== null ? mentions.map(( /**
* @param {?} e
* @return {?}
*/function (e) { return e.trim(); })) : [];
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* Much like lodash.
* @param {?} toPad
* @param {?} length
* @param {?} element
* @return {?}
*/
function padStart(toPad, length, element) {
if (toPad.length > length) {
return toPad;
}
/** @type {?} */
var joined = "" + getRepeatedElement(length, element) + toPad;
return joined.slice(joined.length - length, joined.length);
}
/**
* @param {?} toPad
* @param {?} length
* @param {?} element
* @return {?}
*/
function padEnd(toPad, length, element) {
/** @type {?} */
var joined = "" + toPad + getRepeatedElement(length, element);
return joined.slice(0, length);
}
/**
* @param {?} length
* @param {?} element
* @return {?}
*/
function getRepeatedElement(length, element) {
return Array(length)
.fill(element)
.join('');
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
// tslint:disable-next-line:no-any
/**
* @param {?} obj
* @return {?}
*/
function isPromise(obj) {
return !!obj && typeof obj.then === 'function' && typeof obj.catch === 'function';
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @param {?} min
* @param {?} max
* @param {?} value
* @return {?}
*/
function getPercent(min, max, value) {
return ((value - min) / (max - min)) * 100;
}
/**
* @param {?} num
* @return {?}
*/
function getPrecision(num) {
/** @type {?} */
var numStr = num.toString();
/** @type {?} */
var dotIndex = numStr.indexOf('.');
return dotIndex >= 0 ? numStr.length - dotIndex - 1 : 0;
}
/**
* @param {?} num
* @param {?} min
* @param {?} max
* @return {?}
*/
function ensureNumberInRange(num, min, max) {
if (isNaN(num) || num < min) {
return min;
}
else if (num > max) {
return max;
}
else {
return num;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @param {?} node
* @return {?}
*/
function scrollIntoView(node) {
/** @type {?} */
var nodeAsAny = ( /** @type {?} */(node));
if (nodeAsAny.scrollIntoViewIfNeeded) {
/* tslint:disable-next-line:no-string-literal */
nodeAsAny.scrollIntoViewIfNeeded(false);
return;
}
if (node.scrollIntoView) {
node.scrollIntoView(false);
return;
}
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
// from https://github.com/component/textarea-caret-position
// We'll copy the properties below into the mirror div.
// Note that some browsers, such as Firefox, do not concatenate properties
// into their shorthand (e.g. padding-top, padding-bottom etc. -> padding),
// so we have to list every single property explicitly.
/** @type {?} */
var properties = [
'direction',
'boxSizing',
'width',
'height',
'overflowX',
'overflowY',
'borderTopWidth',
'borderRightWidth',
'borderBottomWidth',
'borderLeftWidth',
'borderStyle',
'paddingTop',
'paddingRight',
'paddingBottom',
'paddingLeft',
// https://developer.mozilla.org/en-US/docs/Web/CSS/font
'fontStyle',
'fontVariant',
'fontWeight',
'fontStretch',
'fontSize',
'fontSizeAdjust',
'lineHeight',
'fontFamily',
'textAlign',
'textTransform',
'textIndent',
'textDecoration',
'letterSpacing',
'wordSpacing',
'tabSize',
'MozTabSize'
];
/** @type {?} */
var isBrowser = typeof window !== 'undefined';
// tslint:disable-next-line:no-any
/** @type {?} */
var isFirefox = isBrowser && (( /** @type {?} */(window))).mozInnerScreenX != null;
/** @type {?} */
var _parseInt = ( /**
* @param {?} str
* @return {?}
*/function (str) { return parseInt(str, 10); });
/**
* @param {?} element
* @param {?} position
* @param {?=} options
* @return {?}
*/
function getCaretCoordinates(element, position, options) {
if (!isBrowser) {
throw new Error('textarea-caret-position#getCaretCoordinates should only be called in a browser');
}
/** @type {?} */
var debug = (options && options.debug) || false;
if (debug) {
/** @type {?} */
var el = document.querySelector('#input-textarea-caret-position-mirror-div');
if (el) {
( /** @type {?} */(el.parentNode)).removeChild(el);
}
}
// The mirror div will replicate the textarea's style
/** @type {?} */
var div = document.createElement('div');
div.id = 'input-textarea-caret-position-mirror-div';
document.body.appendChild(div);
/** @type {?} */
var style = div.style;
// tslint:disable-next-line:no-any
/** @type {?} */
var computed = window.getComputedStyle ? window.getComputedStyle(element) : (( /** @type {?} */(element))).currentStyle;
// currentStyle for IE < 9
/** @type {?} */
var isInput = element.nodeName === 'INPUT';
// Default textarea styles
style.whiteSpace = 'pre-wrap';
if (!isInput) {
style.wordWrap = 'break-word'; // only for textarea-s
}
// Position off-screen
style.position = 'absolute'; // required to return coordinates properly
if (!debug) {
style.visibility = 'hidden';
} // not 'display: none' because we want rendering
// Transfer the element's properties to the div
properties.forEach(( /**
* @param {?} prop
* @return {?}
*/function (prop) {
if (isInput && prop === 'lineHeight') {
// Special case for <input>s because text is rendered centered and line height may be != height
style.lineHeight = computed.height;
}
else {
// @ts-ignore
style[prop] = computed[prop];
}
}));
if (isFirefox) {
// Firefox lies about the overflow property for textareas: https://bugzilla.mozilla.org/show_bug.cgi?id=984275
if (element.scrollHeight > _parseInt(computed.height)) {
style.overflowY = 'scroll';
}
}
else {
style.overflow = 'hidden'; // for Chrome to not render a scrollbar; IE keeps overflowY = 'scroll'
}
div.textContent = element.value.substring(0, position);
// The second special handling for input type="text" vs textarea:
// spaces need to be replaced with non-breaking spaces - http://stackoverflow.com/a/13402035/1269037
if (isInput) {
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
}
/** @type {?} */
var span = document.createElement('span');
// Wrapping must be replicated *exactly*, including when a long word gets
// onto the next line, with whitespace at the end of the line before (#7).
// The *only* reliable way to do that is to copy the *entire* rest of the
// textarea's content into the <span> created at the caret position.
// For inputs, just '.' would be enough, but no need to bother.
span.textContent = element.value.substring(position) || '.'; // || because a completely empty faux span doesn't render at all
div.appendChild(span);
/** @type {?} */
var coordinates = {
top: span.offsetTop + _parseInt(computed.borderTopWidth),
left: span.offsetLeft + _parseInt(computed.borderLeftWidth),
height: _parseInt(computed.lineHeight)
};
if (debug) {
span.style.backgroundColor = '#eee';
createDebugEle(element, coordinates);
}
else {
document.body.removeChild(div);
}
return coordinates;
}
/**
* @param {?} element
* @param {?} coordinates
* @return {?}
*/
function createDebugEle(element, coordinates) {
/** @type {?} */
var fontSize = getComputedStyle(element).getPropertyValue('font-size');
/** @type {?} */
var rect = (( /** @type {?} */(document.querySelector('#DEBUG')))) || document.createElement('div');
document.body.appendChild(rect);
rect.id = 'DEBUG';
rect.style.position = 'absolute';
rect.style.backgroundColor = 'red';
rect.style.height = fontSize;
rect.style.width = '1px';
rect.style.top = element.getBoundingClientRect().top -
element.scrollTop +
window.pageYOffset +
coordinates.top + "px";
rect.style.left = element.getBoundingClientRect().left -
element.scrollLeft +
window.pageXOffset +
coordinates.left + "px";
console.log(rect.style.top);
console.log(rect.style.left);
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @param {?} fn
* @return {?}
*/
function throttleByAnimationFrame(fn) {
/** @type {?} */
var requestId;
/** @type {?} */
var later = ( /**
* @param {?} args
* @return {?}
*/function (args) {
return ( /**
* @return {?}
*/function () {
requestId = null;
fn.apply(void 0, __spread(args));
});
});
/** @type {?} */
var throttled = ( /**
* @param {...?} args
* @return {?}
*/function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (requestId == null) {
requestId = reqAnimFrame(later(args));
}
});
// tslint:disable-next-line:no-non-null-assertion
(( /** @type {?} */(throttled))).cancel = ( /**
* @return {?}
*/function () { return cancelRequestAnimationFrame(( /** @type {?} */(requestId))); });
return throttled;
}
/**
* @return {?}
*/
function throttleByAnimationFrameDecorator() {
return ( /**
* @param {?} target
* @param {?} key
* @param {?} descriptor
* @return {?}
*/function (target, key, descriptor) {
/** @type {?} */
var fn = descriptor.value;
/** @type {?} */
var definingProperty = false;
return {
configurable: true,
get: /**
* @return {?}
*/ function () {
if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
return fn;
}
/** @type {?} */
var boundFn = throttleByAnimationFrame(fn.bind(this));
definingProperty = true;
Object.defineProperty(this, key, {
value: boundFn,
configurable: true,
writable: true
});
definingProperty = false;
return boundFn;
}
};
});
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/** @type {?} */
var timeUnits = [
['Y', 1000 * 60 * 60 * 24 * 365],
['M', 1000 * 60 * 60 * 24 * 30],
['D', 1000 * 60 * 60 * 24],
['H', 1000 * 60 * 60],
['m', 1000 * 60],
['s', 1000],
['S', 1] // million seconds
];
/**
* @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
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/**
* @license
* Copyright Alibaba.com All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
/**
* @param {?} node
* @return {?}
*/
function isCheckDisabled(node) {
var isDisabled = node.isDisabled, isDisableCheckbox = node.isDisableCheckbox;
return !!(isDisabled || isDisableCheckbox);
}
// tslint:disable-next-line:no-any
/**
* @param {?} needle
* @param {?} haystack
* @return {?}
*/
function isInArray(needle, haystack) {
return haystack.length > 0 && haystack.indexOf(needle) > -1;
}
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzTreeBaseService = /** @class */ (function () {
function NzTreeBaseService() {
this.DRAG_SIDE_RANGE = 0.25;
this.DRAG_MIN_GAP = 2;
this.isCheckStrictly = false;
this.isMultiple = false;
this.rootNodes = [];
this.selectedNodeList = [];
this.expandedNodeList = [];
this.checkedNodeList = [];
this.halfCheckedNodeList = [];
this.matchedNodeList = [];
this.triggerEventChange$ = new rxjs.Subject();
}
/**
* trigger event
*/
/**
* trigger event
* @return {?}
*/
NzTreeBaseService.prototype.eventTriggerChanged = /**
* trigger event
* @return {?}
*/
function () {
return this.triggerEventChange$.asObservable();
};
/**
* reset tree nodes will clear default node list
*/
/**
* reset tree nodes will clear default node list
* @param {?} nzNodes
* @return {?}
*/
NzTreeBaseService.prototype.initTree = /**
* reset tree nodes will clear default node list
* @param {?} nzNodes
* @return {?}
*/
function (nzNodes) {
var _this = this;
this.rootNodes = nzNodes;
this.expandedNodeList = [];
this.selectedNodeList = [];
this.halfCheckedNodeList = [];
this.checkedNodeList = [];
this.matchedNodeList = [];
// refresh node checked state
setTimeout(( /**
* @return {?}
*/function () {
_this.refreshCheckState(_this.isCheckStrictly);
}));
};
/**
* @return {?}
*/
NzTreeBaseService.prototype.getSelectedNode = /**
* @return {?}
*/
function () {
return this.selectedNode;
};
/**
* get some list
*/
/**
* get some list
* @return {?}
*/
NzTreeBaseService.prototype.getSelectedNodeList = /**
* get some list
* @return {?}
*/
function () {
return this.conductNodeState('select');
};
/**
* return checked nodes
*/
/**
* return checked nodes
* @return {?}
*/
NzTreeBaseService.prototype.getCheckedNodeList = /**
* return checked nodes
* @return {?}
*/
function () {
return this.conductNodeState('check');
};
/**
* @return {?}
*/
NzTreeBaseService.prototype.getHalfCheckedNodeList = /**
* @return {?}
*/
function () {
return this.conductNodeState('halfCheck');
};
/**
* return expanded nodes
*/
/**
* return expanded nodes
* @return {?}
*/
NzTreeBaseService.prototype.getExpandedNodeList = /**
* return expanded nodes
* @return {?}
*/
function () {
return this.conductNodeState('expand');
};
/**
* return search matched nodes
*/
/**
* return search matched nodes
* @return {?}
*/
NzTreeBaseService.prototype.getMatchedNodeList = /**
* return search matched nodes
* @return {?}
*/
function () {
return this.conductNodeState('match');
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
NzTreeBaseService.prototype.isArrayOfNzTreeNode =
// tslint:disable-next-line:no-any
/**
* @param {?} value
* @return {?}
*/
function (value) {
return value.every(( /**
* @param {?} item
* @return {?}
*/function (item) { return item instanceof NzTreeNode; }));
};
/**
* reset selectedNodeList
*/
/**
* reset selectedNodeList
* @param {?} selectedKeys
* @param {?} nzNodes
* @param {?=} isMulti
* @return {?}
*/
NzTreeBaseService.prototype.calcSelectedKeys = /**
* reset selectedNodeList
* @param {?} selectedKeys
* @param {?} nzNodes
* @param {?=} isMulti
* @return {?}
*/
function (selectedKeys, nzNodes, isMulti) {
if (isMulti === void 0) {
isMulti = false;
}
/** @type {?} */
var calc = ( /**
* @param {?} nodes
* @return {?}
*/function (nodes) {
return nodes.every(( /**
* @param {?} node
* @return {?}
*/function (node) {
if (isInArray(node.key, selectedKeys)) {
node.isSelected = true;
if (!isMulti) {
// if not support multi select
return false;
}
}
else {
node.isSelected = false;
}
if (node.children.length > 0) {
// Recursion
return calc(node.children);
}
return true;
}));
});
calc(nzNodes);
};
/**
* reset expandedNodeList
*/
/**
* reset expandedNodeList
* @param {?} expandedKeys
* @param {?} nzNodes
* @return {?}
*/
NzTreeBaseService.prototype.calcExpandedKeys = /**
* reset expandedNodeList
* @param {?} expandedKeys
* @param {?} nzNodes
* @return {?}
*/
function (expandedKeys, nzNodes) {
this.expandedNodeList = [];
/** @type {?} */
var calc = ( /**
* @param {?} nodes
* @return {?}
*/function (nodes) {
nodes.forEach(( /**
* @param {?} node
* @return {?}
*/function (node) {
node.isExpanded = isInArray(node.key, expandedKeys);
if (node.children.length > 0) {
calc(node.children);
}
}));
});
calc(nzNodes);
};
/**
* reset checkedNodeList
*/
/**
* reset checkedNodeList
* @param {?} checkedKeys
* @param {?} nzNodes
* @param {?=} isCheckStrictly
* @return {?}
*/
NzTreeBaseService.prototype.calcCheckedKeys = /**
* reset checkedNodeList
* @param {?} checkedKeys
* @param {?} nzNodes
* @param {?=} isCheckStrictly
* @return {?}
*/
function (checkedKeys, nzNodes, isCheckStrictly) {
if (isCheckStrictly === void 0) {
isCheckStrictly = false;
}
this.checkedNodeList = [];
this.halfCheckedNodeList = [];
/** @type {?} */
var calc = ( /**
* @param {?} nodes
* @return {?}
*/function (nodes) {
nodes.forEach(( /**
* @param {?} node
* @return {?}
*/function (node) {
if (isInArray(node.key, checkedKeys)) {
node.isChecked = true;
node.isHalfChecked = false;
}
else {
node.isChecked = false;
node.isHalfChecked = false;
}
if (node.children.length > 0) {
calc(node.children);
}
}));
});
calc(nzNodes);
// controlled state
this.refreshCheckState(isCheckStrictly);
};
/**
* set drag node
*/
/**
* set drag node
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.setSelectedNode = /**
* set drag node
* @param {?} node
* @return {?}
*/
function (node) {
this.selectedNode = node;
};
/**
* set node selected status
*/
/**
* set node selected status
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.setNodeActive = /**
* set node selected status
* @param {?} node
* @return {?}
*/
function (node) {
if (!this.isMultiple && node.isSelected) {
this.selectedNodeList.forEach(( /**
* @param {?} n
* @return {?}
*/function (n) {
if (node.key !== n.key) {
// reset other nodes
n.isSelected = false;
}
}));
// single mode: remove pre node
this.selectedNodeList = [];
}
this.setSelectedNodeList(node, this.isMultiple);
};
/**
* add or remove node to selectedNodeList
*/
/**
* add or remove node to selectedNodeList
* @param {?} node
* @param {?=} isMultiple
* @return {?}
*/
NzTreeBaseService.prototype.setSelectedNodeList = /**
* add or remove node to selectedNodeList
* @param {?} node
* @param {?=} isMultiple
* @return {?}
*/
function (node, isMultiple) {
if (isMultiple === void 0) {
isMultiple = false;
}
/** @type {?} */
var index = this.selectedNodeList.findIndex(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key === n.key; }));
if (isMultiple) {
if (node.isSelected && index === -1) {
this.selectedNodeList.push(node);
}
}
else {
if (node.isSelected && index === -1) {
this.selectedNodeList = [node];
}
}
if (!node.isSelected) {
this.selectedNodeList = this.selectedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== node.key; }));
}
};
/**
* merge checked nodes
*/
/**
* merge checked nodes
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.setHalfCheckedNodeList = /**
* merge checked nodes
* @param {?} node
* @return {?}
*/
function (node) {
/** @type {?} */
var index = this.halfCheckedNodeList.findIndex(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key === n.key; }));
if (node.isHalfChecked && index === -1) {
this.halfCheckedNodeList.push(node);
}
else if (!node.isHalfChecked && index > -1) {
this.halfCheckedNodeList = this.halfCheckedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key !== n.key; }));
}
};
/**
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.setCheckedNodeList = /**
* @param {?} node
* @return {?}
*/
function (node) {
/** @type {?} */
var index = this.checkedNodeList.findIndex(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key === n.key; }));
if (node.isChecked && index === -1) {
this.checkedNodeList.push(node);
}
else if (!node.isChecked && index > -1) {
this.checkedNodeList = this.checkedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key !== n.key; }));
}
};
/**
* conduct checked/selected/expanded keys
*/
/**
* conduct checked/selected/expanded keys
* @param {?=} type
* @return {?}
*/
NzTreeBaseService.prototype.conductNodeState = /**
* conduct checked/selected/expanded keys
* @param {?=} type
* @return {?}
*/
function (type) {
var _this = this;
if (type === void 0) {
type = 'check';
}
/** @type {?} */
var resultNodesList = [];
switch (type) {
case 'select':
resultNodesList = this.selectedNodeList;
break;
case 'expand':
resultNodesList = this.expandedNodeList;
break;
case 'match':
resultNodesList = this.matchedNodeList;
break;
case 'check':
resultNodesList = this.checkedNodeList;
/** @type {?} */
var isIgnore_1 = ( /**
* @param {?} node
* @return {?}
*/function (node) {
/** @type {?} */
var parentNode = node.getParentNode();
if (parentNode) {
if (_this.checkedNodeList.findIndex(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key === parentNode.key; })) > -1) {
return true;
}
else {
return isIgnore_1(parentNode);
}
}
return false;
});
// merge checked
if (!this.isCheckStrictly) {
resultNodesList = this.checkedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return !isIgnore_1(n); }));
}
break;
case 'halfCheck':
if (!this.isCheckStrictly) {
resultNodesList = this.halfCheckedNodeList;
}
break;
}
return resultNodesList;
};
/**
* set expanded nodes
*/
/**
* set expanded nodes
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.setExpandedNodeList = /**
* set expanded nodes
* @param {?} node
* @return {?}
*/
function (node) {
if (node.isLeaf) {
return;
}
/** @type {?} */
var index = this.expandedNodeList.findIndex(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key === n.key; }));
if (node.isExpanded && index === -1) {
this.expandedNodeList.push(node);
}
else if (!node.isExpanded && index > -1) {
this.expandedNodeList = this.expandedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return node.key !== n.key; }));
}
};
/**
* check state
* @param isCheckStrictly
*/
/**
* check state
* @param {?=} isCheckStrictly
* @return {?}
*/
NzTreeBaseService.prototype.refreshCheckState = /**
* check state
* @param {?=} isCheckStrictly
* @return {?}
*/
function (isCheckStrictly) {
var _this = this;
if (isCheckStrictly === void 0) {
isCheckStrictly = false;
}
if (isCheckStrictly) {
return;
}
this.checkedNodeList.forEach(( /**
* @param {?} node
* @return {?}
*/function (node) {
_this.conduct(node);
}));
};
// reset other node checked state based current node
// reset other node checked state based current node
/**
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.conduct =
// reset other node checked state based current node
/**
* @param {?} node
* @return {?}
*/
function (node) {
/** @type {?} */
var isChecked = node.isChecked;
if (node) {
this.conductUp(node);
this.conductDown(node, isChecked);
}
};
/**
* 1、children half checked
* 2、children all checked, parent checked
* 3、no children checked
*/
/**
* 1、children half checked
* 2、children all checked, parent checked
* 3、no children checked
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.conductUp = /**
* 1、children half checked
* 2、children all checked, parent checked
* 3、no children checked
* @param {?} node
* @return {?}
*/
function (node) {
/** @type {?} */
var parentNode = node.getParentNode();
// 全禁用节点不选中
if (parentNode) {
if (!isCheckDisabled(parentNode)) {
if (parentNode.children.every(( /**
* @param {?} child
* @return {?}
*/function (child) { return isCheckDisabled(child) || (!child.isHalfChecked && child.isChecked); }))) {
parentNode.isChecked = true;
parentNode.isHalfChecked = false;
}
else if (parentNode.children.some(( /**
* @param {?} child
* @return {?}
*/function (child) { return child.isHalfChecked || child.isChecked; }))) {
parentNode.isChecked = false;
parentNode.isHalfChecked = true;
}
else {
parentNode.isChecked = false;
parentNode.isHalfChecked = false;
}
}
this.setCheckedNodeList(parentNode);
this.setHalfCheckedNodeList(parentNode);
this.conductUp(parentNode);
}
};
/**
* reset child check state
*/
/**
* reset child check state
* @param {?} node
* @param {?} value
* @return {?}
*/
NzTreeBaseService.prototype.conductDown = /**
* reset child check state
* @param {?} node
* @param {?} value
* @return {?}
*/
function (node, value) {
var _this = this;
if (!isCheckDisabled(node)) {
node.isChecked = value;
node.isHalfChecked = false;
this.setCheckedNodeList(node);
this.setHalfCheckedNodeList(node);
node.children.forEach(( /**
* @param {?} n
* @return {?}
*/function (n) {
_this.conductDown(n, value);
}));
}
};
/**
* search value & expand node
* should add expandlist
*/
/**
* search value & expand node
* should add expandlist
* @param {?} value
* @return {?}
*/
NzTreeBaseService.prototype.searchExpand = /**
* search value & expand node
* should add expandlist
* @param {?} value
* @return {?}
*/
function (value) {
var _this = this;
this.matchedNodeList = [];
/** @type {?} */
var expandedKeys = [];
if (!isNotNil(value)) {
return;
}
// to reset expandedNodeList
/** @type {?} */
var expandParent = ( /**
* @param {?} n
* @return {?}
*/function (n) {
// expand parent node
/** @type {?} */
var parentNode = n.getParentNode();
if (parentNode) {
expandedKeys.push(parentNode.key);
expandParent(parentNode);
}
});
/** @type {?} */
var searchChild = ( /**
* @param {?} n
* @return {?}
*/function (n) {
if (value && n.title.includes(value)) {
// match the node
n.isMatched = true;
_this.matchedNodeList.push(n);
// expand parentNode
expandParent(n);
}
else {
n.isMatched = false;
}
n.children.forEach(( /**
* @param {?} child
* @return {?}
*/function (child) {
searchChild(child);
}));
});
this.rootNodes.forEach(( /**
* @param {?} child
* @return {?}
*/function (child) {
searchChild(child);
}));
// expand matched keys
this.calcExpandedKeys(expandedKeys, this.rootNodes);
};
/**
* flush after delete node
*/
/**
* flush after delete node
* @param {?} nodes
* @return {?}
*/
NzTreeBaseService.prototype.afterRemove = /**
* flush after delete node
* @param {?} nodes
* @return {?}
*/
function (nodes) {
var _this = this;
// to reset selectedNodeList & expandedNodeList
/** @type {?} */
var loopNode = ( /**
* @param {?} node
* @return {?}
*/function (node) {
// remove selected node
_this.selectedNodeList = _this.selectedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== node.key; }));
// remove expanded node
_this.expandedNodeList = _this.expandedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== node.key; }));
// remove checked node
_this.checkedNodeList = _this.checkedNodeList.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== node.key; }));
if (node.children) {
node.children.forEach(( /**
* @param {?} child
* @return {?}
*/function (child) {
loopNode(child);
}));
}
});
nodes.forEach(( /**
* @param {?} n
* @return {?}
*/function (n) {
loopNode(n);
}));
this.refreshCheckState(this.isCheckStrictly);
};
/**
* drag event
*/
/**
* drag event
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.refreshDragNode = /**
* drag event
* @param {?} node
* @return {?}
*/
function (node) {
var _this = this;
if (node.children.length === 0) {
// until root
this.conductUp(node);
}
else {
node.children.forEach(( /**
* @param {?} child
* @return {?}
*/function (child) {
_this.refreshDragNode(child);
}));
}
};
// reset node level
// reset node level
/**
* @param {?} node
* @return {?}
*/
NzTreeBaseService.prototype.resetNodeLevel =
// reset node level
/**
* @param {?} node
* @return {?}
*/
function (node) {
var e_1, _a;
/** @type {?} */
var parentNode = node.getParentNode();
if (parentNode) {
node.level = parentNode.level + 1;
}
else {
node.level = 0;
}
try {
for (var _b = __values(node.children), _c = _b.next(); !_c.done; _c = _b.next()) {
var child = _c.value;
this.resetNodeLevel(child);
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (_c && !_c.done && (_a = _b.return))
_a.call(_b);
}
finally {
if (e_1)
throw e_1.error;
}
}
};
/**
* @param {?} event
* @return {?}
*/
NzTreeBaseService.prototype.calcDropPosition = /**
* @param {?} event
* @return {?}
*/
function (event) {
var clientY = event.clientY;
// to fix firefox undefined
var _a = event.srcElement
? event.srcElement.getBoundingClientRect()
: (( /** @type {?} */(event.target))).getBoundingClientRect(), top = _a.top, bottom = _a.bottom, height = _a.height;
/** @type {?} */
var des = Math.max(height * this.DRAG_SIDE_RANGE, this.DRAG_MIN_GAP);
if (clientY <= top + des) {
return -1;
}
else if (clientY >= bottom - des) {
return 1;
}
return 0;
};
/**
* drop
* 0: inner -1: pre 1: next
*/
/**
* drop
* 0: inner -1: pre 1: next
* @param {?} targetNode
* @param {?=} dragPos
* @return {?}
*/
NzTreeBaseService.prototype.dropAndApply = /**
* drop
* 0: inner -1: pre 1: next
* @param {?} targetNode
* @param {?=} dragPos
* @return {?}
*/
function (targetNode, dragPos) {
var _this = this;
if (dragPos === void 0) {
dragPos = -1;
}
if (!targetNode || dragPos > 1) {
return;
}
/** @type {?} */
var treeService = targetNode.treeService;
/** @type {?} */
var targetParent = targetNode.getParentNode();
/** @type {?} */
var isSelectedRootNode = this.selectedNode.getParentNode();
// remove the dragNode
if (isSelectedRootNode) {
isSelectedRootNode.children = isSelectedRootNode.children.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== _this.selectedNode.key; }));
}
else {
this.rootNodes = this.rootNodes.filter(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key !== _this.selectedNode.key; }));
}
switch (dragPos) {
case 0:
targetNode.addChildren([this.selectedNode]);
this.resetNodeLevel(targetNode);
break;
case -1:
case 1:
/** @type {?} */
var tIndex = dragPos === 1 ? 1 : 0;
if (targetParent) {
targetParent.addChildren([this.selectedNode], targetParent.children.indexOf(targetNode) + tIndex);
/** @type {?} */
var parentNode = this.selectedNode.getParentNode();
if (parentNode) {
this.resetNodeLevel(parentNode);
}
}
else {
/** @type {?} */
var targetIndex = this.rootNodes.indexOf(targetNode) + tIndex;
// 根节点插入
this.rootNodes.splice(targetIndex, 0, this.selectedNode);
this.rootNodes[targetIndex].parentNode = null;
this.rootNodes[targetIndex].level = 0;
}
break;
}
// flush all nodes
this.rootNodes.forEach(( /**
* @param {?} child
* @return {?}
*/function (child) {
if (!child.treeService) {
child.service = treeService;
}
_this.refreshDragNode(child);
}));
};
/**
* emit Structure
* eventName
* node
* event: MouseEvent / DragEvent
* dragNode
*/
/**
* emit Structure
* eventName
* node
* event: MouseEvent / DragEvent
* dragNode
* @param {?} eventName
* @param {?} node
* @param {?} event
* @return {?}
*/
NzTreeBaseService.prototype.formatEvent = /**
* emit Structure
* eventName
* node
* event: MouseEvent / DragEvent
* dragNode
* @param {?} eventName
* @param {?} node
* @param {?} event
* @return {?}
*/
function (eventName, node, event) {
/** @type {?} */
var emitStructure = {
eventName: eventName,
node: node,
event: event
};
switch (eventName) {
case 'dragstart':
case 'dragenter':
case 'dragover':
case 'dragleave':
case 'drop':
case 'dragend':
Object.assign(emitStructure, { dragNode: this.getSelectedNode() });
break;
case 'click':
case 'dblclick':
Object.assign(emitStructure, { selectedKeys: this.selectedNodeList });
Object.assign(emitStructure, { nodes: this.selectedNodeList });
Object.assign(emitStructure, { keys: this.selectedNodeList.map(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key; })) });
break;
case 'check':
/** @type {?} */
var checkedNodeList = this.getCheckedNodeList();
Object.assign(emitStructure, { checkedKeys: checkedNodeList });
Object.assign(emitStructure, { nodes: checkedNodeList });
Object.assign(emitStructure, { keys: checkedNodeList.map(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key; })) });
break;
case 'search':
Object.assign(emitStructure, { matchedKeys: this.getMatchedNodeList() });
Object.assign(emitStructure, { nodes: this.getMatchedNodeList() });
Object.assign(emitStructure, { keys: this.getMatchedNodeList().map(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key; })) });
break;
case 'expand':
Object.assign(emitStructure, { nodes: this.expandedNodeList });
Object.assign(emitStructure, { keys: this.expandedNodeList.map(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key; })) });
break;
}
return emitStructure;
};
/**
* @return {?}
*/
NzTreeBaseService.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.triggerEventChange$.complete();
};
NzTreeBaseService.decorators = [
{ type: i0.Injectable }
];
return NzTreeBaseService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var NzTreeHigherOrderServiceToken = new i0.InjectionToken('NzTreeHigherOrder');
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzTreeBase = /** @class */ (function () {
function NzTreeBase(nzTreeService) {
this.nzTreeService = nzTreeService;
}
/**
* Coerces a value({@link any[]}) to a TreeNodes({@link NzTreeNode[]})
*/
/**
* Coerces a value({\@link any[]}) to a TreeNodes({\@link NzTreeNode[]})
* @param {?} value
* @return {?}
*/
NzTreeBase.prototype.coerceTreeNodes = /**
* Coerces a value({\@link any[]}) to a TreeNodes({\@link NzTreeNode[]})
* @param {?} value
* @return {?}
*/
function (
// tslint:disable-next-line:no-any
value) {
var _this = this;
/** @type {?} */
var nodes = [];
if (!this.nzTreeService.isArrayOfNzTreeNode(value)) {
// has not been new NzTreeNode
nodes = value.map(( /**
* @param {?} item
* @return {?}
*/function (item) { return new NzTreeNode(item, null, _this.nzTreeService); }));
}
else {
nodes = value.map(( /**
* @param {?} item
* @return {?}
*/function (item) {
item.service = _this.nzTreeService;
return item;
}));
}
return nodes;
};
/**
* Get all nodes({@link NzTreeNode})
*/
/**
* Get all nodes({\@link NzTreeNode})
* @return {?}
*/
NzTreeBase.prototype.getTreeNodes = /**
* Get all nodes({\@link NzTreeNode})
* @return {?}
*/
function () {
return this.nzTreeService.rootNodes;
};
/**
* Get {@link NzTreeNode} with key
*/
/**
* Get {\@link NzTreeNode} with key
* @param {?} key
* @return {?}
*/
NzTreeBase.prototype.getTreeNodeByKey = /**
* Get {\@link NzTreeNode} with key
* @param {?} key
* @return {?}
*/
function (key) {
// flat tree nodes
/** @type {?} */
var nodes = [];
/** @type {?} */
var getNode = ( /**
* @param {?} node
* @return {?}
*/function (node) {
nodes.push(node);
node.getChildren().forEach(( /**
* @param {?} n
* @return {?}
*/function (n) {
getNode(n);
}));
});
this.getTreeNodes().forEach(( /**
* @param {?} n
* @return {?}
*/function (n) {
getNode(n);
}));
return nodes.find(( /**
* @param {?} n
* @return {?}
*/function (n) { return n.key === key; })) || null;
};
/**
* Get checked nodes(merged)
*/
/**
* Get checked nodes(merged)
* @return {?}
*/
NzTreeBase.prototype.getCheckedNodeList = /**
* Get checked nodes(merged)
* @return {?}
*/
function () {
return this.nzTreeService.getCheckedNodeList();
};
/**
* Get selected nodes
*/
/**
* Get selected nodes
* @return {?}
*/
NzTreeBase.prototype.getSelectedNodeList = /**
* Get selected nodes
* @return {?}
*/
function () {
return this.nzTreeService.getSelectedNodeList();
};
/**
* Get half checked nodes
*/
/**
* Get half checked nodes
* @return {?}
*/
NzTreeBase.prototype.getHalfCheckedNodeList = /**
* Get half checked nodes
* @return {?}
*/
function () {
return this.nzTreeService.getHalfCheckedNodeList();
};
/**
* Get expanded nodes
*/
/**
* Get expanded nodes
* @return {?}
*/
NzTreeBase.prototype.getExpandedNodeList = /**
* Get expanded nodes
* @return {?}
*/
function () {
return this.nzTreeService.getExpandedNodeList();
};
/**
* Get matched nodes(if nzSearchValue is not null)
*/
/**
* Get matched nodes(if nzSearchValue is not null)
* @return {?}
*/
NzTreeBase.prototype.getMatchedNodeList = /**
* Get matched nodes(if nzSearchValue is not null)
* @return {?}
*/
function () {
return this.nzTreeService.getMatchedNodeList();
};
return NzTreeBase;
}());
/**
* @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
*/
var NzWaveRenderer = /** @class */ (function () {
function NzWaveRenderer(triggerElement, ngZone, insertExtraNode) {
var _this = this;
this.triggerElement = triggerElement;
this.ngZone = ngZone;
this.insertExtraNode = insertExtraNode;
this.waveTransitionDuration = 400;
this.lastTime = 0;
this.onClick = ( /**
* @param {?} event
* @return {?}
*/function (event) {
if (!_this.triggerElement ||
!_this.triggerElement.getAttribute ||
_this.triggerElement.getAttribute('disabled') ||
(( /** @type {?} */(event.target))).tagName === 'INPUT' ||
_this.triggerElement.className.indexOf('disabled') >= 0) {
return;
}
_this.fadeOutWave();
});
/** @type {?} */
var platform$$1 = new platform.Platform();
if (platform$$1.isBrowser) {
this.bindTriggerEvent();
}
}
Object.defineProperty(NzWaveRenderer.prototype, "waveAttributeName", {
get: /**
* @return {?}
*/ function () {
return this.insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';
},
enumerable: true,
configurable: true
});
/**
* @return {?}
*/
NzWaveRenderer.prototype.bindTriggerEvent = /**
* @return {?}
*/
function () {
var _this = this;
this.ngZone.runOutsideAngular(( /**
* @return {?}
*/function () {
if (_this.triggerElement) {
_this.triggerElement.addEventListener('click', _this.onClick, true);
}
}));
};
/**
* @return {?}
*/
NzWaveRenderer.prototype.removeTriggerEvent = /**
* @return {?}
*/
function () {
if (this.triggerElement) {
this.triggerElement.removeEventListener('click', this.onClick, true);
}
};
/**
* @return {?}
*/
NzWaveRenderer.prototype.removeStyleAndExtraNode = /**
* @return {?}
*/
function () {
if (this.styleForPseudo && document.body.contains(this.styleForPseudo)) {
document.body.removeChild(this.styleForPseudo);
this.styleForPseudo = null;
}
if (this.insertExtraNode && this.triggerElement.contains(this.extraNode)) {
this.triggerElement.removeChild(( /** @type {?} */(this.extraNode)));
}
};
/**
* @return {?}
*/
NzWaveRenderer.prototype.destroy = /**
* @return {?}
*/
function () {
this.removeTriggerEvent();
this.removeStyleAndExtraNode();
};
/**
* @private
* @return {?}
*/
NzWaveRenderer.prototype.fadeOutWave = /**
* @private
* @return {?}
*/
function () {
var _this = this;
/** @type {?} */
var node = this.triggerElement;
/** @type {?} */
var waveColor = this.getWaveColor(node);
node.setAttribute(this.waveAttributeName, 'true');
if (Date.now() < this.lastTime + this.waveTransitionDuration) {
return;
}
if (this.isValidColor(waveColor)) {
if (!this.styleForPseudo) {
this.styleForPseudo = document.createElement('style');
}
this.styleForPseudo.innerHTML = "[ant-click-animating-without-extra-node]:after { border-color: " + waveColor + "; }";
document.body.appendChild(this.styleForPseudo);
}
if (this.insertExtraNode) {
if (!this.extraNode) {
this.extraNode = document.createElement('div');
}
this.extraNode.className = 'ant-click-animating-node';
node.appendChild(this.extraNode);
}
this.lastTime = Date.now();
this.runTimeoutOutsideZone(( /**
* @return {?}
*/function () {
node.removeAttribute(_this.waveAttributeName);
_this.removeStyleAndExtraNode();
}), this.waveTransitionDuration);
};
/**
* @private
* @param {?} color
* @return {?}
*/
NzWaveRenderer.prototype.isValidColor = /**
* @private
* @param {?} color
* @return {?}
*/
function (color) {
return (!!color &&
color !== '#ffffff' &&
color !== 'rgb(255, 255, 255)' &&
this.isNotGrey(color) &&
!/rgba\(\d*, \d*, \d*, 0\)/.test(color) &&
color !== 'transparent');
};
/**
* @private
* @param {?} color
* @return {?}
*/
NzWaveRenderer.prototype.isNotGrey = /**
* @private
* @param {?} color
* @return {?}
*/
function (color) {
/** @type {?} */
var match = color.match(/rgba?\((\d*), (\d*), (\d*)(, [\.\d]*)?\)/);
if (match && match[1] && match[2] && match[3]) {
return !(match[1] === match[2] && match[2] === match[3]);
}
return true;
};
/**
* @private
* @param {?} node
* @return {?}
*/
NzWaveRenderer.prototype.getWaveColor = /**
* @private
* @param {?} node
* @return {?}
*/
function (node) {
/** @type {?} */
var nodeStyle = getComputedStyle(node);
return (nodeStyle.getPropertyValue('border-top-color') || // Firefox Compatible
nodeStyle.getPropertyValue('border-color') ||
nodeStyle.getPropertyValue('background-color'));
};
/**
* @private
* @param {?} fn
* @param {?} delay
* @return {?}
*/
NzWaveRenderer.prototype.runTimeoutOutsideZone = /**
* @private
* @param {?} fn
* @param {?} delay
* @return {?}
*/
function (fn, delay) {
this.ngZone.runOutsideAngular(( /**
* @return {?}
*/function () { return setTimeout(fn, delay); }));
};
return NzWaveRenderer;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var NZ_WAVE_GLOBAL_DEFAULT_CONFIG = {
disabled: false
};
/** @type {?} */
var NZ_WAVE_GLOBAL_CONFIG = new i0.InjectionToken('nz-wave-global-options', {
providedIn: 'root',
factory: NZ_WAVE_GLOBAL_CONFIG_FACTORY
});
/**
* @return {?}
*/
function NZ_WAVE_GLOBAL_CONFIG_FACTORY() {
return NZ_WAVE_GLOBAL_DEFAULT_CONFIG;
}
var NzWaveDirective = /** @class */ (function () {
function NzWaveDirective(ngZone, elementRef, config, animationType) {
this.ngZone = ngZone;
this.elementRef = elementRef;
this.animationType = animationType;
this.nzWaveExtraNode = false;
this.waveDisabled = false;
if (config && typeof config.disabled === 'boolean') {
this.waveDisabled = config.disabled;
}
if (this.animationType === 'NoopAnimations') {
this.waveDisabled = true;
}
}
/**
* @return {?}
*/
NzWaveDirective.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
if (this.waveRenderer) {
this.waveRenderer.destroy();
}
};
/**
* @return {?}
*/
NzWaveDirective.prototype.ngOnInit = /**
* @return {?}
*/
function () {
this.renderWaveIfEnabled();
};
/**
* @return {?}
*/
NzWaveDirective.prototype.renderWaveIfEnabled = /**
* @return {?}
*/
function () {
if (!this.waveDisabled && this.elementRef.nativeElement) {
this.waveRenderer = new NzWaveRenderer(this.elementRef.nativeElement, this.ngZone, this.nzWaveExtraNode);
}
};
NzWaveDirective.decorators = [
{ type: i0.Directive, args: [{
selector: '[nz-wave]',
exportAs: 'nzWave'
},] }
];
/** @nocollapse */
NzWaveDirective.ctorParameters = function () {
return [
{ type: i0.NgZone },
{ type: i0.ElementRef },
{ type: undefined, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [NZ_WAVE_GLOBAL_CONFIG,] }] },
{ type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [animations$1.ANIMATION_MODULE_TYPE,] }] }
];
};
NzWaveDirective.propDecorators = {
nzWaveExtraNode: [{ type: i0.Input }]
};
return NzWaveDirective;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var NzWaveModule = /** @class */ (function () {
function NzWaveModule() {
}
NzWaveModule.decorators = [
{ type: i0.NgModule, args: [{
imports: [platform.PlatformModule],
exports: [NzWaveDirective],
declarations: [NzWaveDirective]
},] }
];
return NzWaveModule;
}());
/**
* @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
*/
var NzMenuBaseService = /** @class */ (function () {
function NzMenuBaseService() {
this.menuItemClick$ = new rxjs.Subject(); // tslint:disable-line no-any
// tslint:disable-line no-any
this.theme$ = new rxjs.Subject();
this.mode$ = new rxjs.BehaviorSubject('vertical');
this.inlineIndent$ = new rxjs.BehaviorSubject(24);
this.check$ = rxjs.merge(this.theme$, this.mode$, this.inlineIndent$);
this.theme = 'light';
this.mode = 'vertical';
this.inlineIndent = 24;
this.menuOpen$ = new rxjs.BehaviorSubject(false);
}
// tslint:disable-next-line no-any
// tslint:disable-next-line no-any
/**
* @param {?} menu
* @return {?}
*/
NzMenuBaseService.prototype.onMenuItemClick =
// tslint:disable-next-line no-any
/**
* @param {?} menu
* @return {?}
*/
function (menu) {
this.menuItemClick$.next(menu);
};
/**
* @param {?} mode
* @return {?}
*/
NzMenuBaseService.prototype.setMode = /**
* @param {?} mode
* @return {?}
*/
function (mode) {
this.mode = mode;
this.mode$.next(mode);
};
/**
* @param {?} theme
* @return {?}
*/
NzMenuBaseService.prototype.setTheme = /**
* @param {?} theme
* @return {?}
*/
function (theme) {
this.theme = theme;
this.theme$.next(theme);
};
/**
* @param {?} indent
* @return {?}
*/
NzMenuBaseService.prototype.setInlineIndent = /**
* @param {?} indent
* @return {?}
*/
function (indent) {
this.inlineIndent = indent;
this.inlineIndent$.next(indent);
};
NzMenuBaseService.decorators = [
{ type: i0.Injectable }
];
return NzMenuBaseService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
/** @type {?} */
var NzDropdownHigherOrderServiceToken = new i0.InjectionToken('NzTreeHigherOrder');
/**
* @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
*/
/** @type {?} */
var NZ_LOGGER_STATE = new i0.InjectionToken('nz-logger-state');
// Whether print the log
var LoggerService = /** @class */ (function () {
function LoggerService(_loggerState) {
this._loggerState = _loggerState;
}
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
LoggerService.prototype.log =
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._loggerState) {
console.log.apply(console, __spread(args));
}
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
LoggerService.prototype.warn =
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._loggerState) {
console.warn.apply(console, __spread(args));
}
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
LoggerService.prototype.error =
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._loggerState) {
console.error.apply(console, __spread(args));
}
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
LoggerService.prototype.info =
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._loggerState) {
console.log.apply(console, __spread(args));
}
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
LoggerService.prototype.debug =
// tslint:disable-next-line:no-any
/**
* @param {...?} args
* @return {?}
*/
function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (this._loggerState) {
console.log.apply(console, __spread(['[NG-ZORRO-DEBUG]'], args));
}
};
LoggerService.decorators = [
{ type: i0.Injectable }
];
/** @nocollapse */
LoggerService.ctorParameters = function () {
return [
{ type: Boolean, decorators: [{ type: i0.Inject, args: [NZ_LOGGER_STATE,] }] }
];
};
return LoggerService;
}());
/**
* @param {?} exist
* @param {?} loggerState
* @return {?}
*/
function LOGGER_SERVICE_PROVIDER_FACTORY(exist, loggerState) {
return exist || new LoggerService(loggerState);
}
/** @type {?} */
var LOGGER_SERVICE_PROVIDER = {
provide: LoggerService,
useFactory: LOGGER_SERVICE_PROVIDER_FACTORY,
deps: [[new i0.Optional(), new i0.SkipSelf(), LoggerService], NZ_LOGGER_STATE]
};
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
var LoggerModule = /** @class */ (function () {
function LoggerModule() {
}
LoggerModule.decorators = [
{ type: i0.NgModule, args: [{
providers: [{ provide: NZ_LOGGER_STATE, useValue: false }, LOGGER_SERVICE_PROVIDER]
},] }
];
return LoggerModule;
}());
/**
* @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
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
exports.NzAddOnModule = NzAddOnModule;
exports.NzClassListAddDirective = NzClassListAddDirective;
exports.NzStringTemplateOutletDirective = NzStringTemplateOutletDirective;
exports.AnimationDuration = AnimationDuration;
exports.AnimationCurves = AnimationCurves;
exports.collapseMotion = collapseMotion;
exports.fadeMotion = fadeMotion;
exports.helpMotion = helpMotion;
exports.moveUpMotion = moveUpMotion;
exports.notificationMotion = notificationMotion;
exports.slideMotion = slideMotion;
exports.slideAlertMotion = slideAlertMotion;
exports.zoomMotion = zoomMotion;
exports.zoomBigMotion = zoomBigMotion;
exports.zoomBadgeMotion = zoomBadgeMotion;
exports.NzNoAnimationModule = NzNoAnimationModule;
exports.NzNoAnimationDirective = NzNoAnimationDirective;
exports.NzConnectedOverlayDirective = NzConnectedOverlayDirective;
exports.NzOverlayModule = NzOverlayModule;
exports.getPlacementName = getPlacementName;
exports.POSITION_MAP = POSITION_MAP;
exports.DEFAULT_TOOLTIP_POSITIONS = DEFAULT_TOOLTIP_POSITIONS;
exports.DEFAULT_DROPDOWN_POSITIONS = DEFAULT_DROPDOWN_POSITIONS;
exports.DEFAULT_SUBMENU_POSITIONS = DEFAULT_SUBMENU_POSITIONS;
exports.DEFAULT_CASCADER_POSITIONS = DEFAULT_CASCADER_POSITIONS;
exports.DEFAULT_MENTION_POSITIONS = DEFAULT_MENTION_POSITIONS;
exports.cancelRequestAnimationFrame = cancelRequestAnimationFrame;
exports.reqAnimFrame = reqAnimFrame;
exports.SCROLL_SERVICE_PROVIDER_FACTORY = SCROLL_SERVICE_PROVIDER_FACTORY;
exports.NzScrollService = NzScrollService;
exports.SCROLL_SERVICE_PROVIDER = SCROLL_SERVICE_PROVIDER;
exports.NzMeasureScrollbarService = NzMeasureScrollbarService;
exports.NzUpdateHostClassService = NzUpdateHostClassService;
exports.dispatchEvent = dispatchEvent;
exports.dispatchFakeEvent = dispatchFakeEvent;
exports.dispatchKeyboardEvent = dispatchKeyboardEvent;
exports.dispatchMouseEvent = dispatchMouseEvent;
exports.dispatchTouchEvent = dispatchTouchEvent;
exports.createMouseEvent = createMouseEvent;
exports.createTouchEvent = createTouchEvent;
exports.createKeyboardEvent = createKeyboardEvent;
exports.createFakeEvent = createFakeEvent;
exports.typeInElement = typeInElement;
exports.wrappedErrorMessage = wrappedErrorMessage;
exports.FakeViewportRuler = FakeViewportRuler;
exports.MockNgZone = MockNgZone;
exports.NzTreeNode = NzTreeNode;
exports.NzTreeBaseService = NzTreeBaseService;
exports.NzTreeHigherOrderServiceToken = NzTreeHigherOrderServiceToken;
exports.NzTreeBase = NzTreeBase;
exports.toArray = toArray;
exports.arraysEqual = arraysEqual;
exports.shallowCopyArray = shallowCopyArray;
exports.isNotNil = isNotNil;
exports.isNil = isNil;
exports.shallowEqual = shallowEqual;
exports.isInteger = isInteger;
exports.isEmpty = isEmpty;
exports.filterNotEmptyNode = filterNotEmptyNode;
exports.isNonEmptyString = isNonEmptyString;
exports.isTemplateRef = isTemplateRef;
exports.isComponent = isComponent;
exports.toBoolean = toBoolean;
exports.toNumber = toNumber;
exports.toCssPixel = toCssPixel;
exports.valueFunctionProp = valueFunctionProp;
exports.InputBoolean = InputBoolean;
exports.InputCssPixel = InputCssPixel;
exports.InputNumber = InputNumber;
exports.silentEvent = silentEvent;
exports.getElementOffset = getElementOffset;
exports.findFirstNotEmptyNode = findFirstNotEmptyNode;
exports.findLastNotEmptyNode = findLastNotEmptyNode;
exports.reverseChildNodes = reverseChildNodes;
exports.isTouchEvent = isTouchEvent;
exports.getRegExp = getRegExp;
exports.getMentions = getMentions;
exports.padStart = padStart;
exports.padEnd = padEnd;
exports.getRepeatedElement = getRepeatedElement;
exports.isPromise = isPromise;
exports.getPercent = getPercent;
exports.getPrecision = getPrecision;
exports.ensureNumberInRange = ensureNumberInRange;
exports.scrollIntoView = scrollIntoView;
exports.getCaretCoordinates = getCaretCoordinates;
exports.createDebugEle = createDebugEle;
exports.properties = properties;
exports.throttleByAnimationFrameDecorator = throttleByAnimationFrameDecorator;
exports.timeUnits = timeUnits;
exports.NzWaveRenderer = NzWaveRenderer;
exports.NZ_WAVE_GLOBAL_CONFIG_FACTORY = NZ_WAVE_GLOBAL_CONFIG_FACTORY;
exports.NZ_WAVE_GLOBAL_DEFAULT_CONFIG = NZ_WAVE_GLOBAL_DEFAULT_CONFIG;
exports.NZ_WAVE_GLOBAL_CONFIG = NZ_WAVE_GLOBAL_CONFIG;
exports.NzWaveDirective = NzWaveDirective;
exports.NzWaveModule = NzWaveModule;
exports.NzMenuBaseService = NzMenuBaseService;
exports.NzDropdownHigherOrderServiceToken = NzDropdownHigherOrderServiceToken;
exports.LoggerModule = LoggerModule;
exports.LoggerService = LoggerService;
exports.NZ_LOGGER_STATE = NZ_LOGGER_STATE;
exports.LOGGER_SERVICE_PROVIDER = LOGGER_SERVICE_PROVIDER;
exports.LOGGER_SERVICE_PROVIDER_FACTORY = LOGGER_SERVICE_PROVIDER_FACTORY;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=ng-zorro-antd-core.umd.js.map