bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
34 lines • 1.32 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FocusService = void 0;
var core_1 = require("@angular/core");
var i0 = require("@angular/core");
/**
* FocusService almacena el campo/elemento que actualmente tiene el foco del usuario.
*/
var FocusService = /** @class */ (function () {
function FocusService() {
// El campo/elemento con el foco
this.focused = "none";
}
FocusService.prototype.focus = function (id) {
//console.log(`focus on ${id}`);
this.focused = id;
};
FocusService.prototype.clear = function () {
//console.log('clear focus');
this.focused = undefined;
};
FocusService.prototype.getFocusedElement = function () {
//console.log(`returning focus on ${this.focused}`);
return this.focused;
};
FocusService.ɵfac = function FocusService_Factory(t) { return new (t || FocusService)(); };
FocusService.ɵprov = i0.ɵɵdefineInjectable({ token: FocusService, factory: FocusService.ɵfac });
return FocusService;
}());
exports.FocusService = FocusService;
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FocusService, [{
type: core_1.Injectable
}], null, null); })();
//# sourceMappingURL=focus.service.js.map