@skbkontur/ui-kit
Version:
36 lines • 1.28 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importDefault(require("react"));
var LinkView_1 = require("./LinkView");
var Link = /** @class */ (function (_super) {
tslib_1.__extends(Link, _super);
function Link() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.innerNode = null;
_this.refLink = function (node) {
_this.innerNode = node;
if (_this.props.linkRef) {
_this.props.linkRef(node);
}
};
return _this;
}
Link.prototype.focus = function () {
if (this.innerNode) {
this.innerNode.focus();
}
};
Link.prototype.blur = function () {
if (this.innerNode) {
this.innerNode.blur();
}
};
Link.prototype.render = function () {
var _a = this.props, linkRef = _a.linkRef, rest = tslib_1.__rest(_a, ["linkRef"]);
return react_1.default.createElement(LinkView_1.LinkView, tslib_1.__assign({}, rest, { tabIndex: rest.disabled ? -1 : 0, clickableRef: this.refLink }));
};
return Link;
}(react_1.default.Component));
exports.default = Link;
//# sourceMappingURL=Link.js.map
;