UNPKG

dbweb-common

Version:

用`yarn add dbweb-common`安装,不要忘记修改`angular.json`里的 `architect\build\options\assets`,加上

61 lines 6.88 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import { Component, EventEmitter, HostBinding, Output } from '@angular/core'; import { ServiceService } from '../service/service.service'; var LabelSelectorComponent = /** @class */ (function () { function LabelSelectorComponent(svr) { this.svr = svr; this.chipListShow = true; this.open = new EventEmitter(); this.hostClass = true; } /** * @return {?} */ LabelSelectorComponent.prototype.ngOnInit = /** * @return {?} */ function () { }; /** * @param {?} index * @return {?} */ LabelSelectorComponent.prototype.deleteLabel = /** * @param {?} index * @return {?} */ function (index) { this.svr.data.selectedLabels.splice(index, 1); this.svr.refreshData().subscribe(); }; LabelSelectorComponent.decorators = [ { type: Component, args: [{ selector: 'common-label-selector', template: "<mat-chip-list *ngIf=\"chipListShow\" class=\"\u6807\u7B7E\u82AF\u7247\">\r\n\t<mat-chip\r\n\t\t*ngFor=\"let selectedLabel of svr.data.selectedLabels.slice(0, 3); let index = index\"\r\n\t\t[matTooltip]=\"selectedLabel?.Name\"\r\n\t>\r\n\t\t<span class=\"\u6807\u7B7E\">{{ selectedLabel?.Name }}</span>\r\n\t\t<mat-icon class=\"\u5220\u9664\u6807\u7B7E\" (click)=\"deleteLabel(index)\" svgIcon=\"close\"> </mat-icon>\r\n\t</mat-chip>\r\n</mat-chip-list>\r\n<mat-icon\r\n\t*ngIf=\"svr.data.selectedLabels?.length > 3\"\r\n\t(click)=\"chipListShow = false\"\r\n\tsvgIcon=\"double_down\"\r\n\t[matMenuTriggerFor]=\"beforeMenu\"\r\n\tclass=\"\u5411\u4E0B\u53CC\u7BAD\u5934\"\r\n>\r\n</mat-icon>\r\n<mat-menu #beforeMenu=\"matMenu\" xPosition=\"before\" overlapTrigger=\"true\" (closed)=\"chipListShow = true\">\r\n\t<div class=\"\u6807\u7B7E\u83DC\u5355\">\r\n\t\t<mat-icon class=\"\u5411\u4E0A\u6807\u7B7E\u7BAD\u5934\" svgIcon=\"double_down\"></mat-icon>\r\n\t\t<mat-chip-list>\r\n\t\t\t<mat-chip\r\n\t\t\t\t*ngFor=\"let selectedLabel of svr.data.selectedLabels; let index\"\r\n\t\t\t\tmatTooltip=\"{{ selectedLabel.Name }}\"\r\n\t\t\t>\r\n\t\t\t\t<span class=\"\u9650\u5236\u6807\u7B7E\">{{ selectedLabel.Name }}</span>\r\n\t\t\t\t<mat-icon class=\"\u5220\u9664\u6807\u7B7E\" (click)=\"deleteLabel(index)\" svgIcon=\"close\"></mat-icon>\r\n\t\t\t</mat-chip>\r\n\t\t</mat-chip-list>\r\n\t</div>\r\n</mat-menu>\r\n<button mat-flat-button class=\"\u6807\u7B7E\u6309\u94AE\" (click)=\"open.emit()\">\r\n\t\u6A21\u677F <mat-icon class=\"\u6A21\u677F\u56FE\u6807\" svgIcon=\"device_hub\"></mat-icon>\r\n</button>\r\n", styles: ["@charset \"UTF-8\";:host{line-height:32px}.mat-chip{width:96px;padding:0 24px 0 8px;border-radius:4px;position:relative}.mat-chip .\u5220\u9664\u6807\u7B7E{line-height:16px;position:absolute;right:8px;top:8px}.mat-chip .\u6807\u7B7E{font-size:12px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}.\u6807\u7B7E\u82AF\u7247{display:inline-block}.\u6807\u7B7E\u82AF\u7247 ::ng-deep .mat-chip-list-wrapper{margin:0}.\u6807\u7B7E\u82AF\u7247 .mat-chip{margin:0 4px}.\u6807\u7B7E\u6309\u94AE{height:32px;width:96px;line-height:32px;margin:0 16px;color:#fff;border-radius:16px}.\u6807\u7B7E\u6309\u94AE .\u6A21\u677F\u56FE\u6807{line-height:16px;margin-left:4px;vertical-align:middle}.mat-menu-item{padding:0 4px}.mat-menu-item .mat-icon{margin-right:4px}.mat-icon{width:16px;height:16px}.\u6807\u7B7E\u83DC\u5355{display:inline-block;width:200px;padding:24px 8px;position:relative;box-sizing:border-box}.\u6807\u7B7E\u83DC\u5355 .mat-chip{margin:4px 0 4px 4px}.\u6807\u7B7E\u83DC\u5355 .\u5411\u4E0A\u6807\u7B7E\u7BAD\u5934{position:absolute;top:0;right:8px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}"] }] } ]; /** @nocollapse */ LabelSelectorComponent.ctorParameters = function () { return [ { type: ServiceService } ]; }; LabelSelectorComponent.propDecorators = { open: [{ type: Output }], hostClass: [{ type: HostBinding, args: ['class.label-selector',] }] }; return LabelSelectorComponent; }()); export { LabelSelectorComponent }; if (false) { /** @type {?} */ LabelSelectorComponent.prototype.chipListShow; /** @type {?} */ LabelSelectorComponent.prototype.open; /** @type {?} */ LabelSelectorComponent.prototype.hostClass; /** @type {?} */ LabelSelectorComponent.prototype.svr; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFiZWwtc2VsZWN0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vZGJ3ZWItY29tbW9uLyIsInNvdXJjZXMiOlsibGliL3JlY29yZC12aWV3L2xhYmVsLXNlbGVjdG9yL2xhYmVsLXNlbGVjdG9yLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsV0FBVyxFQUFVLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNyRixPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFFNUQ7SUFTQyxnQ0FBbUIsR0FBbUI7UUFBbkIsUUFBRyxHQUFILEdBQUcsQ0FBZ0I7UUFIdEMsaUJBQVksR0FBRyxJQUFJLENBQUM7UUFDVixTQUFJLEdBQUcsSUFBSSxZQUFZLEVBQUUsQ0FBQztRQUNDLGNBQVMsR0FBRyxJQUFJLENBQUM7SUFDYixDQUFDOzs7O0lBRTFDLHlD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