my-test123
Version:
A planner front-end for Fabric8.
71 lines • 2.59 kB
JavaScript
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FilterService } from '../../services/filter.service';
import { Spaces } from 'ngx-fabric8-wit';
var LabelsComponent = /** @class */ (function () {
function LabelsComponent(filterService, spaces) {
this.filterService = filterService;
this.spaces = spaces;
this._labels = [];
this.onLabelClick = new EventEmitter();
this.onRemoveLabel = new EventEmitter();
this.labels = [];
this.showMore = false;
this.spaceSubscription = null;
}
Object.defineProperty(LabelsComponent.prototype, "labelInput", {
set: function (labels) {
this._labels = labels.filter(function (label) {
return label.attributes &&
label.attributes['background-color'] &&
label.attributes['text-color'];
});
},
enumerable: true,
configurable: true
});
;
LabelsComponent.prototype.ngOnInit = function () {
var _this = this;
this.spaceSubscription = this.spaces.current.subscribe(function (space) {
if (space) {
_this.spaceId = space.id;
}
else {
console.log('[Guided Work Item Types] Space deselected.');
}
});
};
LabelsComponent.prototype.moreClick = function (event) {
event.stopPropagation();
};
LabelsComponent.prototype.clickLabel = function (label, event) {
event.stopPropagation();
this.onLabelClick.emit(label);
};
LabelsComponent.prototype.removeLabel = function (label, event) {
event.stopPropagation();
this.onRemoveLabel.emit(label);
};
LabelsComponent.decorators = [
{ type: Component, args: [{
selector: 'f8-label',
template: require('./labels.component.html'),
styles: [require('./labels.component.css').toString()]
},] },
];
/** @nocollapse */
LabelsComponent.ctorParameters = function () { return [
{ type: FilterService, },
{ type: Spaces, },
]; };
LabelsComponent.propDecorators = {
'labelInput': [{ type: Input, args: ['labels',] },],
'truncateAfter': [{ type: Input },],
'allowDelete': [{ type: Input },],
'onLabelClick': [{ type: Output },],
'onRemoveLabel': [{ type: Output },],
};
return LabelsComponent;
}());
export { LabelsComponent };
//# sourceMappingURL=labels.component.js.map