UNPKG

ngx-academia-uniandes-library

Version:

This library is used for Academia-Uniandes system.

63 lines 4.64 kB
"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_academy_combo_box_component_1 = require("../search-academy-combo-box/search-academy-combo-box.component"); var service_locator_1 = require("../../service-locator"); var search_combo_box_service_1 = require("../search-combo-box.service"); var search_combo_box_generic_model_1 = require("../search-combo-box-generic/search-combo-box-generic.model"); var search_user_model_1 = require("./search-user-model"); var core_2 = require("@ngx-translate/core"); var titlecase_academia_pipe_1 = require("../../utils/titlecase-academia.pipe"); var NUM_MAX_VALUES = 6; var FIND_BY = 'userName'; var PLACE_HOLDER = 'Buscar Usuarios'; var SearchUserComboBoxComponent = /** @class */ (function (_super) { __extends(SearchUserComboBoxComponent, _super); function SearchUserComboBoxComponent(urlService, searchBoxUtils, transService, titlecasePipe) { var _this = _super.call(this, urlService, searchBoxUtils, transService, new search_combo_box_generic_model_1.SearchComboBoxGenericModel(urlService.getUsersUrl(), undefined, new search_user_model_1.SearchUserModel(), undefined, 'userName', PLACE_HOLDER, NUM_MAX_VALUES, FIND_BY), titlecasePipe) || this; _this.urlService = urlService; _this.searchBoxUtils = searchBoxUtils; _this.transService = transService; _this.titlecasePipe = titlecasePipe; return _this; } SearchUserComboBoxComponent.prototype.ngOnInit = function () { _super.prototype.ngOnInit.call(this); if (this.debugFlag) { this.model.urlService = this.urlService.getUsersUrl(this.debugFlag); } }; SearchUserComboBoxComponent.prototype.sendItemSelectedEvent = function (event) { if (event) { this.itemControl.setValue(event.value.toLowerCase()); } this.itemSelected.emit(event); }; SearchUserComboBoxComponent.decorators = [ { type: core_1.Component, args: [{ selector: 'search-user-combo-box', template: "\n <ng-template #customItemTemplate let-model=\"item\" let-index=\"index\">\n <div class=\"card-container\">\n <div class=\"item-container\">\n <div class=\"detail\"><b>Usuario: {{model.userName}}</b></div>\n <div *ngIf=\"model.dependency; else noneDependency\" class=\"detail\">Dependencia: <i>{{model.dependency.name}}</i></div> \n <ng-template #noneDependency><div class=\"detail\">Dependencia: <i>Sin Asignar</i></div> </ng-template>\n </div>\n </div>\n </ng-template>\n\n <app-search-combo-box-generic [customTemplate]=\"customItemTemplate\" [preSelectedValue]='preSelectedValue' [componentModel]=\"model\" [itemControl]=\"itemControl\" [isScrollable]=\"isScrollable\" (noResults)=\"sendNoResults($event)\" (typeLoading)=\"sendLoading($event)\" (itemSelected)=\"sendItemSelectedEvent($event)\"></app-search-combo-box-generic>\n ", styles: ["\n .card-container{\n display: grid;\n grid-template-columns: 1fr;\n grid-template-rows: 1fr;\n }\n\n .item{\n align-self: center;\n }\n\n .item .item-container{\n display: grid;\n grid-template-columns: 100%;\n grid-template-rows: 1fr 1fr;\n }\n\n .item .item-container .detail{\n align-self: center;\n }\n "] },] }, ]; /** @nocollapse */ SearchUserComboBoxComponent.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, }, ]; }; return SearchUserComboBoxComponent; }(search_academy_combo_box_component_1.SearchAcademyComboBoxComponent)); exports.SearchUserComboBoxComponent = SearchUserComboBoxComponent; //# sourceMappingURL=search-user-combo-box.component.js.map