ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
191 lines • 16.6 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, NgZone, Output, QueryList, TemplateRef, ViewChild, ViewChildren, ViewEncapsulation } from '@angular/core';
import { fromEvent, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { NzOptionLiComponent } from './nz-option-li.component';
import { NzSelectService } from './nz-select.service';
var NzOptionContainerComponent = /** @class */ (function () {
function NzOptionContainerComponent(nzSelectService, cdr, ngZone) {
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.ngZone = ngZone;
this.destroy$ = new Subject();
this.nzScrollToBottom = new EventEmitter();
}
/**
* @param {?} option
* @return {?}
*/
NzOptionContainerComponent.prototype.scrollIntoViewIfNeeded = /**
* @param {?} option
* @return {?}
*/
function (option) {
var _this = this;
// delay after open
setTimeout((/**
* @return {?}
*/
function () {
if (_this.listOfNzOptionLiComponent && _this.listOfNzOptionLiComponent.length && option) {
/** @type {?} */
var targetOption = _this.listOfNzOptionLiComponent.find((/**
* @param {?} o
* @return {?}
*/
function (o) {
return _this.nzSelectService.compareWith(o.nzOption.nzValue, option.nzValue);
}));
/* tslint:disable:no-any */
if (targetOption && targetOption.el && ((/** @type {?} */ (targetOption.el))).scrollIntoViewIfNeeded) {
((/** @type {?} */ (targetOption.el))).scrollIntoViewIfNeeded(false);
}
/* tslint:enable:no-any */
}
}));
};
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
NzOptionContainerComponent.prototype.trackLabel = /**
* @param {?} _index
* @param {?} option
* @return {?}
*/
function (_index, option) {
return option.nzLabel;
};
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
NzOptionContainerComponent.prototype.trackValue =
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
function (_index, option) {
return option.nzValue;
};
/**
* @return {?}
*/
NzOptionContainerComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this.nzSelectService.activatedOption$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} option
* @return {?}
*/
function (option) {
_this.scrollIntoViewIfNeeded((/** @type {?} */ (option)));
}));
this.nzSelectService.check$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
function () {
_this.cdr.markForCheck();
}));
this.ngZone.runOutsideAngular((/**
* @return {?}
*/
function () {
/** @type {?} */
var ul = _this.dropdownUl.nativeElement;
fromEvent(ul, 'scroll')
.pipe(takeUntil(_this.destroy$))
.subscribe((/**
* @param {?} e
* @return {?}
*/
function (e) {
e.preventDefault();
e.stopPropagation();
if (ul && ul.scrollHeight < ul.clientHeight + ul.scrollTop + 10) {
_this.ngZone.run((/**
* @return {?}
*/
function () {
_this.nzScrollToBottom.emit();
}));
}
}));
}));
};
/**
* @return {?}
*/
NzOptionContainerComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroy$.next();
this.destroy$.complete();
};
NzOptionContainerComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-option-container]',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
template: "<ul #dropdownUl\n class=\"ant-select-dropdown-menu ant-select-dropdown-menu-root ant-select-dropdown-menu-vertical\"\n role=\"menu\"\n tabindex=\"0\">\n <li *ngIf=\"nzSelectService.isShowNotFound\"\n nz-select-unselectable\n class=\"ant-select-dropdown-menu-item ant-select-dropdown-menu-item-disabled\">\n <nz-embed-empty [nzComponentName]=\"'select'\" [specificContent]=\"nzNotFoundContent\"></nz-embed-empty>\n </li>\n <li nz-option-li\n *ngIf=\"nzSelectService.addedTagOption\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"nzSelectService.addedTagOption\">\n </li>\n <li nz-option-li\n *ngFor=\"let option of nzSelectService.listOfNzOptionComponent | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption : nzSelectService.serverSearch; trackBy: trackValue\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n <li class=\"ant-select-dropdown-menu-item-group\"\n *ngFor=\"let group of nzSelectService.listOfNzOptionGroupComponent | nzFilterGroupOption : nzSelectService.searchValue : nzSelectService.filterOption :nzSelectService.serverSearch; trackBy: trackLabel\">\n <div class=\"ant-select-dropdown-menu-item-group-title\"\n [attr.title]=\"group.isLabelString ? group.nzLabel : ''\">\n <ng-container *nzStringTemplateOutlet=\"group.nzLabel\"> {{group.nzLabel}} </ng-container>\n </div>\n <ul class=\"ant-select-dropdown-menu-item-group-list\">\n <li nz-option-li\n *ngFor=\"let option of group.listOfNzOptionComponent | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption :nzSelectService.serverSearch; trackBy: trackValue\"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n </ul>\n </li>\n <li nz-option-li\n *ngFor=\"let option of nzSelectService.listOfTagOption | nzFilterOption : nzSelectService.searchValue : nzSelectService.filterOption : nzSelectService.serverSearch; trackBy: trackValue \"\n [nzMenuItemSelectedIcon]=\"nzMenuItemSelectedIcon\"\n [nzOption]=\"option\">\n </li>\n</ul>\n"
}] }
];
/** @nocollapse */
NzOptionContainerComponent.ctorParameters = function () { return [
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: NgZone }
]; };
NzOptionContainerComponent.propDecorators = {
listOfNzOptionLiComponent: [{ type: ViewChildren, args: [NzOptionLiComponent,] }],
dropdownUl: [{ type: ViewChild, args: ['dropdownUl',] }],
nzNotFoundContent: [{ type: Input }],
nzMenuItemSelectedIcon: [{ type: Input }],
nzScrollToBottom: [{ type: Output }]
};
return NzOptionContainerComponent;
}());
export { NzOptionContainerComponent };
if (false) {
/**
* @type {?}
* @private
*/
NzOptionContainerComponent.prototype.destroy$;
/** @type {?} */
NzOptionContainerComponent.prototype.listOfNzOptionLiComponent;
/** @type {?} */
NzOptionContainerComponent.prototype.dropdownUl;
/** @type {?} */
NzOptionContainerComponent.prototype.nzNotFoundContent;
/** @type {?} */
NzOptionContainerComponent.prototype.nzMenuItemSelectedIcon;
/** @type {?} */
NzOptionContainerComponent.prototype.nzScrollToBottom;
/** @type {?} */
NzOptionContainerComponent.prototype.nzSelectService;
/**
* @type {?}
* @private
*/
NzOptionContainerComponent.prototype.cdr;
/**
* @type {?}
* @private
*/
NzOptionContainerComponent.prototype.ngZone;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotb3B0aW9uLWNvbnRhaW5lci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsic2VsZWN0L256LW9wdGlvbi1jb250YWluZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLGlCQUFpQixFQUNqQixTQUFTLEVBQ1QsVUFBVSxFQUNWLFlBQVksRUFDWixLQUFLLEVBQ0wsTUFBTSxFQUdOLE1BQU0sRUFDTixTQUFTLEVBQ1QsV0FBVyxFQUNYLFNBQVMsRUFDVCxZQUFZLEVBQ1osaUJBQWlCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBRSxTQUFTLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzFDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUUzQyxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUUvRCxPQUFPLEVB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