UNPKG

@duoduo-oba/ng-devui

Version:

DevUI components based on Angular

187 lines (180 loc) 8.63 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/common')) : typeof define === 'function' && define.amd ? define('ng-devui/tags', ['exports', '@angular/core', '@angular/forms', '@angular/common'], factory) : (global = global || self, factory((global['ng-devui'] = global['ng-devui'] || {}, global['ng-devui'].tags = {}), global.ng.core, global.ng.forms, global.ng.common)); }(this, (function (exports, core, forms, common) { 'use strict'; /** * @fileoverview added by tsickle * Generated from: tags.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var TagsComponent = /** @class */ (function () { function TagsComponent() { /** * 【必选】记录输入的标签 */ this.tags = []; /** * 【可选】使用的属性名 */ this.displayProperty = ''; this.deletable = false; this.titleProperty = ''; /** * tag被删除后触发 */ this.tagDelete = new core.EventEmitter(); } /** * @param {?} tag * @param {?} index * @return {?} */ TagsComponent.prototype.removeTag = /** * @param {?} tag * @param {?} index * @return {?} */ function (tag, index) { this.tagDelete.emit({ tag: tag, index: index }); }; TagsComponent.decorators = [ { type: core.Component, args: [{ selector: 'd-tags', template: "<div class=\"devui-tags\">\r\n <d-tag\r\n *ngFor=\"let tag of tags; let index = index\"\r\n [tag]=\"displayProperty ? tag[displayProperty] : tag\"\r\n [deletable]=\"deletable\"\r\n [labelStyle]=\"tag['labelStyle']\"\r\n [titleContent]=\"titleProperty ? tag[titleProperty] : displayProperty ? tag[displayProperty] : tag\"\r\n [customViewTemplate]=\"customViewTemplate\"\r\n (tagDelete)=\"removeTag(tag, index)\"\r\n >\r\n </d-tag>\r\n</div>\r\n", exportAs: 'Tags', styles: [".devui-tags{padding:2px;overflow:hidden;word-wrap:break-word;height:100%}"] }] } ]; TagsComponent.propDecorators = { tags: [{ type: core.Input }], displayProperty: [{ type: core.Input }], deletable: [{ type: core.Input }], titleProperty: [{ type: core.Input }], customViewTemplate: [{ type: core.ContentChild, args: [core.TemplateRef, { static: false },] }], tagDelete: [{ type: core.Output }] }; return TagsComponent; }()); if (false) { /** * 【必选】记录输入的标签 * @type {?} */ TagsComponent.prototype.tags; /** * 【可选】使用的属性名 * @type {?} */ TagsComponent.prototype.displayProperty; /** @type {?} */ TagsComponent.prototype.deletable; /** @type {?} */ TagsComponent.prototype.titleProperty; /** @type {?} */ TagsComponent.prototype.customViewTemplate; /** * tag被删除后触发 * @type {?} */ TagsComponent.prototype.tagDelete; } /** * @fileoverview added by tsickle * Generated from: tag.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var TagComponent = /** @class */ (function () { function TagComponent() { this.labelStyle = ''; this.deletable = false; /** * tag被删除后触发 */ this.tagDelete = new core.EventEmitter(); this.deleteTag = false; } /** * @param {?} tag * @return {?} */ TagComponent.prototype.removeTag = /** * @param {?} tag * @return {?} */ function (tag) { this.deleteTag = true; this.tagDelete.emit({ tag: tag }); }; TagComponent.decorators = [ { type: core.Component, args: [{ selector: 'd-tag', template: "<span class=\"devui-tag-item {{ labelStyle }}\" [style.display]=\"deleteTag ? 'none' : 'inline-block'\">\r\n <span *ngIf=\"!customViewTemplate\" title=\"{{ titleContent ? titleContent : tag }}\">{{ tag }}</span>\r\n <ng-template *ngIf=\"customViewTemplate\" [ngTemplateOutlet]=\"customViewTemplate\" [ngTemplateOutletContext]=\"{ tag: tag }\"></ng-template>\r\n <a class=\"remove-button\" *ngIf=\"deletable\" (click)=\"removeTag(tag)\">\u00D7</a>\r\n</span>\r\n", exportAs: 'Tag', styles: [":host{display:inline-block}.devui-tag-item{display:inline-block;margin:2px;padding:0 5px;min-height:20px;font-size:14px;line-height:20px;color:#252b3a;background-color:#eef0f5;border-radius:1px;border:0 solid;border-color:inherit}.devui-tag-item .remove-button{margin-left:5px;font-size:16px;color:#252b3a;line-height:20px;vertical-align:top;cursor:pointer}.devui-tag-item .remove-button:hover{text-decoration:none}.blue-w98{color:#3383ff;background-color:#fbfdff;border-width:thin;border-color:#e1edff}.green-w98{color:#00b679;background-color:#fafefc;border-width:thin;border-color:#d9f4eb}.yellow-w98{color:#ffab05;background-color:#fffdfa;border-width:thin;border-color:#fff3da}.orange-w98{color:#ff7452;background-color:#fffcfc;border-width:thin;border-color:#ffeae5}.pink-w98{color:#ff8cc3;background-color:#fefcff;border-width:thin;border-color:#f5e8fd}.purple-w98{color:#bc67f0;background-color:#fffdfe;border-width:thin;border-color:#ffeef6}.turquoise-w98{color:#00c1de;background-color:#fafefe;border-width:thin;border-color:#d9f6fa}.olivine-w98{color:#89ba3e;background-color:#fdfefb;border-width:thin;border-color:#eef5e2}"] }] } ]; TagComponent.propDecorators = { tag: [{ type: core.Input }], labelStyle: [{ type: core.Input }], deletable: [{ type: core.Input }], titleContent: [{ type: core.Input }], customViewTemplate: [{ type: core.Input }], tagDelete: [{ type: core.Output }] }; return TagComponent; }()); if (false) { /** * 【必选】记录输入的标签 * @type {?} */ TagComponent.prototype.tag; /** @type {?} */ TagComponent.prototype.labelStyle; /** @type {?} */ TagComponent.prototype.deletable; /** @type {?} */ TagComponent.prototype.titleContent; /** @type {?} */ TagComponent.prototype.customViewTemplate; /** * tag被删除后触发 * @type {?} */ TagComponent.prototype.tagDelete; /** @type {?} */ TagComponent.prototype.deleteTag; } /** * @fileoverview added by tsickle * Generated from: tags.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var TagsModule = /** @class */ (function () { function TagsModule() { } TagsModule.decorators = [ { type: core.NgModule, args: [{ imports: [ common.CommonModule, forms.FormsModule ], exports: [ TagsComponent, TagComponent ], declarations: [ TagsComponent, TagComponent ] },] } ]; return TagsModule; }()); exports.TagComponent = TagComponent; exports.TagsComponent = TagsComponent; exports.TagsModule = TagsModule; Object.defineProperty(exports, '__esModule', { value: true }); }))); //# sourceMappingURL=ng-devui-tags.umd.js.map