ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
269 lines • 24.1 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Host, Input, Optional, Renderer2, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { zoomMotion } from '../core/animation/zoom';
import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive';
import { NzSelectService } from './nz-select.service';
var NzSelectTopControlComponent = /** @class */ (function () {
function NzSelectTopControlComponent(renderer, nzSelectService, cdr, noAnimation) {
this.renderer = renderer;
this.nzSelectService = nzSelectService;
this.cdr = cdr;
this.noAnimation = noAnimation;
this.isComposing = false;
this.destroy$ = new Subject();
this.nzShowSearch = false;
this.nzOpen = false;
this.nzAllowClear = false;
this.nzShowArrow = true;
this.nzLoading = false;
this.nzTokenSeparators = [];
}
/**
* @param {?} e
* @return {?}
*/
NzSelectTopControlComponent.prototype.onClearSelection = /**
* @param {?} e
* @return {?}
*/
function (e) {
e.stopPropagation();
this.nzSelectService.updateListOfSelectedValue([], true);
};
/**
* @param {?} value
* @return {?}
*/
NzSelectTopControlComponent.prototype.setInputValue = /**
* @param {?} value
* @return {?}
*/
function (value) {
if (this.inputElement) {
this.inputElement.nativeElement.value = value;
}
this.inputValue = value;
this.updateWidth();
this.nzSelectService.updateSearchValue(value);
this.nzSelectService.tokenSeparate(this.inputValue, this.nzTokenSeparators);
};
Object.defineProperty(NzSelectTopControlComponent.prototype, "placeHolderDisplay", {
get: /**
* @return {?}
*/
function () {
return this.inputValue || this.isComposing || this.nzSelectService.listOfSelectedValue.length ? 'none' : 'block';
},
enumerable: true,
configurable: true
});
Object.defineProperty(NzSelectTopControlComponent.prototype, "selectedValueStyle", {
get: /**
* @return {?}
*/
function () {
/** @type {?} */
var showSelectedValue = false;
/** @type {?} */
var opacity = 1;
if (!this.nzShowSearch) {
showSelectedValue = true;
}
else {
if (this.nzOpen) {
showSelectedValue = !(this.inputValue || this.isComposing);
if (showSelectedValue) {
opacity = 0.4;
}
}
else {
showSelectedValue = true;
}
}
return {
display: showSelectedValue ? 'block' : 'none',
opacity: "" + opacity
};
},
enumerable: true,
configurable: true
});
// tslint:disable-next-line:no-any
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
NzSelectTopControlComponent.prototype.trackValue =
// tslint:disable-next-line:no-any
/**
* @param {?} _index
* @param {?} option
* @return {?}
*/
function (_index, option) {
return option.nzValue;
};
/**
* @return {?}
*/
NzSelectTopControlComponent.prototype.updateWidth = /**
* @return {?}
*/
function () {
if (this.nzSelectService.isMultipleOrTags && this.inputElement) {
if (this.inputValue || this.isComposing) {
this.renderer.setStyle(this.inputElement.nativeElement, 'width', this.inputElement.nativeElement.scrollWidth + "px");
}
else {
this.renderer.removeStyle(this.inputElement.nativeElement, 'width');
}
}
};
/**
* @param {?} option
* @param {?} e
* @return {?}
*/
NzSelectTopControlComponent.prototype.removeSelectedValue = /**
* @param {?} option
* @param {?} e
* @return {?}
*/
function (option, e) {
this.nzSelectService.removeValueFormSelected(option);
e.stopPropagation();
};
/**
* @return {?}
*/
NzSelectTopControlComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
var _this = this;
this.nzSelectService.open$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @param {?} open
* @return {?}
*/
function (open) {
if (_this.inputElement && open) {
_this.inputElement.nativeElement.focus();
}
}));
this.nzSelectService.clearInput$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
function () {
_this.setInputValue('');
}));
this.nzSelectService.check$.pipe(takeUntil(this.destroy$)).subscribe((/**
* @return {?}
*/
function () {
_this.cdr.markForCheck();
}));
};
/**
* @return {?}
*/
NzSelectTopControlComponent.prototype.ngOnDestroy = /**
* @return {?}
*/
function () {
this.destroy$.next();
this.destroy$.complete();
};
NzSelectTopControlComponent.decorators = [
{ type: Component, args: [{
selector: '[nz-select-top-control]',
preserveWhitespaces: false,
animations: [zoomMotion],
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
template: "<ng-template #inputTemplate>\n <input #inputElement\n autocomplete=\"something-new\"\n class=\"ant-select-search__field\"\n (compositionstart)=\"isComposing = true\"\n (compositionend)=\"isComposing = false\"\n (input)=\"updateWidth()\"\n [ngModel]=\"inputValue\"\n (ngModelChange)=\"setInputValue($event)\"\n [disabled]=\"nzSelectService.disabled\">\n</ng-template>\n<div class=\"ant-select-selection__rendered\">\n <div *ngIf=\"nzPlaceHolder\"\n nz-select-unselectable\n [style.display]=\"placeHolderDisplay\"\n class=\"ant-select-selection__placeholder\">{{ nzPlaceHolder }}</div>\n <!--single mode-->\n <ng-container *ngIf=\"nzSelectService.isSingleMode\">\n <!--selected label-->\n <div *ngIf=\"nzSelectService.listOfCachedSelectedOption.length && nzSelectService.listOfSelectedValue.length\"\n class=\"ant-select-selection-selected-value\"\n [attr.title]=\"nzSelectService.listOfCachedSelectedOption[0]?.nzLabel\"\n [ngStyle]=\"selectedValueStyle\">\n {{ nzSelectService.listOfCachedSelectedOption[0]?.nzLabel }}\n </div>\n <!--show search-->\n <div *ngIf=\"nzShowSearch\"\n class=\"ant-select-search ant-select-search--inline\">\n <div class=\"ant-select-search__field__wrap\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n <span class=\"ant-select-search__field__mirror\">{{inputValue}} </span>\n </div>\n </div>\n </ng-container>\n <!--multiple or tags mode-->\n <ul *ngIf=\"nzSelectService.isMultipleOrTags\">\n <ng-container *ngFor=\"let option of nzSelectService.listOfCachedSelectedOption | slice: 0 : nzMaxTagCount;trackBy:trackValue;\">\n <li [@zoomMotion]\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n [attr.title]=\"option.nzLabel\"\n [class.ant-select-selection__choice__disabled]=\"option.nzDisabled\"\n class=\"ant-select-selection__choice\">\n <div class=\"ant-select-selection__choice__content\">{{ option.nzLabel }}</div>\n <span *ngIf=\"!option.nzDisabled\"\n class=\"ant-select-selection__choice__remove\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"removeSelectedValue(option, $event)\">\n <i nz-icon type=\"close\" class=\"ant-select-remove-icon\" *ngIf=\"!nzRemoveIcon; else nzRemoveIcon\"></i>\n </span>\n </li>\n </ng-container>\n <li *ngIf=\"nzSelectService.listOfCachedSelectedOption.length > nzMaxTagCount\"\n [@zoomMotion]\n [nzNoAnimation]=\"noAnimation?.nzNoAnimation\"\n class=\"ant-select-selection__choice\">\n <div class=\"ant-select-selection__choice__content\">\n <ng-container *ngIf=\"nzMaxTagPlaceholder\">\n <ng-template\n [ngTemplateOutlet]=\"nzMaxTagPlaceholder\"\n [ngTemplateOutletContext]=\"{ $implicit: nzSelectService.listOfSelectedValue | slice: nzMaxTagCount}\">\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"!nzMaxTagPlaceholder\">\n + {{ nzSelectService.listOfCachedSelectedOption.length - nzMaxTagCount }} ...\n </ng-container>\n </div>\n </li>\n <li class=\"ant-select-search ant-select-search--inline\">\n <ng-template [ngTemplateOutlet]=\"inputTemplate\"></ng-template>\n </li>\n </ul>\n</div>\n<span *ngIf=\"nzAllowClear && nzSelectService.listOfSelectedValue.length\"\n class=\"ant-select-selection__clear\"\n nz-select-unselectable\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"onClearSelection($event)\">\n <i nz-icon type=\"close-circle\" theme=\"fill\" *ngIf=\"!nzClearIcon; else nzClearIcon\" class=\"ant-select-close-icon\"></i>\n </span>\n<span class=\"ant-select-arrow\" nz-select-unselectable *ngIf=\"nzShowArrow\">\n <i nz-icon type=\"loading\" *ngIf=\"nzLoading; else defaultArrow\"></i>\n <ng-template #defaultArrow>\n <i nz-icon type=\"down\" class=\"ant-select-arrow-icon\" *ngIf=\"!nzSuffixIcon; else nzSuffixIcon\"></i>\n </ng-template>\n</span>"
}] }
];
/** @nocollapse */
NzSelectTopControlComponent.ctorParameters = function () { return [
{ type: Renderer2 },
{ type: NzSelectService },
{ type: ChangeDetectorRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
]; };
NzSelectTopControlComponent.propDecorators = {
inputElement: [{ type: ViewChild, args: ['inputElement',] }],
nzShowSearch: [{ type: Input }],
nzPlaceHolder: [{ type: Input }],
nzOpen: [{ type: Input }],
nzMaxTagCount: [{ type: Input }],
nzAllowClear: [{ type: Input }],
nzShowArrow: [{ type: Input }],
nzLoading: [{ type: Input }],
nzSuffixIcon: [{ type: Input }],
nzClearIcon: [{ type: Input }],
nzRemoveIcon: [{ type: Input }],
nzMaxTagPlaceholder: [{ type: Input }],
nzTokenSeparators: [{ type: Input }]
};
return NzSelectTopControlComponent;
}());
export { NzSelectTopControlComponent };
if (false) {
/** @type {?} */
NzSelectTopControlComponent.prototype.inputValue;
/** @type {?} */
NzSelectTopControlComponent.prototype.isComposing;
/**
* @type {?}
* @private
*/
NzSelectTopControlComponent.prototype.destroy$;
/** @type {?} */
NzSelectTopControlComponent.prototype.inputElement;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzShowSearch;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzPlaceHolder;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzOpen;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzMaxTagCount;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzAllowClear;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzShowArrow;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzLoading;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzSuffixIcon;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzClearIcon;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzRemoveIcon;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzMaxTagPlaceholder;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzTokenSeparators;
/**
* @type {?}
* @private
*/
NzSelectTopControlComponent.prototype.renderer;
/** @type {?} */
NzSelectTopControlComponent.prototype.nzSelectService;
/**
* @type {?}
* @private
*/
NzSelectTopControlComponent.prototype.cdr;
/** @type {?} */
NzSelectTopControlComponent.prototype.noAnimation;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotc2VsZWN0LXRvcC1jb250cm9sLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25nLXpvcnJvLWFudGQteWovIiwic291cmNlcyI6WyJzZWxlY3Qvbnotc2VsZWN0LXRvcC1jb250cm9sLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsU0FBUyxFQUNULFVBQVUsRUFDVixJQUFJLEVBQ0osS0FBSyxFQUdMLFFBQVEsRUFDUixTQUFTLEVBQ1QsV0FBVyxFQUNYLFNBQVMsRUFDVCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUMvQixPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDM0MsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3BELE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGdEQUFnRCxDQUFDO0FBRXhGLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUV0RDtJQTJGRSxxQ0FDVSxRQUFtQixFQUNwQixlQUFnQyxFQUMvQixHQUFzQixFQUNILFdBQW9DO1FBSHZELGFBQVEsR0FBUixRQUFRLENBQVc7UUFDcEIsb0JBQWUsR0FBZixlQUFlLENBQWlCO1FBQy9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