ngx-academia-uniandes-library
Version:
This library is used for Academia-Uniandes system.
100 lines • 5.78 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var search_combo_box_service_1 = require("../search-combo-box.service");
var core_2 = require("@ngx-translate/core");
var search_combo_box_generic_model_1 = require("../search-combo-box-generic/search-combo-box-generic.model");
var service_locator_1 = require("../../service-locator");
var search_academy_combo_box_component_1 = require("../search-academy-combo-box/search-academy-combo-box.component");
var titlecase_academia_pipe_1 = require("../../utils/titlecase-academia.pipe");
var SearchImpactSubcategoryComponent = /** @class */ (function (_super) {
__extends(SearchImpactSubcategoryComponent, _super);
function SearchImpactSubcategoryComponent(urlService, searchBoxUtils, transService, titlecasePipe) {
var _this = _super.call(this, urlService, searchBoxUtils, transService, new search_combo_box_generic_model_1.SearchComboBoxGenericModel(urlService.getSubCategoriesImpactsUrl(0), [{ "name": "limit", "value": 10 }], null, "subcategories", "name", 'Search SubCategories', 50), titlecasePipe) || this;
_this.urlService = urlService;
_this.searchBoxUtils = searchBoxUtils;
_this.transService = transService;
_this.titlecasePipe = titlecasePipe;
_this.categoryInfo = false;
return _this;
}
Object.defineProperty(SearchImpactSubcategoryComponent.prototype, "usernameRestrict", {
set: function (userdata) {
this.addUserNameRestriction(userdata);
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchImpactSubcategoryComponent.prototype, "setCategoryId", {
set: function (category) {
if (category) {
this.categoryId = category;
this.setCategory(category);
this.categoryInfo = true;
}
else {
this.categoryInfo = false;
}
},
enumerable: true,
configurable: true
});
SearchImpactSubcategoryComponent.prototype.ngOnInit = function () {
_super.prototype.ngOnInit.call(this);
if (this.debugFlag) {
this.model.urlService = this.urlService.getSubCategoriesImpactsUrl(this.categoryId, this.debugFlag);
}
this.setUrlServiceHost();
};
SearchImpactSubcategoryComponent.prototype.setCategory = function (categoryId) {
this.model.urlService = this.urlService.getSubCategoriesImpactsUrl(this.categoryId, this.debugFlag);
};
SearchImpactSubcategoryComponent.prototype.setUrlServiceHost = function () {
if (this.debugFlag) {
this.model.urlService = this.urlService.getSubCategoriesImpactsUrl(this.categoryId, this.debugFlag);
}
};
SearchImpactSubcategoryComponent.prototype.addUserNameRestriction = function (userData) {
if (userData != null) {
this.setUrlServiceHost();
this.coreComboImpactSubCategory.componentModel = this.model;
if (userData['dependency']) {
var extId = userData['dependency']['externalId'];
_super.prototype.addQueryParams.call(this, { "name": "dependencyExternalId", "value": extId });
this.coreComboImpactSubCategory.setInitialValue(userData['dependency']);
}
}
};
SearchImpactSubcategoryComponent.decorators = [
{ type: core_1.Component, args: [{
selector: 'app-search-impact-subcategory',
template: "\n <ng-template #customItemTemplate let-model=\"item\" let-index=\"index\">\n <div class=\"card-container\">\n <div class=\"item\"><p><span>{{model.name | titleCaseAcademia}}</span></p></div>\n </div>\n </ng-template>\n\n <app-search-combo-box-generic #corecomboimpactsubcategory [customTemplate]=\"customItemTemplate\" [preSelectedValue]= \"preSelectedValue\" [componentModel]=\"model\" [itemControl]=\"itemControl\" [isScrollable]=\"isScrollable\" (noResults)=\"sendNoResults($event)\" (itemSelected)=\"sendItemSelectedEvent($event)\"></app-search-combo-box-generic>\n ",
styles: ["\n\n "]
},] },
];
/** @nocollapse */
SearchImpactSubcategoryComponent.ctorParameters = function () { return [
{ type: service_locator_1.ServiceLocator, },
{ type: search_combo_box_service_1.SearchComboBoxService, },
{ type: core_2.TranslateService, },
{ type: titlecase_academia_pipe_1.TitleCaseAcademiaPipe, },
]; };
SearchImpactSubcategoryComponent.propDecorators = {
"usernameRestrict": [{ type: core_1.Input, args: ['userRestrict',] },],
"setCategoryId": [{ type: core_1.Input, args: ['category',] },],
"coreComboImpactSubCategory": [{ type: core_1.ViewChild, args: ['corecomboimpactsubcategory',] },],
};
return SearchImpactSubcategoryComponent;
}(search_academy_combo_box_component_1.SearchAcademyComboBoxComponent));
exports.SearchImpactSubcategoryComponent = SearchImpactSubcategoryComponent;
//# sourceMappingURL=search-impact-subcategory.component.js.map